Override teleport method in Shulker rather than blocking tick

This commit is contained in:
fullwall 2024-03-03 18:07:25 +08:00
parent 40c6b4b85e
commit a24064ddae
11 changed files with 68 additions and 42 deletions

View File

@ -155,10 +155,9 @@ public class ShulkerController extends MobEntityController {
@Override
public void m() {
super.m();
if (npc != null) {
npc.update();
} else {
super.m();
}
}
@ -177,6 +176,11 @@ public class ShulkerController extends MobEntityController {
}
}
@Override
protected boolean o() {
return npc == null || npc.useMinecraftAI() ? super.o() : false;
}
@Override
protected EntityAIBodyControl s() {
return npc == null ? super.s() : new EntityAIBodyControl(this);

View File

@ -66,10 +66,9 @@ public class ShulkerController extends MobEntityController {
@Override
public void A_() {
super.A_();
if (npc != null) {
npc.update();
} else {
super.A_();
}
}
@ -177,6 +176,11 @@ public class ShulkerController extends MobEntityController {
}
}
@Override
protected boolean o() {
return npc == null || npc.useMinecraftAI() ? super.o() : false;
}
@Override
protected EntityAIBodyControl s() {
return npc == null ? super.s() : new EntityAIBodyControl(this);

View File

@ -77,10 +77,9 @@ public class ShulkerController extends MobEntityController {
@Override
public void B_() {
super.B_();
if (npc != null) {
npc.update();
} else {
super.B_();
}
}
@ -184,6 +183,11 @@ public class ShulkerController extends MobEntityController {
}
}
@Override
protected boolean p() {
return npc == null || npc.useMinecraftAI() ? super.p() : false;
}
@Override
protected EntityAIBodyControl s() {
return npc == null ? super.s() : new EntityAIBodyControl(this);

View File

@ -182,6 +182,11 @@ public class ShulkerController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
protected boolean l() {
return npc == null || npc.useMinecraftAI() ? super.l() : false;
}
@Override
public void movementTick() {
if (npc == null) {
@ -220,18 +225,17 @@ public class ShulkerController extends MobEntityController {
@Override
public void tick() {
super.tick();
if (npc != null) {
npc.update();
} else {
super.tick();
}
}
@Override
public boolean z_() {
if (npc == null || !npc.isFlyable())
if (npc == null || !npc.isFlyable()) {
return super.z_();
else
} else
return false;
}

View File

@ -186,6 +186,11 @@ public class ShulkerController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
protected boolean l() {
return npc == null || npc.useMinecraftAI() ? super.l() : false;
}
@Override
public void movementTick() {
if (npc == null) {
@ -207,10 +212,9 @@ public class ShulkerController extends MobEntityController {
@Override
public void tick() {
super.tick();
if (npc != null) {
npc.update();
} else {
super.tick();
}
}

View File

@ -187,6 +187,11 @@ public class ShulkerController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
protected boolean l() {
return npc == null || npc.useMinecraftAI() ? super.l() : false;
}
@Override
public void movementTick() {
if (npc == null || npc.useMinecraftAI()) {
@ -208,14 +213,10 @@ public class ShulkerController extends MobEntityController {
@Override
public void tick() {
super.tick();
if (npc != null) {
NMSImpl.updateMinecraftAIState(npc, this);
if (npc.useMinecraftAI()) {
super.tick();
}
npc.update();
} else {
super.tick();
}
}

View File

@ -124,6 +124,11 @@ public class ShulkerController extends MobEntityController {
return NMS.getJumpPower(npc, super.dJ());
}
@Override
protected boolean eK() {
return npc == null || npc.useMinecraftAI() ? super.eK() : false;
}
@Override
public void g(Vec3D vec3d) {
if (npc == null || !npc.isFlyable()) {
@ -208,14 +213,10 @@ public class ShulkerController extends MobEntityController {
@Override
public void tick() {
super.tick();
if (npc != null) {
NMSImpl.updateMinecraftAIState(npc, this);
if (npc.useMinecraftAI()) {
super.tick();
}
npc.update();
} else {
super.tick();
}
}

View File

@ -199,16 +199,17 @@ public class ShulkerController extends MobEntityController {
return npc == null ? super.save(save) : false;
}
@Override
protected boolean teleportSomewhere() {
return npc == null || npc.useMinecraftAI() ? super.teleportSomewhere() : false;
}
@Override
public void tick() {
super.tick();
if (npc != null) {
NMSImpl.updateMinecraftAIState(npc, this);
if (npc.useMinecraftAI()) {
super.tick();
}
npc.update();
} else {
super.tick();
}
}

View File

@ -200,6 +200,11 @@ public class ShulkerController extends MobEntityController {
return npc == null ? super.save(save) : false;
}
@Override
protected boolean teleportSomewhere() {
return npc == null || npc.useMinecraftAI() ? super.teleportSomewhere() : false;
}
@Override
public Entity teleportTo(ServerLevel worldserver, BlockPos location) {
if (npc == null)
@ -209,14 +214,10 @@ public class ShulkerController extends MobEntityController {
@Override
public void tick() {
super.tick();
if (npc != null) {
NMSImpl.updateMinecraftAIState(npc, this);
if (npc.useMinecraftAI()) {
super.tick();
}
npc.update();
} else {
super.tick();
}
}

View File

@ -201,6 +201,11 @@ public class ShulkerController extends MobEntityController {
return npc == null ? super.save(save) : false;
}
@Override
protected boolean teleportSomewhere() {
return npc == null || npc.useMinecraftAI() ? super.teleportSomewhere() : false;
}
@Override
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
if (npc == null)
@ -210,14 +215,10 @@ public class ShulkerController extends MobEntityController {
@Override
public void tick() {
super.tick();
if (npc != null) {
NMSImpl.updateMinecraftAIState(npc, this);
if (npc.useMinecraftAI()) {
super.tick();
}
npc.update();
} else {
super.tick();
}
}

View File

@ -200,6 +200,11 @@ public class ShulkerController extends MobEntityController {
return npc == null ? super.save(save) : false;
}
@Override
protected boolean teleportSomewhere() {
return npc == null || npc.useMinecraftAI() ? super.teleportSomewhere() : false;
}
@Override
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
if (npc == null)
@ -209,14 +214,10 @@ public class ShulkerController extends MobEntityController {
@Override
public void tick() {
super.tick();
if (npc != null) {
NMSImpl.updateMinecraftAIState(npc, this);
if (npc.useMinecraftAI()) {
super.tick();
}
npc.update();
} else {
super.tick();
}
}