Check for enderdragon death

This commit is contained in:
fullwall 2023-03-29 02:23:44 +08:00
parent f29780874d
commit 9b7a6e0a65
10 changed files with 15 additions and 11 deletions

View File

@ -156,7 +156,8 @@ public class EnderDragonController extends MobEntityController {
public void n() {
if (npc != null) {
npc.update();
}
if (npc != null && getHealth() > 0) {
if (this.c < 0) {
for (int i = 0; i < this.b.length; ++i) {
this.b[i][0] = this.yaw;

View File

@ -157,7 +157,8 @@ public class EnderDragonController extends MobEntityController {
public void n() {
if (npc != null) {
npc.update();
}
if (npc != null && getHealth() > 0) {
if (this.c < 0) {
for (int i = 0; i < this.b.length; ++i) {
this.b[i][0] = this.yaw;

View File

@ -157,7 +157,8 @@ public class EnderDragonController extends MobEntityController {
public void n() {
if (npc != null) {
npc.update();
}
if (npc != null && getHealth() > 0) {
if (this.c < 0) {
for (int i = 0; i < this.b.length; ++i) {
this.b[i][0] = this.yaw;

View File

@ -168,7 +168,8 @@ public class EnderDragonController extends MobEntityController {
public void movementTick() {
if (npc != null) {
npc.update();
}
if (npc != null && getHealth() > 0) {
if (this.c < 0) {
for (int i = 0; i < this.b.length; ++i) {
this.b[i][0] = this.yaw;

View File

@ -165,7 +165,8 @@ public class EnderDragonController extends MobEntityController {
public void movementTick() {
if (npc != null) {
npc.update();
}
if (npc != null && getHealth() > 0) {
if (this.d < 0) {
for (int i = 0; i < this.c.length; ++i) {
this.c[i][0] = this.yaw;

View File

@ -160,7 +160,7 @@ public class EnderDragonController extends MobEntityController {
npc.update();
NMSImpl.updateMinecraftAIState(npc, this);
}
if (npc != null && !npc.useMinecraftAI()) {
if (npc != null && !npc.useMinecraftAI() && getHealth() > 0) {
if (this.d < 0) {
for (int i = 0; i < this.c.length; ++i) {
this.c[i][0] = this.yaw;

View File

@ -160,7 +160,7 @@ public class EnderDragonController extends MobEntityController {
npc.update();
NMSImpl.updateMinecraftAIState(npc, this);
}
if (npc != null && !npc.useMinecraftAI()) {
if (npc != null && !npc.useMinecraftAI() && !dl()) {
if (this.d < 0) {
for (int i = 0; i < this.c.length; ++i) {
this.c[i][0] = this.yaw;

View File

@ -63,7 +63,7 @@ public class EnderDragonController extends MobEntityController {
npc.update();
NMSImpl.updateMinecraftAIState(npc, this);
}
if (npc != null && !npc.useMinecraftAI()) {
if (npc != null && !npc.useMinecraftAI() && !isDeadOrDying()) {
if (this.posPointer < 0) {
for (int i = 0; i < this.positions.length; ++i) {
this.positions[i][0] = this.getYRot();

View File

@ -65,7 +65,7 @@ public class EnderDragonController extends MobEntityController {
npc.update();
NMSImpl.updateMinecraftAIState(npc, this);
}
if (npc != null && !npc.useMinecraftAI()) {
if (npc != null && !npc.useMinecraftAI() && !isDeadOrDying()) {
if (this.posPointer < 0) {
for (int i = 0; i < this.positions.length; ++i) {
this.positions[i][0] = this.getYRot();

View File

@ -66,7 +66,7 @@ public class EnderDragonController extends MobEntityController {
npc.update();
}
if (npc != null && !npc.useMinecraftAI()) {
if (npc != null && !npc.useMinecraftAI() && !isDeadOrDying()) {
if (this.posPointer < 0) {
for (int i = 0; i < this.positions.length; ++i) {
this.positions[i][0] = this.getYRot();
@ -105,7 +105,6 @@ public class EnderDragonController extends MobEntityController {
setPos(getX() + mot.x, getY() + mot.y, getZ() + mot.z);
setDeltaMovement(mot);
}
} else {
super.aiStep();
}