mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-27 19:47:44 +01:00
Fix pathfinding NPE
This commit is contained in:
parent
bb3d57b1e5
commit
cabdb60370
@ -137,7 +137,9 @@ public abstract class EntityCreature extends LivingEntity {
|
||||
if (path != null) {
|
||||
final float speed = getAttributeValue(Attributes.MOVEMENT_SPEED);
|
||||
final Position targetPosition = pathingEntity.getTargetPosition();
|
||||
moveTowards(targetPosition, speed);
|
||||
if (targetPosition != null) {
|
||||
moveTowards(targetPosition, speed);
|
||||
}
|
||||
} else {
|
||||
if (pathPosition != null) {
|
||||
this.pathPosition = null;
|
||||
|
@ -188,12 +188,9 @@ public class PFPathingEntity implements IPathingEntity {
|
||||
final float z = (float) position.z;
|
||||
this.targetPosition = new Position(x, y, z);
|
||||
|
||||
// Jump for non-flying entities
|
||||
if (!avian) {
|
||||
final float entityY = entity.getPosition().getY();
|
||||
if (entityY < y) {
|
||||
entity.jump(1);
|
||||
}
|
||||
final float entityY = entity.getPosition().getY();
|
||||
if (entityY < y) {
|
||||
entity.jump(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user