diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-12 22:31:28 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-12 22:31:28 +0200 |
commit | ed62b6ef35c6e174ba2907a788d42ddf6a4c9fe7 (patch) | |
tree | 1f04e45d8fce0ddac1224475616b61db39e7b92c /src/main/java/at/hannibal2/skyhanni/mixins/hooks | |
parent | 72eea5d065f9c2ef20ebe8ddf28c602c9f577078 (diff) | |
download | skyhanni-ed62b6ef35c6e174ba2907a788d42ddf6a4c9fe7.tar.gz skyhanni-ed62b6ef35c6e174ba2907a788d42ddf6a4c9fe7.tar.bz2 skyhanni-ed62b6ef35c6e174ba2907a788d42ddf6a4c9fe7.zip |
creating globalRenderToggle
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/mixins/hooks')
3 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt index 5b41f87c2..136ce8b11 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.events.DrawScreenAfterEvent import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.GuiContainerEvent.CloseWindowEvent import at.hannibal2.skyhanni.events.GuiContainerEvent.SlotClickEvent +import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests import net.minecraft.client.gui.inventory.GuiContainer import net.minecraft.inventory.Slot import org.spongepowered.asm.mixin.injection.callback.CallbackInfo @@ -21,6 +22,7 @@ class GuiContainerHook(guiAny: Any) { } fun backgroundDrawn(mouseX: Int, mouseY: Int, partialTicks: Float) { + if (!SkyHanniDebugsAndTests.globalRenderToggle) return GuiContainerEvent.BackgroundDrawnEvent(gui, gui.inventorySlots, mouseX, mouseY, partialTicks).postAndCatch() } diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderItemHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderItemHook.kt index ae9b02354..d65d36cdd 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderItemHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderItemHook.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.mixins.hooks import at.hannibal2.skyhanni.events.GuiRenderItemEvent import at.hannibal2.skyhanni.events.RenderRealOverlayEvent +import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests import net.minecraft.client.gui.FontRenderer import net.minecraft.item.ItemStack @@ -12,6 +13,7 @@ fun renderItemOverlayPost( yPosition: Int, text: String?, ) { + if (!SkyHanniDebugsAndTests.globalRenderToggle) return GuiRenderItemEvent.RenderOverlayEvent.GuiRenderItemPost( fr, stack, @@ -22,5 +24,6 @@ fun renderItemOverlayPost( } fun renderItemReturn(stack: ItemStack, x: Int, y: Int) { + if (!SkyHanniDebugsAndTests.globalRenderToggle) return RenderRealOverlayEvent(stack, x, y).postAndCatch() } diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderLivingEntityHelper.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderLivingEntityHelper.kt index 805b48af2..060de8d3e 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderLivingEntityHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderLivingEntityHelper.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.mixins.hooks import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.RenderMobColoredEvent import at.hannibal2.skyhanni.events.ResetEntityHurtEvent +import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests import net.minecraft.entity.EntityLivingBase import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -40,6 +41,7 @@ class RenderLivingEntityHelper { } fun <T : EntityLivingBase> setColorMultiplier(entity: T): Int { + if (!SkyHanniDebugsAndTests.globalRenderToggle) return 0 if (entityColorMap.containsKey(entity)) { val condition = entityColorCondition[entity]!! if (condition.invoke()) { @@ -48,12 +50,14 @@ class RenderLivingEntityHelper { } //TODO remove event + if (!SkyHanniDebugsAndTests.globalRenderToggle) return 0 val event = RenderMobColoredEvent(entity, 0) event.postAndCatch() return event.color } fun <T : EntityLivingBase> changeHurtTime(entity: T): Int { + if (!SkyHanniDebugsAndTests.globalRenderToggle) return 0 if (entityNoHurTime.contains(entity)) { val condition = entityNoHurTimeCondition[entity]!! if (condition.invoke()) { |