PaperMC/CraftBukkit-Patches/0046-Implement-respawn-API.patch

30 lines
1,018 B
Diff
Raw Normal View History

2015-03-08 12:04:41 +01:00
From bd0dee6279b5d4087355f0cbd9a7111a47df71ba Mon Sep 17 00:00:00 2001
From: ninja- <xninja@openmailbox.org>
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
2015-02-28 12:36:22 +01:00
index 027ca4d..00043de 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1331,6 +1331,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getHandle().collidesWithEntities = collides;
getHandle().k = collides; // First boolean of Entity
}
+
+ @Override
+ public void respawn()
+ {
+ if ( getHealth() <= 0 && isOnline() )
+ {
+ server.getServer().getPlayerList().moveToWorld( getHandle(), 0, false );
+ }
+ }
};
public Player.Spigot spigot()
--
2014-11-28 02:17:45 +01:00
2.1.0