From 65e0f8e01f8456c448069e239c8525cc4476d30a Mon Sep 17 00:00:00 2001 From: Ammar Askar Date: Tue, 8 Oct 2013 18:56:05 +0500 Subject: [PATCH] Pull in respawn API, thanks @ninja- --- Bukkit-Patches/0018-Respawn-API.patch | 30 +++++++++++++++++++++ CraftBukkit-Patches/0075-Respawn-API.patch | 31 ++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 Bukkit-Patches/0018-Respawn-API.patch create mode 100644 CraftBukkit-Patches/0075-Respawn-API.patch diff --git a/Bukkit-Patches/0018-Respawn-API.patch b/Bukkit-Patches/0018-Respawn-API.patch new file mode 100644 index 000000000..ed97f4da2 --- /dev/null +++ b/Bukkit-Patches/0018-Respawn-API.patch @@ -0,0 +1,30 @@ +From 1b666e47c484bbf9b02653da53a53e978bc645dd Mon Sep 17 00:00:00 2001 +From: ninja- +Date: Tue, 8 Oct 2013 14:35:58 +0200 +Subject: [PATCH] Add respawn API. + +--- + src/main/java/org/bukkit/entity/Player.java | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java +index 9ee8f5f..8fd9a07 100644 +--- a/src/main/java/org/bukkit/entity/Player.java ++++ b/src/main/java/org/bukkit/entity/Player.java +@@ -762,6 +762,14 @@ public void setCollidesWithEntities(boolean collides) + { + throw new UnsupportedOperationException( "Not supported yet." ); + } ++ ++ /** ++ * Respawns the player if dead. ++ */ ++ public void respawn() ++ { ++ throw new UnsupportedOperationException( "Not supported yet." ); ++ } + } + + Spigot spigot(); +-- +1.8.4 diff --git a/CraftBukkit-Patches/0075-Respawn-API.patch b/CraftBukkit-Patches/0075-Respawn-API.patch new file mode 100644 index 000000000..5b7a3b9ea --- /dev/null +++ b/CraftBukkit-Patches/0075-Respawn-API.patch @@ -0,0 +1,31 @@ +From 228b3e3112bbfc6e56b082ffabf68774f8a7c87c Mon Sep 17 00:00:00 2001 +From: ninja- +Date: Tue, 8 Oct 2013 14:34:49 +0200 +Subject: [PATCH] Implement respawn API. + +--- + src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index 33674b1..2c607aa 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -1135,6 +1135,15 @@ public void setCollidesWithEntities(boolean collides) + getHandle().collidesWithEntities = collides; + getHandle().m = collides; // First boolean of Entity + } ++ ++ @Override ++ public void respawn() ++ { ++ if ( entity.dead ) ++ { ++ server.getServer().getPlayerList().moveToWorld( getHandle(), 0, false ); ++ } ++ } + }; + + public Player.Spigot spigot() +-- +1.8.4