summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java')
-rw-r--r--src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java b/src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java
index c1dc4af..a3d5c90 100644
--- a/src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java
+++ b/src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java
@@ -1,10 +1,33 @@
package com.keuin.ohmyvanillamc;
import net.fabricmc.api.ModInitializer;
+import net.minecraft.server.network.EntityTrackerEntry;
+
+import java.lang.reflect.Field;
public class OhMyVanillaMinecraft implements ModInitializer {
public static boolean disableFishSchooling = true;
+ public static boolean disablePhantomSpawning = false;
+ public static boolean disableWanderingTraderSpawning = false;
+
+ private static void disableEntityTrackerEntrySpamming() {
+ try {
+ //获取该类的字节码对象
+ Class<EntityTrackerEntry> clazz = EntityTrackerEntry.class;
+
+ //获取其私有成员
+ Field name = clazz.getDeclaredField("LOGGER");
+
+ //暴力反射
+ name.setAccessible(true);
+
+ //重新赋值 参数一:实力 参数二:值
+// name.set(EntityTrackerEntry, "小鸭鸭");
+ } catch (NoSuchFieldException ignored) {
+ // never mind
+ }
+ }
@Override
public void onInitialize() {
@@ -13,5 +36,6 @@ public class OhMyVanillaMinecraft implements ModInitializer {
// Proceed with mild caution.
System.out.println("OhMyVanillaMinecraft is loading...");
+
}
}