From fd033b1204c30771a571897a3219866bb31394d3 Mon Sep 17 00:00:00 2001 From: Keuin Date: Fri, 15 Jan 2021 00:59:00 +0800 Subject: Version 1.4.1: add switch for fixing EntityTrackerEntry spamming. Improve option list. --- .../keuin/ohmyvanillamc/OhMyVanillaMinecraft.java | 27 +--------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java') diff --git a/src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java b/src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java index f76321a..fe9080e 100644 --- a/src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java +++ b/src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java @@ -4,10 +4,8 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonIOException; import net.fabricmc.api.ModInitializer; -import net.minecraft.server.network.EntityTrackerEntry; import java.io.*; -import java.lang.reflect.Field; import java.nio.charset.StandardCharsets; import java.util.logging.Logger; @@ -16,35 +14,12 @@ public class OhMyVanillaMinecraft implements ModInitializer { private static final Logger LOGGER = Logger.getLogger("OhMyVanillaMinecraft"); private static OmvmConfiguration configuration = null; - private static final OmvmConfiguration defaultConfiguration = new OmvmConfiguration( - false, - false, - false, - false - ); + private static final OmvmConfiguration defaultConfiguration = new OmvmConfiguration(); public static OmvmConfiguration getConfiguration() { return configuration != null ? configuration : defaultConfiguration; } - private static void disableEntityTrackerEntrySpamming() { - try { - //获取该类的字节码对象 - Class clazz = EntityTrackerEntry.class; - - //获取其私有成员 - Field name = clazz.getDeclaredField("LOGGER"); - - //暴力反射 - name.setAccessible(true); - - //重新赋值 参数一:实力 参数二:值 -// name.set(EntityTrackerEntry, "小鸭鸭"); - } catch (NoSuchFieldException ignored) { - // never mind - } - } - @Override public void onInitialize() { // This code runs as soon as Minecraft is in a mod-load-ready state. -- cgit v1.2.3