diff options
author | Merrg1n <[email protected]> | 2022-08-14 01:15:10 +0800 |
---|---|---|
committer | Merrg1n <[email protected]> | 2022-08-14 01:42:38 +0800 |
commit | 78e3592bc1265a1e68336c503aa68971a956a6a6 (patch) | |
tree | 49222ef1e104dafca54d75f3b1f16f7b7d3b8213 /src/main/java/com/keuin/ohmyvanillamc/mixins/fix | |
parent | 94f092015a05d0179e307468c717ad391e455742 (diff) |
rewrite mixin
Diffstat (limited to 'src/main/java/com/keuin/ohmyvanillamc/mixins/fix')
-rw-r--r-- | src/main/java/com/keuin/ohmyvanillamc/mixins/fix/disableEntityTrackerEntrySpamming/EntityTrackerEntryMixin.java | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/src/main/java/com/keuin/ohmyvanillamc/mixins/fix/disableEntityTrackerEntrySpamming/EntityTrackerEntryMixin.java b/src/main/java/com/keuin/ohmyvanillamc/mixins/fix/disableEntityTrackerEntrySpamming/EntityTrackerEntryMixin.java index 5b885a0..95fa8d3 100644 --- a/src/main/java/com/keuin/ohmyvanillamc/mixins/fix/disableEntityTrackerEntrySpamming/EntityTrackerEntryMixin.java +++ b/src/main/java/com/keuin/ohmyvanillamc/mixins/fix/disableEntityTrackerEntrySpamming/EntityTrackerEntryMixin.java @@ -1,32 +1,22 @@ package com.keuin.ohmyvanillamc.mixins.fix.disableEntityTrackerEntrySpamming; -import com.keuin.ohmyvanillamc.DummyLogger; import net.minecraft.server.network.EntityTrackerEntry; import org.apache.logging.log4j.Logger; -import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.gen.Accessor; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(EntityTrackerEntry.class) public class EntityTrackerEntryMixin { - - static { - setLOGGER(new DummyLogger()); - } - - @Shadow - @Final - private static Logger LOGGER; - - @Accessor("LOGGER") - private static Logger getLOGGER() { - throw new AssertionError(); + @Redirect( + method = "sendPackets", + at = @At( + value = "INVOKE", + target = "Lorg/apache/logging/log4j/Logger;warn(Ljava/lang/String;)V", + remap = false + ) + ) + private void disableWarn(Logger logger, String text) { + // do nothing } - - @Accessor("LOGGER") - private static void setLOGGER(Logger logger) { - throw new AssertionError(); - } - } |