mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-26 11:07:59 +01:00
Fix NPE in navigation
This commit is contained in:
parent
e93000acdb
commit
44b121fe79
@ -66,7 +66,7 @@ public class PlayerNavigation extends NavigationAbstract {
|
||||
localBlockPosition = localBlockPosition.down();
|
||||
}
|
||||
if (localBlockPosition.getY() > 0) {
|
||||
return super.a(localBlockPosition.up());
|
||||
return supera(localBlockPosition.up());
|
||||
}
|
||||
while ((localBlockPosition.getY() < this.b.getHeight())
|
||||
&& (this.b.getType(localBlockPosition).getMaterial() == Material.AIR)) {
|
||||
@ -498,6 +498,25 @@ public class PlayerNavigation extends NavigationAbstract {
|
||||
this.g.setValue(pathfindingRange);
|
||||
}
|
||||
|
||||
public PathEntity supera(BlockPosition paramBlockPosition) {
|
||||
if (!b()) {
|
||||
return null;
|
||||
}
|
||||
if ((this.c != null) && (!this.c.b()) && (paramBlockPosition.equals(this.r))) {
|
||||
return this.c;
|
||||
}
|
||||
this.r = paramBlockPosition;
|
||||
|
||||
float f1 = h();
|
||||
BlockPosition localBlockPosition = new BlockPosition(this.a);
|
||||
int i1 = (int) (f1 + 8.0F);
|
||||
|
||||
ChunkCache localChunkCache = new ChunkCache(this.b, localBlockPosition.a(-i1, -i1, -i1),
|
||||
localBlockPosition.a(i1, i1, i1), 0);
|
||||
PathEntity localPathEntity = this.s.a(localChunkCache, this.a, this.r, f1);
|
||||
return localPathEntity;
|
||||
}
|
||||
|
||||
private static EntityInsentient getDummyInsentient(EntityHumanNPC from, World world) {
|
||||
return new EntityInsentient(world) {
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user