aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-03-18 13:11:45 +0100
committerAnhgelus Morhtuuzh <william@herges.fr>2026-03-18 13:11:45 +0100
commit7ba39f866a3ab293ce81b5397c1e2975241919cb (patch)
treee2292d94c7b83ede75c72fff61c4bffd5c8de3b3 /src/client
parent3b694a936c7138acc5eaca3da2ec528c2e8c0894 (diff)
style(): switch to tab and to lf
Diffstat (limited to 'src/client')
-rw-r--r--src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java90
-rw-r--r--src/client/java/world/anhgelus/molehunt/client/mixin/NoCustomizableSkinOverlay.java16
-rw-r--r--src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java12
-rw-r--r--src/client/java/world/anhgelus/molehunt/client/mixin/NoPlayerListHud.java10
-rw-r--r--src/client/java/world/anhgelus/molehunt/client/mixin/NoSkin.java20
-rw-r--r--src/client/resources/assets/molehunt/lang/en_us.json52
-rw-r--r--src/client/resources/assets/molehunt/lang/fr_fr.json52
-rw-r--r--src/client/resources/molehunt.client.mixins.json26
8 files changed, 136 insertions, 142 deletions
diff --git a/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java b/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java
index 03198ee..f495d40 100644
--- a/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java
+++ b/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java
@@ -9,49 +9,49 @@ import world.anhgelus.molehunt.game.GamePayload;
public class MolehuntClient implements ClientModInitializer {
- private static boolean SHOW_SKINS = false;
- private static boolean SHOW_NAMETAGS = false;
- private static boolean SHOW_TAB = false;
-
- private static boolean GAME_STARTED = false;
-
- @Override
- public void onInitializeClient() {
- ClientPlayNetworking.registerGlobalReceiver(ConfigPayload.ID, (payload, context) -> context.client().execute(() -> {
- SHOW_SKINS = payload.showSkins();
- SHOW_NAMETAGS = payload.showNametags();
- SHOW_TAB = payload.showTab();
- }));
- ClientPlayNetworking.registerGlobalReceiver(GamePayload.ID, (payload, context) -> context.client().execute(() -> GAME_STARTED = payload.gameLaunched()));
-
- // Needed because else `client.options` is null
- ClientLifecycleEvents.CLIENT_STARTED.register(client -> {
- var options = client.options;
-
- options.setPlayerModelPart(PlayerModelPart.CAPE, true);
- options.setPlayerModelPart(PlayerModelPart.HAT, true);
- options.setPlayerModelPart(PlayerModelPart.JACKET, true);
- options.setPlayerModelPart(PlayerModelPart.LEFT_SLEEVE, true);
- options.setPlayerModelPart(PlayerModelPart.RIGHT_SLEEVE, true);
- options.setPlayerModelPart(PlayerModelPart.LEFT_PANTS_LEG, true);
- options.setPlayerModelPart(PlayerModelPart.RIGHT_PANTS_LEG, true);
- });
-
- }
-
- public static boolean showSkins() {
- return SHOW_SKINS;
- }
-
- public static boolean showNameTags() {
- return SHOW_NAMETAGS;
- }
-
- public static boolean showTab() {
- return SHOW_TAB;
- }
-
- public static boolean gameStarted() {
- return GAME_STARTED;
- }
+ private static boolean SHOW_SKINS = false;
+ private static boolean SHOW_NAMETAGS = false;
+ private static boolean SHOW_TAB = false;
+
+ private static boolean GAME_STARTED = false;
+
+ public static boolean showSkins() {
+ return SHOW_SKINS;
+ }
+
+ public static boolean showNameTags() {
+ return SHOW_NAMETAGS;
+ }
+
+ public static boolean showTab() {
+ return SHOW_TAB;
+ }
+
+ public static boolean gameStarted() {
+ return GAME_STARTED;
+ }
+
+ @Override
+ public void onInitializeClient() {
+ ClientPlayNetworking.registerGlobalReceiver(ConfigPayload.ID, (payload, context) -> context.client().execute(() -> {
+ SHOW_SKINS = payload.showSkins();
+ SHOW_NAMETAGS = payload.showNametags();
+ SHOW_TAB = payload.showTab();
+ }));
+ ClientPlayNetworking.registerGlobalReceiver(GamePayload.ID, (payload, context) -> context.client().execute(() -> GAME_STARTED = payload.gameLaunched()));
+
+ // Needed because else `client.options` is null
+ ClientLifecycleEvents.CLIENT_STARTED.register(client -> {
+ var options = client.options;
+
+ options.setPlayerModelPart(PlayerModelPart.CAPE, true);
+ options.setPlayerModelPart(PlayerModelPart.HAT, true);
+ options.setPlayerModelPart(PlayerModelPart.JACKET, true);
+ options.setPlayerModelPart(PlayerModelPart.LEFT_SLEEVE, true);
+ options.setPlayerModelPart(PlayerModelPart.RIGHT_SLEEVE, true);
+ options.setPlayerModelPart(PlayerModelPart.LEFT_PANTS_LEG, true);
+ options.setPlayerModelPart(PlayerModelPart.RIGHT_PANTS_LEG, true);
+ });
+
+ }
}
diff --git a/src/client/java/world/anhgelus/molehunt/client/mixin/NoCustomizableSkinOverlay.java b/src/client/java/world/anhgelus/molehunt/client/mixin/NoCustomizableSkinOverlay.java
index c2c0ab0..f253cd8 100644
--- a/src/client/java/world/anhgelus/molehunt/client/mixin/NoCustomizableSkinOverlay.java
+++ b/src/client/java/world/anhgelus/molehunt/client/mixin/NoCustomizableSkinOverlay.java
@@ -3,7 +3,6 @@ package world.anhgelus.molehunt.client.mixin;
import net.minecraft.client.option.GameOptions;
import net.minecraft.entity.player.PlayerModelPart;
import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@@ -11,14 +10,9 @@ import world.anhgelus.molehunt.client.MolehuntClient;
@Mixin(GameOptions.class)
public abstract class NoCustomizableSkinOverlay {
- @Shadow
- private void setPlayerModelPart(PlayerModelPart part, boolean enabled) {}
-
- @Inject(at = @At("HEAD"), method = "setPlayerModelPart", cancellable = true)
- public void togglePlayerModelPart(PlayerModelPart part, boolean enabled, CallbackInfo ci) {
- if (MolehuntClient.showSkins()) return;
- setPlayerModelPart(part, true);
- ((GameOptions) (Object) this).sendClientSettings();
- ci.cancel();
- }
+ @Inject(at = @At("HEAD"), method = "setPlayerModelPart", cancellable = true)
+ public void togglePlayerModelPart(PlayerModelPart part, boolean enabled, CallbackInfo ci) {
+ if (MolehuntClient.showSkins()) return;
+ ci.cancel();
+ }
}
diff --git a/src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java b/src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java
index 555fb00..cea817d 100644
--- a/src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java
+++ b/src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java
@@ -7,7 +7,6 @@ import net.minecraft.client.render.state.CameraRenderState;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
-import net.minecraft.entity.player.PlayerEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@@ -16,9 +15,10 @@ import world.anhgelus.molehunt.client.MolehuntClient;
@Mixin(EntityRenderer.class)
public class NoNametags<T extends Entity, S extends EntityRenderState> {
- @Inject(at = @At("HEAD"), method = "render", cancellable = true)
- private void renderLabelOrNot(S state, MatrixStack matrices, OrderedRenderCommandQueue queue, CameraRenderState cameraState, CallbackInfo ci) {
- if (EntityType.PLAYER != state.entityType || MolehuntClient.showNameTags() || !MolehuntClient.gameStarted()) return;
- ci.cancel();
- }
+ @Inject(at = @At("HEAD"), method = "render", cancellable = true)
+ private void renderLabelOrNot(S state, MatrixStack matrices, OrderedRenderCommandQueue queue, CameraRenderState cameraState, CallbackInfo ci) {
+ if (EntityType.PLAYER != state.entityType || MolehuntClient.showNameTags() || !MolehuntClient.gameStarted())
+ return;
+ ci.cancel();
+ }
} \ No newline at end of file
diff --git a/src/client/java/world/anhgelus/molehunt/client/mixin/NoPlayerListHud.java b/src/client/java/world/anhgelus/molehunt/client/mixin/NoPlayerListHud.java
index 4473b12..d889f06 100644
--- a/src/client/java/world/anhgelus/molehunt/client/mixin/NoPlayerListHud.java
+++ b/src/client/java/world/anhgelus/molehunt/client/mixin/NoPlayerListHud.java
@@ -9,9 +9,9 @@ import world.anhgelus.molehunt.client.MolehuntClient;
@Mixin(PlayerListHud.class)
public class NoPlayerListHud {
- @Inject(at = @At("HEAD"), method = "render", cancellable = true)
- public void render(CallbackInfo ci) {
- if (MolehuntClient.showTab() || !MolehuntClient.gameStarted()) return;
- ci.cancel();
- }
+ @Inject(at = @At("HEAD"), method = "render", cancellable = true)
+ public void render(CallbackInfo ci) {
+ if (MolehuntClient.showTab() || !MolehuntClient.gameStarted()) return;
+ ci.cancel();
+ }
}
diff --git a/src/client/java/world/anhgelus/molehunt/client/mixin/NoSkin.java b/src/client/java/world/anhgelus/molehunt/client/mixin/NoSkin.java
index b6b67cc..945ef9b 100644
--- a/src/client/java/world/anhgelus/molehunt/client/mixin/NoSkin.java
+++ b/src/client/java/world/anhgelus/molehunt/client/mixin/NoSkin.java
@@ -14,14 +14,14 @@ import world.anhgelus.molehunt.client.MolehuntClient;
@Mixin(AbstractClientPlayerEntity.class)
public class NoSkin {
- @Inject(at = @At("HEAD"), method = "getSkin", cancellable = true)
- public void getSkin(CallbackInfoReturnable<SkinTextures> cir) {
- if (MolehuntClient.showSkins() || !MolehuntClient.gameStarted()) return;
- cir.setReturnValue(SkinTextures.create(
- new AssetInfo.TextureAssetInfo(Identifier.of(Molehunt.MOD_ID, "skin")),
- null,
- null,
- PlayerSkinType.WIDE
- ));
- }
+ @Inject(at = @At("HEAD"), method = "getSkin", cancellable = true)
+ public void getSkin(CallbackInfoReturnable<SkinTextures> cir) {
+ if (MolehuntClient.showSkins() || !MolehuntClient.gameStarted()) return;
+ cir.setReturnValue(SkinTextures.create(
+ new AssetInfo.TextureAssetInfo(Identifier.of(Molehunt.MOD_ID, "skin")),
+ null,
+ null,
+ PlayerSkinType.WIDE
+ ));
+ }
}
diff --git a/src/client/resources/assets/molehunt/lang/en_us.json b/src/client/resources/assets/molehunt/lang/en_us.json
index 267230a..5bbd6f5 100644
--- a/src/client/resources/assets/molehunt/lang/en_us.json
+++ b/src/client/resources/assets/molehunt/lang/en_us.json
@@ -1,28 +1,28 @@
{
- "commands.molehunt.error.game_not_started": "The Molehunt game has not been started yet.",
- "commands.molehunt.timer.show": "Showing Molehunt timer.",
- "commands.molehunt.timer.hide": "Hiding Molehunt timer.",
- "commands.molehunt.role.mole": "§cYou are a Mole.\nKill all the survivors before the timer runs out.",
- "commands.molehunt.role.mole.list": "§eThe moles are: %s",
- "commands.molehunt.role.survivor": "§aYou are not the Mole. \nSurvive until the timer runs out, and try to discover who's the Mole.",
- "commands.molehunt.role.survivor.mole_count": "§eThere are %d §emoles among you.",
- "commands.molehunt.stop.success": "The Molehunt game has been stopped.",
- "molehunt.game.end.suspense.title": "§eAnd the winners are...",
- "molehunt.game.end.winners.moles.title": "§cThe Moles!",
- "molehunt.game.end.winners.survivors.title": "§aNot the Moles!",
- "molehunt.game.end.winners.subtitle": "§6The Moles were %s",
- "molehunt.game.start.suspense": "§eYou are...",
- "molehunt.game.start.mole.title": "§cThe Mole!",
- "molehunt.game.start.mole.subtitle": "§eGet the list of moles with §6/molehunt role§e.",
- "molehunt.game.start.survivor.title": "§aNot the Mole!",
- "molehunt.game.start.survivor.subtitle": "§eTry to survive and find out who's the mole!",
- "gamerule.molehunt:gameDuration": "Molehunt: Duration of a game",
- "gamerule.molehunt:molePercentage": "Molehunt: Percentage of Mole",
- "gamerule.molehunt:moleCount": "Molehunt: Number of Mole",
- "gamerule.molehunt:showNametags": "Molehunt: Show players' nametag",
- "gamerule.molehunt:showTab": "Molehunt: Enable the tab",
- "gamerule.molehunt:showSkins": "Molehunt: Show players' skin",
- "gamerule.molehunt:initialWorldSize": "Molehunt: Initial world size",
- "gamerule.molehunt:finalWorldSize": "Molehunt: Final world size",
- "gamerule.molehunt:borderMovingStartingTimeOffsetMinutes": "Molehunt: Time before moving the borders"
+ "commands.molehunt.error.game_not_started": "The Molehunt game has not been started yet.",
+ "commands.molehunt.timer.show": "Showing Molehunt timer.",
+ "commands.molehunt.timer.hide": "Hiding Molehunt timer.",
+ "commands.molehunt.role.mole": "§cYou are a Mole.\nKill all the survivors before the timer runs out.",
+ "commands.molehunt.role.mole.list": "§eThe moles are: %s",
+ "commands.molehunt.role.survivor": "§aYou are not the Mole. \nSurvive until the timer runs out, and try to discover who's the Mole.",
+ "commands.molehunt.role.survivor.mole_count": "§eThere are %d §emoles among you.",
+ "commands.molehunt.stop.success": "The Molehunt game has been stopped.",
+ "molehunt.game.end.suspense.title": "§eAnd the winners are...",
+ "molehunt.game.end.winners.moles.title": "§cThe Moles!",
+ "molehunt.game.end.winners.survivors.title": "§aNot the Moles!",
+ "molehunt.game.end.winners.subtitle": "§6The Moles were %s",
+ "molehunt.game.start.suspense": "§eYou are...",
+ "molehunt.game.start.mole.title": "§cThe Mole!",
+ "molehunt.game.start.mole.subtitle": "§eGet the list of moles with §6/molehunt role§e.",
+ "molehunt.game.start.survivor.title": "§aNot the Mole!",
+ "molehunt.game.start.survivor.subtitle": "§eTry to survive and find out who's the mole!",
+ "gamerule.molehunt:gameDuration": "Molehunt: Duration of a game",
+ "gamerule.molehunt:molePercentage": "Molehunt: Percentage of Mole",
+ "gamerule.molehunt:moleCount": "Molehunt: Number of Mole",
+ "gamerule.molehunt:showNametags": "Molehunt: Show players' nametag",
+ "gamerule.molehunt:showTab": "Molehunt: Enable the tab",
+ "gamerule.molehunt:showSkins": "Molehunt: Show players' skin",
+ "gamerule.molehunt:initialWorldSize": "Molehunt: Initial world size",
+ "gamerule.molehunt:finalWorldSize": "Molehunt: Final world size",
+ "gamerule.molehunt:borderMovingStartingTimeOffsetMinutes": "Molehunt: Time before moving the borders"
} \ No newline at end of file
diff --git a/src/client/resources/assets/molehunt/lang/fr_fr.json b/src/client/resources/assets/molehunt/lang/fr_fr.json
index 62c10ca..cc5133d 100644
--- a/src/client/resources/assets/molehunt/lang/fr_fr.json
+++ b/src/client/resources/assets/molehunt/lang/fr_fr.json
@@ -1,28 +1,28 @@
{
- "commands.molehunt.error.game_not_started": "La partie de Molehunt n'a pas encore commencé.",
- "commands.molehunt.timer.show": "Le timer est maintenant affiché.",
- "commands.molehunt.timer.hide": "Le timer est maintenant caché.",
- "commands.molehunt.role.mole": "§cVous êtes une taupe.\nTuez tous les survivants avant la fin de la partie..",
- "commands.molehunt.role.mole.list": "§eLes taupes sont : %s",
- "commands.molehunt.role.survivor": "§aVous n'êtes pas la taupe. \nSurvivez jusqu'à la fin, et découvrez qui sont les moles.",
- "commands.molehunt.role.survivor.mole_count": "§eIl y a %d §etaupes parmi vous.",
- "commands.molehunt.stop.success": "La partie de Molehunt a été arrêtée.",
- "molehunt.game.end.suspense.title": "§eEt les gagnants sont...",
- "molehunt.game.end.winners.moles.title": "§cLes Taupes !",
- "molehunt.game.end.winners.survivors.title": "§aPas les Taupes !",
- "molehunt.game.end.winners.subtitle": "§Les Taupes sont",
- "molehunt.game.start.suspense": "§eVous êtes...",
- "molehunt.game.start.mole.title": "§cLa Taupe !",
- "molehunt.game.start.mole.subtitle": "§eRécupérer la liste des taupes avec §6/molehunt moles",
- "molehunt.game.start.survivor.title": "§aPas la taupe!",
- "molehunt.game.start.survivor.subtitle": "§eEssaye de survivre et de trouver qui est la taupe !",
- "gamerule.molehunt:gameDuration": "Molehunt : Durée d'une partie",
- "gamerule.molehunt:molePercentage": "Molehunt : Pourcentage de Taupes",
- "gamerule.molehunt:moleCount": "Molehunt : Nombre de Taupes",
- "gamerule.molehunt:showNametags": "Molehunt : Affiche les nametags des joueurs",
- "gamerule.molehunt:showTab": "Molehunt : Active la liste des joueurs",
- "gamerule.molehunt:showSkins": "Molehunt : Affiche les skins des joueurs",
- "gamerule.molehunt:initialWorldSize": "Molehunt : Taille initiale du monde",
- "gamerule.molehunt:finalWorldSize": "Molehunt : Taille finale du monde",
- "gamerule.molehunt:borderMovingStartingTimeOffsetMinutes": "Molehunt : Temps avant de bouger les bordures du monde"
+ "commands.molehunt.error.game_not_started": "La partie de Molehunt n'a pas encore commencé.",
+ "commands.molehunt.timer.show": "Le timer est maintenant affiché.",
+ "commands.molehunt.timer.hide": "Le timer est maintenant caché.",
+ "commands.molehunt.role.mole": "§cVous êtes une taupe.\nTuez tous les survivants avant la fin de la partie..",
+ "commands.molehunt.role.mole.list": "§eLes taupes sont : %s",
+ "commands.molehunt.role.survivor": "§aVous n'êtes pas la taupe. \nSurvivez jusqu'à la fin, et découvrez qui sont les moles.",
+ "commands.molehunt.role.survivor.mole_count": "§eIl y a %d §etaupes parmi vous.",
+ "commands.molehunt.stop.success": "La partie de Molehunt a été arrêtée.",
+ "molehunt.game.end.suspense.title": "§eEt les gagnants sont...",
+ "molehunt.game.end.winners.moles.title": "§cLes Taupes !",
+ "molehunt.game.end.winners.survivors.title": "§aPas les Taupes !",
+ "molehunt.game.end.winners.subtitle": "§Les Taupes sont",
+ "molehunt.game.start.suspense": "§eVous êtes...",
+ "molehunt.game.start.mole.title": "§cLa Taupe !",
+ "molehunt.game.start.mole.subtitle": "§eRécupérer la liste des taupes avec §6/molehunt moles",
+ "molehunt.game.start.survivor.title": "§aPas la taupe!",
+ "molehunt.game.start.survivor.subtitle": "§eEssaye de survivre et de trouver qui est la taupe !",
+ "gamerule.molehunt:gameDuration": "Molehunt : Durée d'une partie",
+ "gamerule.molehunt:molePercentage": "Molehunt : Pourcentage de Taupes",
+ "gamerule.molehunt:moleCount": "Molehunt : Nombre de Taupes",
+ "gamerule.molehunt:showNametags": "Molehunt : Affiche les nametags des joueurs",
+ "gamerule.molehunt:showTab": "Molehunt : Active la liste des joueurs",
+ "gamerule.molehunt:showSkins": "Molehunt : Affiche les skins des joueurs",
+ "gamerule.molehunt:initialWorldSize": "Molehunt : Taille initiale du monde",
+ "gamerule.molehunt:finalWorldSize": "Molehunt : Taille finale du monde",
+ "gamerule.molehunt:borderMovingStartingTimeOffsetMinutes": "Molehunt : Temps avant de bouger les bordures du monde"
} \ No newline at end of file
diff --git a/src/client/resources/molehunt.client.mixins.json b/src/client/resources/molehunt.client.mixins.json
index 7b9c0f4..b966891 100644
--- a/src/client/resources/molehunt.client.mixins.json
+++ b/src/client/resources/molehunt.client.mixins.json
@@ -1,15 +1,15 @@
{
- "required": true,
- "minVersion": "0.8",
- "package": "world.anhgelus.molehunt.client.mixin",
- "compatibilityLevel": "JAVA_21",
- "client": [
- "NoCustomizableSkinOverlay",
- "NoNametags",
- "NoPlayerListHud",
- "NoSkin"
- ],
- "injectors": {
- "defaultRequire": 1
- }
+ "required": true,
+ "minVersion": "0.8",
+ "package": "world.anhgelus.molehunt.client.mixin",
+ "compatibilityLevel": "JAVA_21",
+ "client": [
+ "NoCustomizableSkinOverlay",
+ "NoNametags",
+ "NoPlayerListHud",
+ "NoSkin"
+ ],
+ "injectors": {
+ "defaultRequire": 1
+ }
}