summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java17
-rw-r--r--src/main/java/com/keuin/ohmyvanillamc/mixin/DisableFishSchooling.java21
2 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java b/src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java
new file mode 100644
index 0000000..c1dc4af
--- /dev/null
+++ b/src/main/java/com/keuin/ohmyvanillamc/OhMyVanillaMinecraft.java
@@ -0,0 +1,17 @@
+package com.keuin.ohmyvanillamc;
+
+import net.fabricmc.api.ModInitializer;
+
+public class OhMyVanillaMinecraft implements ModInitializer {
+
+ public static boolean disableFishSchooling = true;
+
+ @Override
+ public void onInitialize() {
+ // This code runs as soon as Minecraft is in a mod-load-ready state.
+ // However, some things (like resources) may still be uninitialized.
+ // Proceed with mild caution.
+
+ System.out.println("OhMyVanillaMinecraft is loading...");
+ }
+}
diff --git a/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableFishSchooling.java b/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableFishSchooling.java
new file mode 100644
index 0000000..28342c9
--- /dev/null
+++ b/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableFishSchooling.java
@@ -0,0 +1,21 @@
+package com.keuin.ohmyvanillamc.mixin;
+
+import com.keuin.ohmyvanillamc.OhMyVanillaMinecraft;
+import net.minecraft.entity.passive.SchoolingFishEntity;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
+
+@Mixin(SchoolingFishEntity.class)
+public class DisableFishSchooling {
+ /**
+ * @reason To disable SchoolingFish schooling.
+ * @author trueKeuin
+ */
+ @Inject(method = "moveTowardLeader()V", at = @At("HEAD"))
+ protected void moveTowardLeader(CallbackInfo ci) {
+ if (OhMyVanillaMinecraft.disableFishSchooling)
+ ci.cancel();
+ }
+}