From 77601648809747cd400a6f29146c13c1c05076e1 Mon Sep 17 00:00:00 2001 From: fullwall Date: Sun, 22 Jul 2018 16:34:14 +0800 Subject: [PATCH] Reset move controllers for water mobs --- .../nms/v1_13_R1/entity/CodController.java | 5 +++++ .../nms/v1_13_R1/entity/PufferFishController.java | 10 ++++++++++ .../nms/v1_13_R1/entity/SalmonController.java | 5 +++++ .../nms/v1_13_R1/entity/TropicalFishController.java | 5 +++++ .../nms/v1_13_R1/entity/TurtleController.java | 2 ++ 5 files changed, 27 insertions(+) diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CodController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CodController.java index 4796be51b..69eec263e 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CodController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CodController.java @@ -15,6 +15,7 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; import net.minecraft.server.v1_13_R1.BlockPosition; +import net.minecraft.server.v1_13_R1.ControllerMove; import net.minecraft.server.v1_13_R1.DamageSource; import net.minecraft.server.v1_13_R1.EntityCod; import net.minecraft.server.v1_13_R1.IBlockData; @@ -58,6 +59,7 @@ public class CodController extends MobEntityController { this.npc = (CitizensNPC) npc; if (npc != null) { NMSImpl.clearGoals(goalSelector, targetSelector); + this.moveController = new ControllerMove(this); } } @@ -182,6 +184,9 @@ public class CodController extends MobEntityController { @Override public void mobTick() { + if (npc != null) { + t(false); + } super.mobTick(); if (npc != null) { npc.update(); diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PufferFishController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PufferFishController.java index 1fe94a93c..a12d582a5 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PufferFishController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PufferFishController.java @@ -15,6 +15,7 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; import net.minecraft.server.v1_13_R1.BlockPosition; +import net.minecraft.server.v1_13_R1.ControllerMove; import net.minecraft.server.v1_13_R1.DamageSource; import net.minecraft.server.v1_13_R1.EntityPufferFish; import net.minecraft.server.v1_13_R1.IBlockData; @@ -44,6 +45,7 @@ public class PufferFishController extends MobEntityController { this.npc = (CitizensNPC) npc; if (npc != null) { NMSImpl.clearGoals(goalSelector, targetSelector); + this.moveController = new ControllerMove(this); } } @@ -166,8 +168,16 @@ public class PufferFishController extends MobEntityController { return false; // shouldLeash } + @Override + public void k() { + super.k(); + } + @Override public void mobTick() { + if (npc != null) { + t(false); + } super.mobTick(); if (npc != null) { npc.update(); diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SalmonController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SalmonController.java index 21b4afd55..07e069563 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SalmonController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SalmonController.java @@ -15,6 +15,7 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; import net.minecraft.server.v1_13_R1.BlockPosition; +import net.minecraft.server.v1_13_R1.ControllerMove; import net.minecraft.server.v1_13_R1.DamageSource; import net.minecraft.server.v1_13_R1.EntitySalmon; import net.minecraft.server.v1_13_R1.IBlockData; @@ -44,6 +45,7 @@ public class SalmonController extends MobEntityController { this.npc = (CitizensNPC) npc; if (npc != null) { NMSImpl.clearGoals(goalSelector, targetSelector); + this.moveController = new ControllerMove(this); } } @@ -168,6 +170,9 @@ public class SalmonController extends MobEntityController { @Override public void mobTick() { + if (npc != null) { + t(false); + } super.mobTick(); if (npc != null) { npc.update(); diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TropicalFishController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TropicalFishController.java index af929684d..b26833456 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TropicalFishController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TropicalFishController.java @@ -15,6 +15,7 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; import net.minecraft.server.v1_13_R1.BlockPosition; +import net.minecraft.server.v1_13_R1.ControllerMove; import net.minecraft.server.v1_13_R1.DamageSource; import net.minecraft.server.v1_13_R1.EntityTropicalFish; import net.minecraft.server.v1_13_R1.IBlockData; @@ -44,6 +45,7 @@ public class TropicalFishController extends MobEntityController { this.npc = (CitizensNPC) npc; if (npc != null) { NMSImpl.clearGoals(goalSelector, targetSelector); + this.moveController = new ControllerMove(this); } } @@ -168,6 +170,9 @@ public class TropicalFishController extends MobEntityController { @Override public void mobTick() { + if (npc != null) { + t(false); + } super.mobTick(); if (npc != null) { npc.update(); diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TurtleController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TurtleController.java index ceb42159d..2ba529ece 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TurtleController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TurtleController.java @@ -15,6 +15,7 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; import net.minecraft.server.v1_13_R1.BlockPosition; +import net.minecraft.server.v1_13_R1.ControllerMove; import net.minecraft.server.v1_13_R1.DamageSource; import net.minecraft.server.v1_13_R1.EntityTurtle; import net.minecraft.server.v1_13_R1.IBlockData; @@ -44,6 +45,7 @@ public class TurtleController extends MobEntityController { this.npc = (CitizensNPC) npc; if (npc != null) { NMSImpl.clearGoals(goalSelector, targetSelector); + this.moveController = new ControllerMove(this); } }