diff --git a/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch b/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch index 02a6e0b..803cf0e 100644 --- a/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch +++ b/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch @@ -450,10 +450,10 @@ + // Cauldron start - refactor entire method for sanity. + public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3) + { -+ return this.respawnPlayer(par1EntityPlayerMP, par2, par3, null); ++ return this.respawnPlayer(par1EntityPlayerMP, par2, par3, null, TeleportCause.DEATH); + } + -+ public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int targetDimension, boolean returnFromEnd, Location location) ++ public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int targetDimension, boolean returnFromEnd, Location location, TeleportCause cause) + { + // Phase 1 - check if the player is allowed to respawn in same dimension + World world = mcServer.worldServerForDimension(targetDimension); @@ -506,7 +506,7 @@ + EntityPlayerMP entityplayermp1 = new EntityPlayerMP(mcServer, mcServer.worldServerForDimension(targetDimension), par1EntityPlayerMP.getGameProfile(), new ItemInWorldManager(mcServer.worldServerForDimension(targetDimension))); + entityplayermp1.playerNetServerHandler = par1EntityPlayerMP.playerNetServerHandler; + entityplayermp1.playerNetServerHandler.playerEntity = entityplayermp1; -+ entityplayermp1.clonePlayer(par1EntityPlayerMP, returnFromEnd); // KCauldron - clone player ++ entityplayermp1.clonePlayer(par1EntityPlayerMP, cause != TeleportCause.DEATH); // KCauldron - clone player + entityplayermp1.setWorld(mcServer.worldServerForDimension(targetDimension));; + entityplayermp1.playerConqueredTheEnd = false; + entityplayermp1.setEntityId(par1EntityPlayerMP.getEntityId()); diff --git a/patches/org/bukkit/event/player/PlayerTeleportEvent.java.patch b/patches/org/bukkit/event/player/PlayerTeleportEvent.java.patch index 68dc6d0..83c88c6 100644 --- a/patches/org/bukkit/event/player/PlayerTeleportEvent.java.patch +++ b/patches/org/bukkit/event/player/PlayerTeleportEvent.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/org/bukkit/event/player/PlayerTeleportEvent.java +++ ../src-work/minecraft/org/bukkit/event/player/PlayerTeleportEvent.java -@@ -55,11 +55,27 @@ +@@ -55,11 +55,30 @@ * portal */ END_PORTAL, @@ -11,6 +11,9 @@ + */ + MOD, + // Cauldron end ++ // KCauldron start ++ DEATH, ++ // KCauldron end + /** * Indicates the teleportation was caused by an event not covered by * this enum diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 5b3e16a..01bf360 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -503,7 +503,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (fromWorld == toWorld) { entity.playerNetServerHandler.teleport(to); } else { - server.getHandle().respawnPlayer(entity, toWorld.dimension, false, to); // Cauldron + server.getHandle().respawnPlayer(entity, toWorld.dimension, false, to, cause); // Cauldron } return true; }