mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Prevent entities from moving during death animation
This commit is contained in:
parent
522b4edc7a
commit
fa0c5050e4
@ -78,7 +78,7 @@ public abstract class EntityCreature extends LivingEntity implements NavigableEn
|
||||
aiTick(time);
|
||||
|
||||
// Path finding
|
||||
this.navigator.pathFindingTick(getAttributeValue(Attributes.MOVEMENT_SPEED));
|
||||
this.navigator.tick(getAttributeValue(Attributes.MOVEMENT_SPEED));
|
||||
|
||||
// Fire, item pickup, ...
|
||||
super.update(time);
|
||||
|
@ -4,6 +4,7 @@ import com.extollit.gaming.ai.path.HydrazinePathFinder;
|
||||
import com.extollit.gaming.ai.path.model.IPath;
|
||||
import net.minestom.server.collision.CollisionUtils;
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.LivingEntity;
|
||||
import net.minestom.server.instance.Chunk;
|
||||
import net.minestom.server.instance.Instance;
|
||||
import net.minestom.server.instance.WorldBorder;
|
||||
@ -159,7 +160,11 @@ public class Navigator {
|
||||
return setPathTo(position, true);
|
||||
}
|
||||
|
||||
public synchronized void pathFindingTick(float speed) {
|
||||
public synchronized void tick(float speed) {
|
||||
// No pathfinding tick for dead entities
|
||||
if (entity instanceof LivingEntity && ((LivingEntity) entity).isDead())
|
||||
return;
|
||||
|
||||
if (pathPosition != null) {
|
||||
|
||||
IPath path = pathFinder.updatePathFor(pathingEntity);
|
||||
|
Loading…
Reference in New Issue
Block a user