Fix inappropriate double AI updating for parrots/warden

This commit is contained in:
fullwall 2023-03-26 13:51:26 +08:00
parent bafc6df000
commit 4f0cf51cbd
6 changed files with 5 additions and 25 deletions

View File

@ -104,8 +104,6 @@ public class ParrotController extends MobEntityController {
return npc == null ? super.d(save) : false;
}
@Override
public CraftEntity getBukkitEntity() {
if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) {
@ -153,9 +151,7 @@ public class ParrotController extends MobEntityController {
super.mobTick();
} else {
NMSImpl.updateMinecraftAIState(npc, this);
if (!npc.useMinecraftAI()) {
NMSImpl.updateAI(this);
} else {
if (npc.useMinecraftAI()) {
super.mobTick();
}
npc.update();

View File

@ -105,8 +105,6 @@ public class ParrotController extends MobEntityController {
return npc == null ? super.d(save) : false;
}
@Override
public CraftEntity getBukkitEntity() {
if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) {
@ -154,9 +152,7 @@ public class ParrotController extends MobEntityController {
super.mobTick();
} else {
NMSImpl.updateMinecraftAIState(npc, this);
if (!npc.useMinecraftAI()) {
NMSImpl.updateAI(this);
} else {
if (npc.useMinecraftAI()) {
super.mobTick();
}
npc.update();

View File

@ -73,17 +73,13 @@ public class ParrotController extends MobEntityController {
super.customServerAiStep();
} else {
NMSImpl.updateMinecraftAIState(npc, this);
if (!npc.useMinecraftAI()) {
NMSImpl.updateAI(this);
} else {
if (npc.useMinecraftAI()) {
super.customServerAiStep();
}
npc.update();
}
}
@Override
public SoundEvent getAmbientSound() {
return NMSImpl.getSoundEffect(npc, super.getAmbientSound(), NPC.Metadata.AMBIENT_SOUND);

View File

@ -75,17 +75,13 @@ public class ParrotController extends MobEntityController {
super.customServerAiStep();
} else {
NMSImpl.updateMinecraftAIState(npc, this);
if (!npc.useMinecraftAI()) {
NMSImpl.updateAI(this);
} else {
if (npc.useMinecraftAI()) {
super.customServerAiStep();
}
npc.update();
}
}
@Override
public SoundEvent getAmbientSound() {
return NMSImpl.getSoundEffect(npc, super.getAmbientSound(), NPC.Metadata.AMBIENT_SOUND);

View File

@ -75,9 +75,7 @@ public class ParrotController extends MobEntityController {
super.customServerAiStep();
} else {
NMSImpl.updateMinecraftAIState(npc, this);
if (!npc.useMinecraftAI()) {
NMSImpl.updateAI(this);
} else {
if (npc.useMinecraftAI()) {
super.customServerAiStep();
}
npc.update();

View File

@ -97,8 +97,6 @@ public class WardenController extends MobEntityController {
npc.update();
if (npc.useMinecraftAI()) {
super.customServerAiStep();
} else {
NMSImpl.updateAI(this);
}
}