diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-03-18 14:17:29 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-03-18 14:17:29 +0100 |
| commit | 35f86985bf9c3b2925a6ca576dd26c354075d0e4 (patch) | |
| tree | 61d203104b1d7957db104ab36a6c22fca529357c /src/client | |
| parent | 4bf0211ff86b4721bdbf90e441a42171a1708337 (diff) | |
| parent | 5221052b004117e8aa2763c2a8085372391b13c4 (diff) | |
Merge branch 'main' into 26.1
Diffstat (limited to 'src/client')
8 files changed, 157 insertions, 157 deletions
diff --git a/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java b/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java index 18aca76..d479674 100644 --- a/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java +++ b/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java @@ -10,40 +10,40 @@ import world.anhgelus.molehunt.game.GamePayload; public class MolehuntClient implements ClientModInitializer { - public static final Logger LOGGER = LoggerFactory.getLogger(Molehunt.MOD_ID + " - client"); - - 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() { - LOGGER.info("Initializing client"); - ClientPlayNetworking.registerGlobalReceiver(ConfigPayload.ID, (payload, context) -> { - SHOW_SKINS = payload.showSkins(); - SHOW_NAMETAGS = payload.showNametags(); - SHOW_TAB = payload.showTab(); - }); - ClientPlayNetworking.registerGlobalReceiver(GamePayload.ID, (payload, context) -> { - GAME_STARTED = payload.gameLaunched(); - }); - } + public static final Logger LOGGER = LoggerFactory.getLogger(Molehunt.MOD_ID + " - client"); + + 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() { + LOGGER.info("Initializing client"); + ClientPlayNetworking.registerGlobalReceiver(ConfigPayload.ID, (payload, context) -> { + SHOW_SKINS = payload.showSkins(); + SHOW_NAMETAGS = payload.showNametags(); + SHOW_TAB = payload.showTab(); + }); + ClientPlayNetworking.registerGlobalReceiver(GamePayload.ID, (payload, context) -> { + GAME_STARTED = payload.gameLaunched(); + }); + } } 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 c394dd3..95d85d9 100644 --- a/src/client/java/world/anhgelus/molehunt/client/mixin/NoCustomizableSkinOverlay.java +++ b/src/client/java/world/anhgelus/molehunt/client/mixin/NoCustomizableSkinOverlay.java @@ -15,41 +15,41 @@ import world.anhgelus.molehunt.client.MolehuntClient; @Mixin(Options.class) public abstract class NoCustomizableSkinOverlay { - @Unique - private static int fullParts; + @Unique + private static int fullParts; - static { - for (PlayerModelPart part : PlayerModelPart.values()) { - fullParts |= part.getMask(); - } - } - - @Shadow - protected Minecraft minecraft; + static { + for (PlayerModelPart part : PlayerModelPart.values()) { + fullParts |= part.getMask(); + } + } - @Inject(at = @At("HEAD"), method = "setModelPart", cancellable = true) - public void togglePlayerModelPart(PlayerModelPart part, boolean enabled, CallbackInfo ci) { - if (MolehuntClient.showSkins()) return; - ci.cancel(); - } + @Shadow + protected Minecraft minecraft; - @Inject(at = @At("RETURN"), method = "buildPlayerInformation", cancellable = true) - public void buildPlayerInformation(CallbackInfoReturnable<ClientInformation> cir) { - if (MolehuntClient.showSkins()) return; - final var opts = (Options) (Object) this; + @Inject(at = @At("HEAD"), method = "setModelPart", cancellable = true) + public void togglePlayerModelPart(PlayerModelPart part, boolean enabled, CallbackInfo ci) { + if (MolehuntClient.showSkins()) return; + ci.cancel(); + } - cir.setReturnValue( - new ClientInformation( - opts.languageCode, - opts.renderDistance().get(), - opts.chatVisibility().get(), - opts.chatColors().get(), - fullParts, - opts.mainHand().get(), - this.minecraft.isTextFilteringEnabled(), - opts.allowServerListing().get(), - opts.particles().get() - ) - ); - } + @Inject(at = @At("RETURN"), method = "buildPlayerInformation", cancellable = true) + public void buildPlayerInformation(CallbackInfoReturnable<ClientInformation> cir) { + if (MolehuntClient.showSkins()) return; + final var opts = (Options) (Object) this; + + cir.setReturnValue( + new ClientInformation( + opts.languageCode, + opts.renderDistance().get(), + opts.chatVisibility().get(), + opts.chatColors().get(), + fullParts, + opts.mainHand().get(), + this.minecraft.isTextFilteringEnabled(), + opts.allowServerListing().get(), + opts.particles().get() + ) + ); + } } 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 937f45e..a50c3e3 100644 --- a/src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java +++ b/src/client/java/world/anhgelus/molehunt/client/mixin/NoNametags.java @@ -12,9 +12,9 @@ import world.anhgelus.molehunt.client.MolehuntClient; @Mixin(EntityRenderer.class)
public class NoNametags<T extends Entity, S extends EntityRenderState> {
- @Inject(at = @At("HEAD"), method = "shouldShowName", cancellable = true)
- private void renderLabelOrNot(T entity, double distanceToCameraSq, CallbackInfoReturnable<Boolean> cir) {
- if (!(entity instanceof Player) || MolehuntClient.showNameTags() || !MolehuntClient.gameStarted()) return;
- cir.setReturnValue(false);
- }
+ @Inject(at = @At("HEAD"), method = "shouldShowName", cancellable = true)
+ private void renderLabelOrNot(T entity, double distanceToCameraSq, CallbackInfoReturnable<Boolean> cir) {
+ if (!(entity instanceof Player) || MolehuntClient.showNameTags() || !MolehuntClient.gameStarted()) return;
+ cir.setReturnValue(false);
+ }
}
\ 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 c235b00..c846e7d 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(PlayerTabOverlay.class)
public class NoPlayerListHud {
- @Inject(at = @At("HEAD"), method = "setVisible", cancellable = true)
- public void render(CallbackInfo ci) {
- if (MolehuntClient.showTab() || !MolehuntClient.gameStarted()) return;
- ci.cancel();
- }
+ @Inject(at = @At("HEAD"), method = "setVisible", 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 fd5a8a1..7007948 100644 --- a/src/client/java/world/anhgelus/molehunt/client/mixin/NoSkin.java +++ b/src/client/java/world/anhgelus/molehunt/client/mixin/NoSkin.java @@ -14,15 +14,15 @@ import world.anhgelus.molehunt.client.MolehuntClient; @Mixin(AbstractClientPlayer.class)
public class NoSkin {
- @Inject(at = @At("HEAD"), method = "getSkin", cancellable = true)
- public void getSkin(CallbackInfoReturnable<PlayerSkin> cir) {
- if (MolehuntClient.showSkins() || !MolehuntClient.gameStarted()) return;
- cir.setReturnValue(new PlayerSkin(
- new ClientAsset.ResourceTexture(Identifier.fromNamespaceAndPath(Molehunt.MOD_ID, "skin")),
- null,
- null,
- PlayerModelType.WIDE,
- true
- ));
- }
+ @Inject(at = @At("HEAD"), method = "getSkin", cancellable = true)
+ public void getSkin(CallbackInfoReturnable<PlayerSkin> cir) {
+ if (MolehuntClient.showSkins() || !MolehuntClient.gameStarted()) return;
+ cir.setReturnValue(new PlayerSkin(
+ new ClientAsset.ResourceTexture(Identifier.fromNamespaceAndPath(Molehunt.MOD_ID, "skin")),
+ null,
+ null,
+ PlayerModelType.WIDE,
+ true
+ ));
+ }
}
diff --git a/src/client/resources/assets/molehunt/lang/en_us.json b/src/client/resources/assets/molehunt/lang/en_us.json index 9c10680..393d6dd 100644 --- a/src/client/resources/assets/molehunt/lang/en_us.json +++ b/src/client/resources/assets/molehunt/lang/en_us.json @@ -1,29 +1,29 @@ { - "commands.molehunt.error.game_not_started": "The Molehunt game has not been started yet.", - "commands.molehunt.error.game_already_started": "The Molehunt game has already 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.error.game_already_started": "The Molehunt game has already 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 c481d76..b66060e 100644 --- a/src/client/resources/assets/molehunt/lang/fr_fr.json +++ b/src/client/resources/assets/molehunt/lang/fr_fr.json @@ -1,29 +1,29 @@ { - "commands.molehunt.error.game_not_started": "La partie de Molehunt n'a pas encore commencé.", - "commands.molehunt.error.game_already_started": "La partie de Molehunt a déjà été lancée.", - "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.error.game_already_started": "La partie de Molehunt a déjà été lancée.", + "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 + } } |
