diff --git a/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java b/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java index 8fb422b8..513e1036 100644 --- a/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java +++ b/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java @@ -613,6 +613,10 @@ public class FixesConfig { @Config.DefaultBoolean(true) public static boolean fixWitcheryThunderDetection; + @Config.Comment("Fixes some potential errors in Witchery Rendering") + @Config.DefaultBoolean(true) + public static boolean fixWitcheryRendering; + // Xaero's Minimap @Config.Comment("Fixes the player entity dot rendering when arrow is chosen") @Config.DefaultBoolean(true) diff --git a/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java b/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java index 6cb56467..b6bd0046 100644 --- a/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java +++ b/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java @@ -840,6 +840,10 @@ public enum Mixins { .setSide(Side.BOTH).setPhase(Phase.LATE).setApplyIf(() -> FixesConfig.fixWitcheryThunderDetection) .addTargetedMod(TargetedMod.WITCHERY)), + FIX_WITCHERY_RENDERING(new Builder("Fixes Witchery Rendering errors") + .addMixinClasses("witchery.MixinBlockCircleGlyph").setSide(Side.CLIENT).setPhase(Phase.LATE) + .setApplyIf(() -> FixesConfig.fixWitcheryRendering).addTargetedMod(TargetedMod.WITCHERY)), + // Various Exploits/Fixes GC_TIME_COMMAND_FIX(new Builder("GC Time Fix").addMixinClasses("minecraft.MixinTimeCommandGalacticraftFix") .setPhase(Phase.EARLY).setSide(Side.BOTH).setApplyIf(() -> FixesConfig.fixTimeCommandWithGC) diff --git a/src/main/java/com/mitchej123/hodgepodge/mixins/late/witchery/MixinBlockCircleGlyph.java b/src/main/java/com/mitchej123/hodgepodge/mixins/late/witchery/MixinBlockCircleGlyph.java new file mode 100644 index 00000000..51a74b4d --- /dev/null +++ b/src/main/java/com/mitchej123/hodgepodge/mixins/late/witchery/MixinBlockCircleGlyph.java @@ -0,0 +1,23 @@ +package com.mitchej123.hodgepodge.mixins.late.witchery; + +import net.minecraft.util.IIcon; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +import com.emoniph.witchery.blocks.BlockCircleGlyph; + +@Mixin(BlockCircleGlyph.class) +public class MixinBlockCircleGlyph { + + @Shadow(remap = false) + private IIcon[] icons; + + @ModifyConstant(method = "getIcon(II)Lnet/minecraft/util/IIcon;", constant = @Constant(intValue = 12)) + private int hodgepodge$fixMetadataClamp(int oldValue) { + return icons.length - 1; + } + +}