diff --git a/src/main/java/org/polyfrost/hytils/mixin/BossStatusMixin_HideBossbar.java b/src/main/java/org/polyfrost/hytils/mixin/BossStatusMixin_HideBossbar.java index 030f782..2bbdcce 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/BossStatusMixin_HideBossbar.java +++ b/src/main/java/org/polyfrost/hytils/mixin/BossStatusMixin_HideBossbar.java @@ -30,9 +30,8 @@ @Mixin(BossStatus.class) public abstract class BossStatusMixin_HideBossbar { - @Inject(method = "setBossStatus", at = @At("HEAD"), cancellable = true) - private static void cancelBossStatus(IBossDisplayData displayData, boolean hasColorModifierIn, CallbackInfo ci) { + private static void hytils$cancelBossStatus(IBossDisplayData displayData, boolean hasColorModifierIn, CallbackInfo ci) { if (displayData == null) return; if (HytilsConfig.lobbyBossbar && !LocrawUtil.INSTANCE.isInGame() || HytilsConfig.gameAdBossbar && displayData.getDisplayName().getFormattedText().matches(HytilsReborn.INSTANCE.getLanguageHandler().getCurrent().gameBossbarAdvertisementRegex.pattern())) ci.cancel(); diff --git a/src/main/java/org/polyfrost/hytils/mixin/CommandLimboMixin_FixCommand.java b/src/main/java/org/polyfrost/hytils/mixin/CommandLimboMixin_FixCommand.java index d2bbdb5..fee3236 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/CommandLimboMixin_FixCommand.java +++ b/src/main/java/org/polyfrost/hytils/mixin/CommandLimboMixin_FixCommand.java @@ -27,10 +27,9 @@ @Pseudo @Mixin(targets = "me.semx11.autotip.command.impl.CommandLimbo", remap = false) public class CommandLimboMixin_FixCommand { - @Dynamic("AutoTip") @ModifyConstant(method = "onCommand", constant = @Constant(stringValue = "/achat \u00a7c")) - private String fixAutotipCommand(String value) { + private String hytils$fixAutotipCommand(String value) { return "ยง"; } } diff --git a/src/main/java/org/polyfrost/hytils/mixin/EntityLivingBaseMixin_MiningFatigue.java b/src/main/java/org/polyfrost/hytils/mixin/EntityLivingBaseMixin_MiningFatigue.java index ad3dffd..76763be 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/EntityLivingBaseMixin_MiningFatigue.java +++ b/src/main/java/org/polyfrost/hytils/mixin/EntityLivingBaseMixin_MiningFatigue.java @@ -27,18 +27,19 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(EntityLivingBase.class) public class EntityLivingBaseMixin_MiningFatigue { - private final EntityLivingBase $this = (EntityLivingBase) (Object) this; - + @Unique + private final EntityLivingBase hytils$this = (EntityLivingBase) (Object) this; @Inject(method = "addPotionEffect", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/EntityLivingBase;onNewPotionEffect(Lnet/minecraft/potion/PotionEffect;)V")) - private void onPotionEffect(PotionEffect potioneffectIn, CallbackInfo ci) { - if (HytilsConfig.notifyMiningFatigue && potioneffectIn.getPotionID() == Potion.digSlowdown.getId() && LocrawUtil.INSTANCE.getLocrawInfo() != null && ($this instanceof EntityPlayerSP) && (!HytilsConfig.disableNotifyMiningFatigueSkyblock || !(LocrawUtil.INSTANCE.getLocrawInfo().getGameType() == LocrawInfo.GameType.SKYBLOCK))) { + private void hytils$onPotionEffect(PotionEffect potioneffectIn, CallbackInfo ci) { + if (HytilsConfig.notifyMiningFatigue && potioneffectIn.getPotionID() == Potion.digSlowdown.getId() && LocrawUtil.INSTANCE.getLocrawInfo() != null && (hytils$this instanceof EntityPlayerSP) && (!HytilsConfig.disableNotifyMiningFatigueSkyblock || !(LocrawUtil.INSTANCE.getLocrawInfo().getGameType() == LocrawInfo.GameType.SKYBLOCK))) { Notifications.INSTANCE.send("Hytils Reborn", "You have mining fatigue!"); } } diff --git a/src/main/java/org/polyfrost/hytils/mixin/EntityPlayerSPMixin_MessageHandling.java b/src/main/java/org/polyfrost/hytils/mixin/EntityPlayerSPMixin_MessageHandling.java index eead449..514ecc8 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/EntityPlayerSPMixin_MessageHandling.java +++ b/src/main/java/org/polyfrost/hytils/mixin/EntityPlayerSPMixin_MessageHandling.java @@ -28,7 +28,7 @@ @Mixin(EntityPlayerSP.class) public class EntityPlayerSPMixin_MessageHandling { @Inject(method = "sendChatMessage", at = @At("HEAD"), cancellable = true) - private void handleSentMessages(String message, CallbackInfo ci) { + private void hytils$handleSentMessages(String message, CallbackInfo ci) { if (HytilsReborn.INSTANCE.getChatHandler().handleSentMessage(message) == null) ci.cancel(); } } diff --git a/src/main/java/org/polyfrost/hytils/mixin/GuiChatMixin_PlayAutocomplete.java b/src/main/java/org/polyfrost/hytils/mixin/GuiChatMixin_PlayAutocomplete.java index d5136fd..8f11725 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/GuiChatMixin_PlayAutocomplete.java +++ b/src/main/java/org/polyfrost/hytils/mixin/GuiChatMixin_PlayAutocomplete.java @@ -34,7 +34,7 @@ public class GuiChatMixin_PlayAutocomplete extends GuiScreen { protected GuiTextField inputField; @Redirect(method = "autocompletePlayerNames", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiNewChat;printChatMessageWithOptionalDeletion(Lnet/minecraft/util/IChatComponent;I)V")) - private void redirectAutocomplete(GuiNewChat instance, IChatComponent chatComponent, int chatLineId) { + private void hytils$redirectAutocomplete(GuiNewChat instance, IChatComponent chatComponent, int chatLineId) { if (!this.inputField.getText().startsWith("/play ")) { instance.printChatMessageWithOptionalDeletion(chatComponent, 1); } diff --git a/src/main/java/org/polyfrost/hytils/mixin/GuiIngameAccessor.java b/src/main/java/org/polyfrost/hytils/mixin/GuiIngameAccessor.java index d626b41..049c098 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/GuiIngameAccessor.java +++ b/src/main/java/org/polyfrost/hytils/mixin/GuiIngameAccessor.java @@ -24,7 +24,6 @@ @Mixin(GuiIngame.class) public interface GuiIngameAccessor { - @Accessor("displayedTitle") void setDisplayedTitle(String title); diff --git a/src/main/java/org/polyfrost/hytils/mixin/GuiIngameForgeMixin_HideActionbar.java b/src/main/java/org/polyfrost/hytils/mixin/GuiIngameForgeMixin_HideActionbar.java index c6753e9..e9aed38 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/GuiIngameForgeMixin_HideActionbar.java +++ b/src/main/java/org/polyfrost/hytils/mixin/GuiIngameForgeMixin_HideActionbar.java @@ -31,7 +31,7 @@ @Mixin(value = GuiIngameForge.class, remap = false, priority = 990) public class GuiIngameForgeMixin_HideActionbar { @Inject(method = "renderRecordOverlay", at = @At("HEAD"), cancellable = true) - private void cancelActionBar(int width, int height, float partialTicks, CallbackInfo ci) { + private void hytils$cancelActionBar(int width, int height, float partialTicks, CallbackInfo ci) { if (HypixelUtils.INSTANCE.isHypixel() && LocrawUtil.INSTANCE.getLocrawInfo() != null && ((HytilsConfig.hideHousingActionBar && LocrawUtil.INSTANCE.getLocrawInfo().getGameType() == LocrawInfo.GameType.HOUSING) || (HytilsConfig.hideDropperActionBar && LocrawUtil.INSTANCE.getLocrawInfo().getGameMode().equals("DROPPER")))) ci.cancel(); } diff --git a/src/main/java/org/polyfrost/hytils/mixin/GuiIngameForgeMixin_HideHotbar.java b/src/main/java/org/polyfrost/hytils/mixin/GuiIngameForgeMixin_HideHotbar.java index c7a9933..a726e76 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/GuiIngameForgeMixin_HideHotbar.java +++ b/src/main/java/org/polyfrost/hytils/mixin/GuiIngameForgeMixin_HideHotbar.java @@ -32,7 +32,7 @@ @Mixin(value = GuiIngameForge.class, remap = false) public class GuiIngameForgeMixin_HideHotbar { @Inject(method = "renderHealth", at = @At("HEAD"), cancellable = true) - public void cancelHealthbar(int width, int height, CallbackInfo ci) { + public void hytils$cancelHealthbar(int width, int height, CallbackInfo ci) { LocrawInfo locraw = LocrawUtil.INSTANCE.getLocrawInfo(); if (HytilsConfig.hideHudElements && HypixelUtils.INSTANCE.isHypixel()) { if (!LocrawUtil.INSTANCE.isInGame()) { @@ -80,7 +80,7 @@ public void cancelHealthbar(int width, int height, CallbackInfo ci) { } @Inject(method = "renderFood", at = @At("HEAD"), cancellable = true) - public void cancelFood(int width, int height, CallbackInfo ci) { + public void hytils$cancelFood(int width, int height, CallbackInfo ci) { LocrawInfo locraw = LocrawUtil.INSTANCE.getLocrawInfo(); if (HytilsConfig.hideHudElements && HypixelUtils.INSTANCE.isHypixel()) { if (!LocrawUtil.INSTANCE.isInGame()) { @@ -135,7 +135,7 @@ public void cancelFood(int width, int height, CallbackInfo ci) { } @Inject(method = "renderArmor", at = @At("HEAD"), cancellable = true) - public void cancelArmor(int width, int height, CallbackInfo ci) { + public void hytils$cancelArmor(int width, int height, CallbackInfo ci) { LocrawInfo locraw = LocrawUtil.INSTANCE.getLocrawInfo(); if (HytilsConfig.hideHudElements && HypixelUtils.INSTANCE.isHypixel()) { if (!LocrawUtil.INSTANCE.isInGame()) { @@ -173,7 +173,7 @@ public void cancelArmor(int width, int height, CallbackInfo ci) { } @Inject(method = "renderAir", at = @At("HEAD"), cancellable = true) - public void cancelAir(int width, int height, CallbackInfo ci) { + public void hytils$cancelAir(int width, int height, CallbackInfo ci) { LocrawInfo locraw = LocrawUtil.INSTANCE.getLocrawInfo(); if (HytilsConfig.hideHudElements && HypixelUtils.INSTANCE.isHypixel()) { if (!LocrawUtil.INSTANCE.isInGame()) { diff --git a/src/main/java/org/polyfrost/hytils/mixin/GuiIngameForgeMixin_TitleEvent.java b/src/main/java/org/polyfrost/hytils/mixin/GuiIngameForgeMixin_TitleEvent.java index 696f454..bca8520 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/GuiIngameForgeMixin_TitleEvent.java +++ b/src/main/java/org/polyfrost/hytils/mixin/GuiIngameForgeMixin_TitleEvent.java @@ -39,12 +39,12 @@ public GuiIngameForgeMixin_TitleEvent(Minecraft mcIn) { } @Redirect(method = "renderHealth", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/storage/WorldInfo;isHardcoreModeEnabled()Z", remap = true)) - private boolean isHardcore(WorldInfo instance) { + private boolean hytils$isHardcore(WorldInfo instance) { return instance.isHardcoreModeEnabled() || HytilsReborn.INSTANCE.getHardcoreStatus().shouldChangeStyle(); } @Inject(method = "renderTitle", at = @At("HEAD"), cancellable = true) - private void postTitleEvent(int l, int age, float opacity, CallbackInfo ci) { + private void hytils$postTitleEvent(int l, int age, float opacity, CallbackInfo ci) { if (HypixelUtils.INSTANCE.isHypixel()) { TitleEvent event = new TitleEvent(displayedTitle, displayedSubTitle); MinecraftForge.EVENT_BUS.post(event); diff --git a/src/main/java/org/polyfrost/hytils/mixin/GuiNewChatMixin_LocrawHider.java b/src/main/java/org/polyfrost/hytils/mixin/GuiNewChatMixin_LocrawHider.java index a55d606..f67de22 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/GuiNewChatMixin_LocrawHider.java +++ b/src/main/java/org/polyfrost/hytils/mixin/GuiNewChatMixin_LocrawHider.java @@ -28,6 +28,7 @@ import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -46,16 +47,17 @@ public abstract class GuiNewChatMixin_LocrawHider { @Shadow public abstract void deleteChatLine(int id); @Inject(method = "printChatMessageWithOptionalDeletion", at = @At("HEAD"), cancellable = true) - private void handlePrintChatMessage(IChatComponent chatComponent, int chatLineId, CallbackInfo ci) { - handleHytilsMessage(chatComponent, chatLineId, mc.ingameGUI.getUpdateCounter(), false, ci); + private void hytils$handlePrintChatMessage(IChatComponent chatComponent, int chatLineId, CallbackInfo ci) { + hytils$handleHytilsMessage(chatComponent, chatLineId, mc.ingameGUI.getUpdateCounter(), false, ci); } @Inject(method = "setChatLine", at = @At("HEAD"), cancellable = true) - private void handleSetChatLine(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) { - handleHytilsMessage(chatComponent, chatLineId, updateCounter, displayOnly, ci); + private void hytils$handleSetChatLine(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) { + hytils$handleHytilsMessage(chatComponent, chatLineId, updateCounter, displayOnly, ci); } - private void handleHytilsMessage(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) { + @Unique + private void hytils$handleHytilsMessage(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) { if (HytilsConfig.hideLocraw && HypixelUtils.INSTANCE.isHypixel() && chatComponent.getUnformattedTextForChat().startsWith("{") && chatComponent.getUnformattedTextForChat().endsWith("}")) { percentComplete = 1.0F; if (chatLineId != 0) { diff --git a/src/main/java/org/polyfrost/hytils/mixin/GuiPlayerTabOverlayMixin_HideNPCs.java b/src/main/java/org/polyfrost/hytils/mixin/GuiPlayerTabOverlayMixin_HideNPCs.java index 470f970..c024676 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/GuiPlayerTabOverlayMixin_HideNPCs.java +++ b/src/main/java/org/polyfrost/hytils/mixin/GuiPlayerTabOverlayMixin_HideNPCs.java @@ -31,7 +31,7 @@ @Mixin(GuiPlayerTabOverlay.class) public class GuiPlayerTabOverlayMixin_HideNPCs { @Redirect(method = "renderPlayerlist", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/NetHandlerPlayClient;getPlayerInfoMap()Ljava/util/Collection;")) - private Collection hideNPCs(NetHandlerPlayClient instance) { + private Collection hytils$hideNPCs(NetHandlerPlayClient instance) { return NPCHandler.hideTabNpcs(instance.getPlayerInfoMap()); } } diff --git a/src/main/java/org/polyfrost/hytils/mixin/GuiPlayerTabOverlayMixin_HidePing.java b/src/main/java/org/polyfrost/hytils/mixin/GuiPlayerTabOverlayMixin_HidePing.java index 8b971f5..ffe3bb2 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/GuiPlayerTabOverlayMixin_HidePing.java +++ b/src/main/java/org/polyfrost/hytils/mixin/GuiPlayerTabOverlayMixin_HidePing.java @@ -29,7 +29,7 @@ @Mixin(value = GuiPlayerTabOverlay.class, priority = 990) public class GuiPlayerTabOverlayMixin_HidePing { @Inject(method = "drawPing", at = @At("HEAD"), cancellable = true) - private void checkPlayer(int p_175245_1_, int p_175245_2_, int p_175245_3_, NetworkPlayerInfo networkPlayerInfoIn, CallbackInfo ci) { + private void hytils$checkPlayer(int p_175245_1_, int p_175245_2_, int p_175245_3_, NetworkPlayerInfo networkPlayerInfoIn, CallbackInfo ci) { if (TabChanger.hidePing(networkPlayerInfoIn)) ci.cancel(); } } diff --git a/src/main/java/org/polyfrost/hytils/mixin/GuiPlayerTabOverlayMixin_RemoveAds.java b/src/main/java/org/polyfrost/hytils/mixin/GuiPlayerTabOverlayMixin_RemoveAds.java index 10bcb00..3757636 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/GuiPlayerTabOverlayMixin_RemoveAds.java +++ b/src/main/java/org/polyfrost/hytils/mixin/GuiPlayerTabOverlayMixin_RemoveAds.java @@ -29,15 +29,14 @@ @Mixin(GuiPlayerTabOverlay.class) public class GuiPlayerTabOverlayMixin_RemoveAds { - @Redirect(method = "renderPlayerlist", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;listFormattedStringToWidth(Ljava/lang/String;I)Ljava/util/List;", ordinal = 1)) - private List hideAdvertisementsInTabFooter(FontRenderer instance, String formattedFooter, int wrapWidth) { + private List hytils$hideAdvertisementsInTabFooter(FontRenderer instance, String formattedFooter, int wrapWidth) { return TabChanger.modifyFooter(instance, formattedFooter, wrapWidth); } @Redirect(method = "renderPlayerlist", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;listFormattedStringToWidth(Ljava/lang/String;I)Ljava/util/List;", ordinal = 0)) - private List hideAdvertisementsInTabHeader(FontRenderer instance, String formattedHeader, int wrapWidth) { + private List hytils$hideAdvertisementsInTabHeader(FontRenderer instance, String formattedHeader, int wrapWidth) { return TabChanger.modifyHeader(instance, formattedHeader, wrapWidth); } diff --git a/src/main/java/org/polyfrost/hytils/mixin/LayerArmorBaseMixin_HideIngameArmour.java b/src/main/java/org/polyfrost/hytils/mixin/LayerArmorBaseMixin_HideIngameArmour.java index 1c14435..ee9c1da 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/LayerArmorBaseMixin_HideIngameArmour.java +++ b/src/main/java/org/polyfrost/hytils/mixin/LayerArmorBaseMixin_HideIngameArmour.java @@ -29,6 +29,7 @@ import net.minecraft.item.ItemStack; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -39,13 +40,14 @@ public abstract class LayerArmorBaseMixin_HideIngameArmour { public abstract ItemStack getCurrentArmor(EntityLivingBase entitylivingbaseIn, int armorSlot); @Inject(method = "renderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/layers/LayerArmorBase;getArmorModel(I)Lnet/minecraft/client/model/ModelBase;"), cancellable = true) - private void cancelArmor(EntityLivingBase entitylivingbaseIn, float p_177182_2_, float p_177182_3_, float partialTicks, float p_177182_5_, float p_177182_6_, float p_177182_7_, float scale, int armorSlot, CallbackInfo ci) { - if (shouldCancel(getCurrentArmor(entitylivingbaseIn, armorSlot)) && !entitylivingbaseIn.isInvisible()) { + private void hytils$cancelArmor(EntityLivingBase entitylivingbaseIn, float p_177182_2_, float p_177182_3_, float partialTicks, float p_177182_5_, float p_177182_6_, float p_177182_7_, float scale, int armorSlot, CallbackInfo ci) { + if (hytils$shouldCancel(getCurrentArmor(entitylivingbaseIn, armorSlot)) && !entitylivingbaseIn.isInvisible()) { ci.cancel(); } } - private static boolean shouldCancel(ItemStack itemStack) { + @Unique + private static boolean hytils$shouldCancel(ItemStack itemStack) { if (!HytilsConfig.hideArmor || itemStack == null || !HypixelUtils.INSTANCE.isHypixel()) return false; final LocrawInfo locraw = LocrawUtil.INSTANCE.getLocrawInfo(); final Item item = itemStack.getItem(); diff --git a/src/main/java/org/polyfrost/hytils/mixin/MinecraftMixin_LeftClickInteract.java b/src/main/java/org/polyfrost/hytils/mixin/MinecraftMixin_LeftClickInteract.java index 5c1444e..679ae89 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/MinecraftMixin_LeftClickInteract.java +++ b/src/main/java/org/polyfrost/hytils/mixin/MinecraftMixin_LeftClickInteract.java @@ -44,7 +44,7 @@ public class MinecraftMixin_LeftClickInteract { public EntityPlayerSP thePlayer; @Redirect(method = "clickMouse", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/PlayerControllerMP;clickBlock(Lnet/minecraft/util/BlockPos;Lnet/minecraft/util/EnumFacing;)Z")) - private boolean captureClickBlock(PlayerControllerMP instance, BlockPos itemstack, EnumFacing block1) { + private boolean hytils$captureClickBlock(PlayerControllerMP instance, BlockPos itemstack, EnumFacing block1) { ForgeEventFactory.onPlayerInteract(thePlayer, PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, theWorld, itemstack, objectMouseOver.sideHit, objectMouseOver.hitVec); return instance.clickBlock(itemstack, block1); } diff --git a/src/main/java/org/polyfrost/hytils/mixin/MinecraftMixin_LimboLimiter.java b/src/main/java/org/polyfrost/hytils/mixin/MinecraftMixin_LimboLimiter.java index 4af5d5b..a01545d 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/MinecraftMixin_LimboLimiter.java +++ b/src/main/java/org/polyfrost/hytils/mixin/MinecraftMixin_LimboLimiter.java @@ -28,9 +28,8 @@ @Mixin(Minecraft.class) public class MinecraftMixin_LimboLimiter { - @Inject(method = "getLimitFramerate", at = @At("HEAD"), cancellable = true) - private void limitFramerate(CallbackInfoReturnable cir) { + private void hytils$limitFramerate(CallbackInfoReturnable cir) { if (LimboLimiter.shouldLimitFramerate()) cir.setReturnValue(HytilsConfig.limboFPS); } } diff --git a/src/main/java/org/polyfrost/hytils/mixin/RenderEntityItemMixin_UHCOverlay.java b/src/main/java/org/polyfrost/hytils/mixin/RenderEntityItemMixin_UHCOverlay.java index 5750446..a511b5b 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/RenderEntityItemMixin_UHCOverlay.java +++ b/src/main/java/org/polyfrost/hytils/mixin/RenderEntityItemMixin_UHCOverlay.java @@ -35,7 +35,7 @@ @Mixin(RenderEntityItem.class) public class RenderEntityItemMixin_UHCOverlay { @Inject(method = "func_177077_a(Lnet/minecraft/entity/item/EntityItem;DDDFLnet/minecraft/client/resources/model/IBakedModel;)I", at = @At(("TAIL"))) - public void scaleSpecialItems(EntityItem entity, double f4, double f5, double flag, float i, IBakedModel f, CallbackInfoReturnable cir) { + public void hytils$scaleSpecialItems(EntityItem entity, double f4, double f5, double flag, float i, IBakedModel f, CallbackInfoReturnable cir) { Item item = entity.getEntityItem().getItem(); LocrawInfo locraw = LocrawUtil.INSTANCE.getLocrawInfo(); if (HypixelUtils.INSTANCE.isHypixel() && locraw != null && (locraw.getGameType() == LocrawInfo.GameType.UHC_CHAMPIONS || locraw.getGameType() == LocrawInfo.GameType.SPEED_UHC) && HytilsConfig.uhcOverlay) { diff --git a/src/main/java/org/polyfrost/hytils/mixin/beds/BlockModelShapesMixin.java b/src/main/java/org/polyfrost/hytils/mixin/beds/BlockModelShapesMixin.java index 02a0e8c..df6e50a 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/beds/BlockModelShapesMixin.java +++ b/src/main/java/org/polyfrost/hytils/mixin/beds/BlockModelShapesMixin.java @@ -33,7 +33,7 @@ @Mixin(BlockModelShapes.class) public class BlockModelShapesMixin { @Inject(method = "getTexture", at = @At("HEAD"), cancellable = true) - private void addBedTextures(IBlockState state, CallbackInfoReturnable cir) { + private void hytils$addBedTextures(IBlockState state, CallbackInfoReturnable cir) { IBakedModel model = BedModelHook.getBedModel(state, Minecraft.getMinecraft().thePlayer.getPosition(), null); if (model != null) { cir.setReturnValue(model.getParticleTexture()); @@ -41,7 +41,7 @@ private void addBedTextures(IBlockState state, CallbackInfoReturnable cir) { + private void hytils$addBedModels(IBlockState state, IBlockAccess worldIn, BlockPos pos, CallbackInfoReturnable cir) { IBakedModel model = BedModelHook.getBedModel(state, pos, cir.getReturnValue()); if (model != null) { cir.setReturnValue(model); diff --git a/src/main/java/org/polyfrost/hytils/mixin/beds/ModelLoaderMixin.java b/src/main/java/org/polyfrost/hytils/mixin/beds/ModelLoaderMixin.java index 302d62b..e2e233a 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/beds/ModelLoaderMixin.java +++ b/src/main/java/org/polyfrost/hytils/mixin/beds/ModelLoaderMixin.java @@ -38,7 +38,7 @@ public class ModelLoaderMixin { private Set textures; @Inject(method = "setupModelRegistry", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/texture/TextureMap;loadSprites(Lnet/minecraft/client/resources/IResourceManager;Lnet/minecraft/client/renderer/texture/IIconCreator;)V"), remap = true) - private void getVariantsTextureLocations(CallbackInfoReturnable> cir) { + private void hytils$getVariantsTextureLocations(CallbackInfoReturnable> cir) { for (String color : BedLocationHandler.COLORS_REVERSE.values()) { textures.add(new ResourceLocation(BedModelHook.COLORED_BED + color)); } diff --git a/src/main/java/org/polyfrost/hytils/mixin/cosmetics/RenderEntityItemMixin.java b/src/main/java/org/polyfrost/hytils/mixin/cosmetics/RenderEntityItemMixin.java index 8ca58e0..b25e4b9 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/cosmetics/RenderEntityItemMixin.java +++ b/src/main/java/org/polyfrost/hytils/mixin/cosmetics/RenderEntityItemMixin.java @@ -27,6 +27,7 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.item.*; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -36,16 +37,17 @@ @Mixin(RenderEntityItem.class) public class RenderEntityItemMixin { @Inject(method = "doRender(Lnet/minecraft/entity/item/EntityItem;DDDFF)V", at = @At("HEAD"), cancellable = true) - private void removeItemCosmetics(EntityItem entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { + private void hytils$removeItemCosmetics(EntityItem entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { ItemStack stack = entity.getEntityItem(); if (stack == null) return; if ((HytilsConfig.hideDuelsCosmetics && LocrawUtil.INSTANCE.getLocrawInfo() != null && LocrawUtil.INSTANCE.getLocrawInfo().getGameType() == LocrawInfo.GameType.DUELS) || (HytilsConfig.hideArcadeCosmetics && LocrawUtil.INSTANCE.getLocrawInfo() != null && LocrawUtil.INSTANCE.getLocrawInfo().getGameType() == LocrawInfo.GameType.ARCADE_GAMES) && LocrawUtil.INSTANCE.isInGame() && - (stack.getItem() instanceof ItemDoublePlant || stack.getItem() instanceof ItemDye || stack.getItem() instanceof ItemRecord || shouldRemove(stack.getItem().getUnlocalizedName()) || (stack.getItem() instanceof ItemBlock && (shouldRemove(((ItemBlock) stack.getItem()).block.getUnlocalizedName()) || ((ItemBlock) stack.getItem()).block instanceof BlockPumpkin)))) ci.cancel(); + (stack.getItem() instanceof ItemDoublePlant || stack.getItem() instanceof ItemDye || stack.getItem() instanceof ItemRecord || hytils$shouldRemove(stack.getItem().getUnlocalizedName()) || (stack.getItem() instanceof ItemBlock && (hytils$shouldRemove(((ItemBlock) stack.getItem()).block.getUnlocalizedName()) || ((ItemBlock) stack.getItem()).block instanceof BlockPumpkin)))) ci.cancel(); } - private boolean shouldRemove(String name) { + @Unique + private boolean hytils$shouldRemove(String name) { AtomicBoolean yes = new AtomicBoolean(); CosmeticsHandler.INSTANCE.itemCosmetics.forEach((itemName) -> { if (name.equals(itemName)) yes.set(true); diff --git a/src/main/java/org/polyfrost/hytils/mixin/cosmetics/WorldMixin.java b/src/main/java/org/polyfrost/hytils/mixin/cosmetics/WorldMixin.java index 1b0a5d8..d3d0d4d 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/cosmetics/WorldMixin.java +++ b/src/main/java/org/polyfrost/hytils/mixin/cosmetics/WorldMixin.java @@ -31,9 +31,8 @@ @Mixin(World.class) public class WorldMixin { - @Inject(method = "spawnParticle(IZDDDDDD[I)V", at = @At("HEAD"), cancellable = true) - private void removeParticles(int particleID, boolean p_175720_2_, double xCood, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int[] p_175720_15_, CallbackInfo ci) { + private void hytils$removeParticles(int particleID, boolean p_175720_2_, double xCood, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int[] p_175720_15_, CallbackInfo ci) { if ((HytilsConfig.hideDuelsCosmetics && LocrawUtil.INSTANCE.getLocrawInfo() != null && LocrawUtil.INSTANCE.getLocrawInfo().getGameType() == LocrawInfo.GameType.DUELS) || (HytilsConfig.hideArcadeCosmetics && LocrawUtil.INSTANCE.getLocrawInfo() != null && LocrawUtil.INSTANCE.getLocrawInfo().getGameType() == LocrawInfo.GameType.ARCADE_GAMES) && LocrawUtil.INSTANCE.isInGame()) { String particleName = EnumParticleTypes.getParticleFromId(particleID).getParticleName(); diff --git a/src/main/java/org/polyfrost/hytils/mixin/lineseparator/GuiNewChatMixin.java b/src/main/java/org/polyfrost/hytils/mixin/lineseparator/GuiNewChatMixin.java index 44692ed..d6333f2 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/lineseparator/GuiNewChatMixin.java +++ b/src/main/java/org/polyfrost/hytils/mixin/lineseparator/GuiNewChatMixin.java @@ -30,17 +30,17 @@ @Mixin(GuiNewChat.class) public class GuiNewChatMixin { @Inject(method = "setChatLine", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiUtilRenderComponents;splitText(Lnet/minecraft/util/IChatComponent;ILnet/minecraft/client/gui/FontRenderer;ZZ)Ljava/util/List;")) - private void beforeSplitText(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) { + private void hytils$beforeSplitText(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) { LineSeparatorEnhancements.isSeparatingChat = true; } @Inject(method = "setChatLine", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiUtilRenderComponents;splitText(Lnet/minecraft/util/IChatComponent;ILnet/minecraft/client/gui/FontRenderer;ZZ)Ljava/util/List;", shift = At.Shift.AFTER)) - private void afterSplitText(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) { + private void hytils$afterSplitText(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) { LineSeparatorEnhancements.isSeparatingChat = false; } @ModifyArg(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawStringWithShadow(Ljava/lang/String;FFI)I")) - private String changeText(String text) { + private String hytils$changeText(String text) { return LineSeparatorEnhancements.cleanLineSeparator(text); } } diff --git a/src/main/java/org/polyfrost/hytils/mixin/lineseparator/GuiUtilRenderComponentsMixin.java b/src/main/java/org/polyfrost/hytils/mixin/lineseparator/GuiUtilRenderComponentsMixin.java index 3c8a1c7..484e1d7 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/lineseparator/GuiUtilRenderComponentsMixin.java +++ b/src/main/java/org/polyfrost/hytils/mixin/lineseparator/GuiUtilRenderComponentsMixin.java @@ -30,10 +30,9 @@ @Mixin(GuiUtilRenderComponents.class) public class GuiUtilRenderComponentsMixin { - @Dynamic @Redirect(method = "splitText", at = @At(value = "INVOKE", target = "Ljava/util/List;add(Ljava/lang/Object;)Z", ordinal = 1)) - private static boolean trimLineSeparator(List list, Object obj) { + private static boolean hytils$trimLineSeparator(List list, Object obj) { boolean value = false; if (obj instanceof IChatComponent) { value = list.add((IChatComponent) obj); diff --git a/src/main/java/org/polyfrost/hytils/mixin/overlay/BlockModelRendererMixin_NoOptiFine.java b/src/main/java/org/polyfrost/hytils/mixin/overlay/BlockModelRendererMixin_NoOptiFine.java index 38a2db3..2b8eaf1 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/overlay/BlockModelRendererMixin_NoOptiFine.java +++ b/src/main/java/org/polyfrost/hytils/mixin/overlay/BlockModelRendererMixin_NoOptiFine.java @@ -37,7 +37,7 @@ @Mixin(BlockModelRenderer.class) public class BlockModelRendererMixin_NoOptiFine { @ModifyArgs(method = "renderModelAmbientOcclusionQuads", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/WorldRenderer;putColorMultiplier(FFFI)V")) - private void modifyArgs(Args args, IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, List listQuadsIn, float[] quadBounds, BitSet boundsFlags, BlockModelRenderer.AmbientOcclusionFace aoFaceIn) { + private void hytils$modifyArgs(Args args, IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, List listQuadsIn, float[] quadBounds, BitSet boundsFlags, BlockModelRenderer.AmbientOcclusionFace aoFaceIn) { try { BlockModelRendererHook.handleHeightOverlay(args, blockAccessIn.getBlockState(blockPosIn), blockPosIn); } catch (Exception ignored) { @@ -46,7 +46,7 @@ private void modifyArgs(Args args, IBlockAccess blockAccessIn, Block blockIn, Bl } @ModifyArgs(method = "renderModelStandardQuads", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/WorldRenderer;putColorMultiplier(FFFI)V")) - private void modifyArg2s(Args args, IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, EnumFacing faceIn, int brightnessIn, boolean ownBrightness, WorldRenderer worldRendererIn, List listQuadsIn, BitSet boundsFlags) { + private void hytils$modifyArg2s(Args args, IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, EnumFacing faceIn, int brightnessIn, boolean ownBrightness, WorldRenderer worldRendererIn, List listQuadsIn, BitSet boundsFlags) { try { BlockModelRendererHook.handleHeightOverlay(args, blockAccessIn.getBlockState(blockPosIn), blockPosIn); } catch (Exception ignored) { diff --git a/src/main/java/org/polyfrost/hytils/mixin/overlay/BlockModelRendererMixin_OptiFine.java b/src/main/java/org/polyfrost/hytils/mixin/overlay/BlockModelRendererMixin_OptiFine.java index 1840cf2..84cd456 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/overlay/BlockModelRendererMixin_OptiFine.java +++ b/src/main/java/org/polyfrost/hytils/mixin/overlay/BlockModelRendererMixin_OptiFine.java @@ -37,10 +37,9 @@ @Mixin(BlockModelRenderer.class) public class BlockModelRendererMixin_OptiFine { - @Dynamic("OptiFine implements its own version of renderModelAmbientOcclusionQuads") @ModifyArgs(method = "renderQuadsSmooth", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/WorldRenderer;putColorMultiplier(FFFI)V", remap = true), remap = false) - private void modifyArgs(Args args, IBlockAccess worldIn, IBlockState stateIn, BlockPos blockPosIn, WorldRenderer buffer, List list, RenderEnv renderEnv) { + private void hytils$modifyArgs(Args args, IBlockAccess worldIn, IBlockState stateIn, BlockPos blockPosIn, WorldRenderer buffer, List list, RenderEnv renderEnv) { try { BlockModelRendererHook.handleHeightOverlay(args, stateIn, blockPosIn); } catch (Exception ignored) { @@ -50,7 +49,7 @@ private void modifyArgs(Args args, IBlockAccess worldIn, IBlockState stateIn, Bl @Dynamic("OptiFine implements its own version of renderModelAmbientOcclusionQuads") @ModifyArgs(method = "renderQuadsSmooth", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/WorldRenderer;putColorMultiplierRgba(FFFFI)V", remap = false), remap = false) - private void modifyArg4s(Args args, IBlockAccess worldIn, IBlockState stateIn, BlockPos blockPosIn, WorldRenderer buffer, List list, RenderEnv renderEnv) { + private void hytils$modifyArg4s(Args args, IBlockAccess worldIn, IBlockState stateIn, BlockPos blockPosIn, WorldRenderer buffer, List list, RenderEnv renderEnv) { try { BlockModelRendererHook.handleHeightOverlay(args, stateIn, blockPosIn); } catch (Exception ignored) { @@ -60,7 +59,7 @@ private void modifyArg4s(Args args, IBlockAccess worldIn, IBlockState stateIn, B @Dynamic("OptiFine implements its own version of renderModelStandardOcclusionQuads") @ModifyArgs(method = "renderQuadsFlat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/WorldRenderer;putColorMultiplier(FFFI)V", remap = true), remap = false) - private void modifyArg2s(Args args, IBlockAccess worldIn, IBlockState stateIn, BlockPos blockPosIn, EnumFacing face, int brightnessIn, boolean ownBrightness, WorldRenderer buffer, List list, RenderEnv renderEnv) { + private void hytils$modifyArg2s(Args args, IBlockAccess worldIn, IBlockState stateIn, BlockPos blockPosIn, EnumFacing face, int brightnessIn, boolean ownBrightness, WorldRenderer buffer, List list, RenderEnv renderEnv) { try { BlockModelRendererHook.handleHeightOverlay(args, stateIn, blockPosIn); } catch (Exception ignored) { diff --git a/src/main/java/org/polyfrost/hytils/mixin/overlay/VertexLighterFlatMixin.java b/src/main/java/org/polyfrost/hytils/mixin/overlay/VertexLighterFlatMixin.java index d274381..8bc5937 100644 --- a/src/main/java/org/polyfrost/hytils/mixin/overlay/VertexLighterFlatMixin.java +++ b/src/main/java/org/polyfrost/hytils/mixin/overlay/VertexLighterFlatMixin.java @@ -31,6 +31,7 @@ import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyArgs; import org.spongepowered.asm.mixin.injection.invoke.arg.Args; @@ -42,21 +43,22 @@ public class VertexLighterFlatMixin { protected BlockInfo blockInfo; @ModifyArgs(method = "processQuad", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/client/model/pipeline/VertexLighterFlat;updateColor([F[FFFFFI)V")) - private void modifyArgs(Args args) { + private void hytils$modifyArgs(Args args) { if (HypixelUtils.INSTANCE.isHypixel() && HytilsConfig.heightOverlay && blockInfo.getBlock() instanceof BlockColored) { int height = HeightHandler.INSTANCE.getHeight(); if (height == -1) return; if (blockInfo.getBlockPos().getY() != (height - 1)) return; MapColor mapColor = blockInfo.getBlock().getMapColor(blockInfo.getWorld().getBlockState(blockInfo.getBlockPos())); boolean isClay = blockInfo.getBlock().getMaterial() == Material.rock; - if (!isClay || check(mapColor.colorIndex)) { + if (!isClay || hytils$check(mapColor.colorIndex)) { args.set(5, 1.0F); args.set(6, (HytilsConfig.manuallyEditHeightOverlay ? BlockHighlightConfig.colorMap.get(mapColor).get().getRGB() : DarkColorUtils.getCachedDarkColor(mapColor.colorValue))); } } } - private boolean check(int color) { + @Unique + private boolean hytils$check(int color) { switch (color) { case 18: case 25: