mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-11 18:27:37 +00:00
Fixed flying not working in small enclosed spaces.
This commit is contained in:
1 parent
6459e7fe2a
commit
73db2da124
1 file changed
-17
@@ -297,23 +297,6 @@ public class PathNavigateFlying extends PathNavigate {
|
||||
*/
|
||||
private int getPathableYPos()
|
||||
{
|
||||
int i = (int)this.theEntity.boundingBox.minY;
|
||||
Block block = this.worldObj.getBlock(MathHelper.floor_double(this.theEntity.posX), i, MathHelper.floor_double(this.theEntity.posZ));
|
||||
int j = 0;
|
||||
|
||||
do
|
||||
{
|
||||
if (block != Blocks.air)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
++i;
|
||||
block = this.worldObj.getBlock(MathHelper.floor_double(this.theEntity.posX), i, MathHelper.floor_double(this.theEntity.posZ));
|
||||
++j;
|
||||
}
|
||||
while (j <= 16);
|
||||
|
||||
return (int)(this.theEntity.boundingBox.minY + 0.5D);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user