mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-31 00:20:44 +01:00
Implement respawn API.
By: ninja- <xninja@openmailbox.org>
This commit is contained in:
parent
a702945c70
commit
9e02bc055b
1 changed files with 9 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue