From a4edd87d61c2bc66494013ebef54518b8133b0d9 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sun, 24 Jan 2021 13:39:16 +0800 Subject: Add furnace lag fix. Use SemVer. BugFix: Entity Tracker spamming fix does not work in the previous versions. --- .../mixin/DisableEntityTrackerEntrySpamming.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/keuin/ohmyvanillamc/mixin/DisableEntityTrackerEntrySpamming.java') diff --git a/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableEntityTrackerEntrySpamming.java b/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableEntityTrackerEntrySpamming.java index bf1f0b1..faf5c9d 100644 --- a/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableEntityTrackerEntrySpamming.java +++ b/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableEntityTrackerEntrySpamming.java @@ -1,7 +1,6 @@ package com.keuin.ohmyvanillamc.mixin; import com.keuin.ohmyvanillamc.DummyLogger; -import com.keuin.ohmyvanillamc.OhMyVanillaMinecraft; import net.minecraft.server.network.EntityTrackerEntry; import org.apache.logging.log4j.Logger; import org.spongepowered.asm.mixin.Final; @@ -12,15 +11,24 @@ import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(EntityTrackerEntry.class) public class DisableEntityTrackerEntrySpamming { - private static final Logger DUMMY_LOGGER = new DummyLogger(); + private static final Logger LOGGER_DUMMY = new DummyLogger(); + + static { + setLOGGER(LOGGER_DUMMY); + } @Shadow @Final private static Logger LOGGER; @Accessor("LOGGER") - private static Logger LOGGER() { - return OhMyVanillaMinecraft.getConfiguration().isFixEntityTrackerEntrySpamming() ? DUMMY_LOGGER : LOGGER; + private static Logger getLOGGER() { + throw new AssertionError(); + } + + @Accessor("LOGGER") + private static void setLOGGER(Logger logger) { + throw new AssertionError(); } } -- cgit v1.2.3