Reset move controllers for water mobs

This commit is contained in:
fullwall 2018-07-22 16:34:14 +08:00
parent 9e38701367
commit 7760164880
5 changed files with 27 additions and 0 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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);
}
}