Players should push entities by default rather than use /npc collidable which is performing double duty

This commit is contained in:
fullwall 2023-05-04 01:20:57 +08:00
parent 3e578db3ad
commit 0b076b1a21
11 changed files with 16 additions and 33 deletions

View File

@ -293,9 +293,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
moveOnCurrentHeading();
}
updateAI();
if (npc.data().get(NPC.Metadata.COLLIDABLE, !npc.isProtected())) {
cs();
}
cs();
if (npc.data().get(NPC.Metadata.PICKUP_ITEMS, false)) {
AxisAlignedBB axisalignedbb;
if (this.isPassenger() && !this.getVehicle().dead) {

View File

@ -351,9 +351,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
moveOnCurrentHeading();
}
updateAI();
if (npc.data().get(NPC.Metadata.COLLIDABLE, !npc.isProtected())) {
ct();
}
ct();
if (npc.data().get(NPC.Metadata.PICKUP_ITEMS, false)) {
AxisAlignedBB axisalignedbb;
if (this.isPassenger() && !this.getVehicle().dead) {

View File

@ -368,9 +368,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
moveOnCurrentHeading();
}
updateAI();
if (npc.data().get(NPC.Metadata.COLLIDABLE, !npc.isProtected())) {
cB();
}
cB();
if (npc.data().get(NPC.Metadata.PICKUP_ITEMS, false)) {
AxisAlignedBB axisalignedbb;
if (this.isPassenger() && !this.getVehicle().dead) {

View File

@ -347,9 +347,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
moveOnCurrentHeading();
}
updateAI();
if (npc.data().get(NPC.Metadata.COLLIDABLE, !npc.isProtected())) {
cN();
}
cN();
if (npc.data().get(NPC.Metadata.PICKUP_ITEMS, false)) {
AxisAlignedBB axisalignedbb;
if (this.isPassenger() && !this.getVehicle().dead) {

View File

@ -353,9 +353,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
moveOnCurrentHeading();
}
updateAI();
if (npc.data().get(NPC.Metadata.COLLIDABLE, !npc.isProtected())) {
collideNearby();
}
collideNearby();
if (npc.data().get(NPC.Metadata.PICKUP_ITEMS, false)) {
AxisAlignedBB axisalignedbb;
if (this.isPassenger() && !this.getVehicle().dead) {

View File

@ -352,9 +352,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
moveOnCurrentHeading();
}
updateAI();
if (npc.data().get(NPC.Metadata.COLLIDABLE, !npc.isProtected())) {
collideNearby();
}
collideNearby();
}
public void setMoveDestination(double x, double y, double z, double speed) {

View File

@ -320,9 +320,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
}
ai.getMoveControl().a();
ai.getJumpControl().b();
if (npc.data().get(NPC.Metadata.COLLIDABLE, !npc.isProtected())) {
collideNearby();
}
collideNearby();
}
@Override

View File

@ -153,9 +153,9 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
if (isSpectator()) {
this.onGround = false;
}
if (npc.data().get(NPC.Metadata.COLLIDABLE, !npc.isProtected())) {
pushEntities();
}
pushEntities();
if (npc.data().get(NPC.Metadata.PICKUP_ITEMS, false)) {
AABB axisalignedbb;
if (this.isPassenger() && !this.getVehicle().isRemoved()) {

View File

@ -154,9 +154,8 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
if (isSpectator()) {
this.onGround = false;
}
if (npc.data().get(NPC.Metadata.COLLIDABLE, !npc.isProtected())) {
pushEntities();
}
pushEntities();
if (npc.data().get(NPC.Metadata.PICKUP_ITEMS, false)) {
AABB axisalignedbb;
if (this.isPassenger() && !this.getVehicle().isRemoved()) {

View File

@ -143,9 +143,9 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
if (isSpectator()) {
this.onGround = false;
}
if (npc.data().get(NPC.Metadata.COLLIDABLE, !npc.isProtected())) {
pushEntities();
}
pushEntities();
if (npc.data().get(NPC.Metadata.PICKUP_ITEMS, false)) {
AABB axisalignedbb;
if (this.isPassenger() && !this.getVehicle().isRemoved()) {

View File

@ -294,9 +294,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
moveOnCurrentHeading();
}
updateAI();
if (npc.data().get(NPC.Metadata.COLLIDABLE, !npc.isProtected())) {
bL();
}
bL();
if (npc.data().get(NPC.Metadata.PICKUP_ITEMS, false)) {
AxisAlignedBB axisalignedbb = null;
if (this.vehicle != null && !this.vehicle.dead) {