parent
12b0a52ae0
commit
07698c433a
@ -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());
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user