From 899a8ad4acf9b35a8a20c713205a1719a625a08d Mon Sep 17 00:00:00 2001 From: ninja- Date: Tue, 8 Oct 2013 14:34:49 +0200 Subject: [PATCH] Implement respawn API. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index b4488db6e..0bd717bf8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2064,6 +2064,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Spigot start private final Player.Spigot spigot = new Player.Spigot() { + + @Override + public void respawn() + { + if ( getHealth() <= 0 && isOnline() ) + { + server.getServer().getPlayerList().respawn( getHandle(), false, org.bukkit.event.player.PlayerRespawnEvent.RespawnReason.PLUGIN ); + } + } }; public Player.Spigot spigot() -- 2.40.1