diff options
author | Keuin <[email protected]> | 2021-01-15 00:42:54 +0800 |
---|---|---|
committer | keuin <[email protected]> | 2021-01-15 00:42:54 +0800 |
commit | 75f26f4ed9011e9dd12f5b49b26b94f8f4dacac1 (patch) | |
tree | 7520c0c10220ec06624bd87c6115d564146a40a5 /src/main/java/com/keuin/ohmyvanillamc/mixin/DisableFishSchooling.java | |
parent | 6f84d79bc8452a2e37644e6f0419477b70a09e69 (diff) |
Version 1.4.0: supports reintroducing llama item duplication. Add configuration file.
Diffstat (limited to 'src/main/java/com/keuin/ohmyvanillamc/mixin/DisableFishSchooling.java')
-rw-r--r-- | src/main/java/com/keuin/ohmyvanillamc/mixin/DisableFishSchooling.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableFishSchooling.java b/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableFishSchooling.java index c30ab02..c2de0d5 100644 --- a/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableFishSchooling.java +++ b/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableFishSchooling.java @@ -2,6 +2,7 @@ package com.keuin.ohmyvanillamc.mixin; import com.keuin.ohmyvanillamc.OhMyVanillaMinecraft; import net.minecraft.entity.EntityType; +import net.minecraft.entity.ai.goal.FollowGroupLeaderGoal; import net.minecraft.entity.passive.FishEntity; import net.minecraft.entity.passive.SchoolingFishEntity; import net.minecraft.world.World; @@ -25,7 +26,7 @@ public abstract class DisableFishSchooling extends FishEntity { */ @Overwrite public void moveTowardLeader() { - if (!OhMyVanillaMinecraft.disableFishSchooling) { + if (!OhMyVanillaMinecraft.getConfiguration().isDisableFishSchooling()) { if (this.hasLeader()) { this.getNavigation().startMovingTo(this.leader, 1.0D); } @@ -39,5 +40,8 @@ public abstract class DisableFishSchooling extends FishEntity { @Overwrite public void initGoals() { super.initGoals(); + if (!OhMyVanillaMinecraft.getConfiguration().isDisableFishSchooling()) { + this.goalSelector.add(5, new FollowGroupLeaderGoal((SchoolingFishEntity) (Object) this)); + } } } |