Fix player death from other entities

This commit is contained in:
fullwall 2021-07-01 23:21:20 +08:00
parent 3fadac5840
commit 2d80f763eb
2 changed files with 5 additions and 2 deletions

View File

@ -141,9 +141,10 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
Bukkit.getScheduler().runTaskLater(CitizensAPI.getPlugin(), new Runnable() {
@Override
public void run() {
EntityHumanNPC.this.getLevel().removePlayerImmediately(EntityHumanNPC.this, RemovalReason.KILLED);
((ServerLevel) level).getChunkProvider().removeEntity(EntityHumanNPC.this);
}
}, 35); // give enough time for death and smoke animation
}, 15); // give enough time for death and smoke animation
}
@Override

View File

@ -30,16 +30,18 @@ public class PlayerPathfinder extends PathFinder {
private final int maxVisitedNodes;
private final Node[] neighbors = new Node[32];
private final PlayerNodeEvaluator nodeEvaluator;
private final BinaryHeap openSet = new BinaryHeap();
private final BinaryHeap openSet;
public PlayerPathfinder() {
super(null, 768);
this.nodeEvaluator = new PlayerNodeEvaluator();
this.openSet = new BinaryHeap();
this.maxVisitedNodes = 768;
}
public PlayerPathfinder(PlayerNodeEvaluator var0, int var1) {
super(var0, var1);
this.openSet = new BinaryHeap();
this.nodeEvaluator = var0;
this.maxVisitedNodes = var1;
}