mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Subtle behaviour change to make players remove themselves from tablist on death
This commit is contained in:
parent
102630a5e0
commit
c02391ccc3
@ -5,7 +5,6 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
|
||||
public abstract class AbstractEntityController implements EntityController {
|
||||
@ -31,8 +30,6 @@ public abstract class AbstractEntityController implements EntityController {
|
||||
return;
|
||||
if (bukkitEntity instanceof Player) {
|
||||
NMS.removeFromWorld(bukkitEntity);
|
||||
SkinnableEntity npc = bukkitEntity instanceof SkinnableEntity ? (SkinnableEntity) bukkitEntity : null;
|
||||
npc.getSkinTracker().onRemoveNPC();
|
||||
NMS.remove(bukkitEntity);
|
||||
setEntity(null);
|
||||
} else {
|
||||
|
@ -102,6 +102,11 @@ public class CitizensNPC extends AbstractNPC {
|
||||
trait.onDespawn();
|
||||
}
|
||||
Messaging.debug("Despawned", this, "DespawnReason." + reason);
|
||||
|
||||
if (getEntity() instanceof SkinnableEntity) {
|
||||
((SkinnableEntity) getEntity()).getSkinTracker().onRemoveNPC();
|
||||
}
|
||||
|
||||
if (reason == DespawnReason.DEATH) {
|
||||
entityController.setEntity(null);
|
||||
} else {
|
||||
|
@ -299,7 +299,7 @@ citizens.commands.trait.removed=Removed {0} successfully.
|
||||
citizens.commands.traitc.missing=Trait not found.
|
||||
citizens.commands.traitc.not-configurable=That trait is not configurable.
|
||||
citizens.commands.traitc.not-on-npc=The NPC doesn''t have that trait.
|
||||
citizens.commands.unknown-command=Unknown command. Did you mean:
|
||||
citizens.commands.unknown-command=Unknown command.
|
||||
citizens.commands.waypoints.add.waypoint-added=Added waypoint at [[{0}]] (index [[{1}]]).
|
||||
citizens.commands.waypoints.disableteleporting.disabled=[[{0}]] will no longer teleport when stuck pathfinding.
|
||||
citizens.commands.waypoints.disableteleporting.enabled=[[{0}]] will now teleport when stuck pathfinding.
|
||||
|
Loading…
Reference in New Issue
Block a user