summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/ohmyvanillamc/mixins/fix/disableEntityTrackerEntrySpamming/EntityTrackerEntryMixin.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/keuin/ohmyvanillamc/mixins/fix/disableEntityTrackerEntrySpamming/EntityTrackerEntryMixin.java')
-rw-r--r--src/main/java/com/keuin/ohmyvanillamc/mixins/fix/disableEntityTrackerEntrySpamming/EntityTrackerEntryMixin.java34
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();
- }
-
}