diff --git a/src/main/java/club/sk1er/patcher/mixins/performance/MathHelperMixin_CompactLUT.java b/src/main/java/club/sk1er/patcher/mixins/performance/MathHelperMixin_CompactLUT.java index c7ca61bf..bd5949d1 100644 --- a/src/main/java/club/sk1er/patcher/mixins/performance/MathHelperMixin_CompactLUT.java +++ b/src/main/java/club/sk1er/patcher/mixins/performance/MathHelperMixin_CompactLUT.java @@ -2,11 +2,24 @@ import me.jellysquid.mods.lithium.common.util.math.CompactSineLUT; import net.minecraft.util.MathHelper; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.*; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(MathHelper.class) public class MathHelperMixin_CompactLUT { + @Mutable + @Shadow + @Final + private static float[] SIN_TABLE; + + @SuppressWarnings("InstantiationOfUtilityClass") + @Inject(method = "", at = @At("RETURN")) + private static void clearSinTable(CallbackInfo ci) { + new CompactSineLUT(); // Force class initialisation + MathHelperMixin_CompactLUT.SIN_TABLE = null; + } /** * @author Wyvest