Implement respawn API.

By: ninja- <xninja@openmailbox.org>
This commit is contained in:
CraftBukkit/Spigot 2013-10-08 14:34:49 +02:00
parent a702945c70
commit 9e02bc055b

View file

@ -2343,6 +2343,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Spigot start
private final Player.Spigot spigot = new Player.Spigot()
{
@Override
public void respawn()
{
if ( CraftPlayer.this.getHealth() <= 0 && CraftPlayer.this.isOnline() )
{
CraftPlayer.this.server.getServer().getPlayerList().respawn( CraftPlayer.this.getHandle(), false, Entity.RemovalReason.KILLED, org.bukkit.event.player.PlayerRespawnEvent.RespawnReason.PLUGIN );
}
}
};
public Player.Spigot spigot()