Don't teleport entities that are considered dead. Addresses BUKKIT-1331

Teleportation should never be processed on dead entities. If you wish
to teleport an entity, do it on a living entity. If you wish to
teleport a player, set their respawn location in PlayerRespawnEvent.
This commit is contained in:
feildmaster
2012-12-27 19:22:28 -06:00
parent fb0eed177a
commit 7b5a8d0c23
3 changed files with 18 additions and 0 deletions

View File

@@ -348,6 +348,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause) {
EntityPlayer entity = getHandle();
if (getHealth() == 0 || entity.dead) {
return false;
}
if (entity.playerConnection == null || entity.playerConnection.disconnected) {
return false;
}