mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 06:07:27 +00:00
EntityNPCInterface:
-Fixed flying NPCs not returning to mid-air start y positions.
This commit is contained in:
1 parent
c3a0298902
commit
7425e935f1
1 file changed
+13
-9
@@ -1335,15 +1335,19 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
|
||||
int j = getStartPos()[1];
|
||||
int k = getStartPos()[2];
|
||||
double yy = 0;
|
||||
for (int ii = j; ii >= 0; ii--) {
|
||||
Block block = worldObj.getBlock(i, ii, k);
|
||||
if (block == null)
|
||||
continue;
|
||||
AxisAlignedBB bb = block.getCollisionBoundingBoxFromPool(worldObj, i, ii, k);
|
||||
if (bb == null)
|
||||
continue;
|
||||
yy = bb.maxY;
|
||||
break;
|
||||
if (!this.canFly()) {
|
||||
for (int ii = j; ii >= 0; ii--) {
|
||||
Block block = worldObj.getBlock(i, ii, k);
|
||||
if (block == null)
|
||||
continue;
|
||||
AxisAlignedBB bb = block.getCollisionBoundingBoxFromPool(worldObj, i, ii, k);
|
||||
if (bb == null)
|
||||
continue;
|
||||
yy = bb.maxY;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
yy = j;
|
||||
}
|
||||
if (yy <= 0)
|
||||
setDead();
|
||||
|
||||
Reference in new issue
Block a user