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/java | |
| parent | 4bf0211ff86b4721bdbf90e441a42171a1708337 (diff) | |
| parent | 5221052b004117e8aa2763c2a8085372391b13c4 (diff) | |
Merge branch 'main' into 26.1
Diffstat (limited to 'src/client/java')
5 files changed, 90 insertions, 90 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
+ ));
+ }
}
|
