|
|
|
@ -443,10 +443,10 @@
|
|
|
|
|
+ // Cauldron start - refactor entire method for sanity.
|
|
|
|
|
+ public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3)
|
|
|
|
|
+ {
|
|
|
|
|
+ return this.respawnPlayer(par1EntityPlayerMP, par2, par3, null, TeleportCause.DEATH);
|
|
|
|
|
+ return this.respawnPlayer(par1EntityPlayerMP, par2, par3, null);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int targetDimension, boolean returnFromEnd, Location location, TeleportCause cause)
|
|
|
|
|
+ public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int targetDimension, boolean returnFromEnd, Location location)
|
|
|
|
|
+ {
|
|
|
|
|
+ // Phase 1 - check if the player is allowed to respawn in same dimension
|
|
|
|
|
+ World world = mcServer.worldServerForDimension(targetDimension);
|
|
|
|
@ -504,7 +504,7 @@
|
|
|
|
|
+ par1EntityPlayerMP.dimension = targetDimension;
|
|
|
|
|
+ // CraftBukkit start
|
|
|
|
|
+ EntityPlayerMP entityplayermp1 = par1EntityPlayerMP;
|
|
|
|
|
+ entityplayermp1.clonePlayer(par1EntityPlayerMP, cause != TeleportCause.DEATH); // KCauldron - clone player
|
|
|
|
|
+ entityplayermp1.clonePlayer(par1EntityPlayerMP, returnFromEnd); // KCauldron - clone player
|
|
|
|
|
+ entityplayermp1.setWorld(this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension)); // make sure to update reference for bed spawn logic
|
|
|
|
|
+ entityplayermp1.playerConqueredTheEnd = false;
|
|
|
|
|
ChunkCoordinates chunkcoordinates1;
|
|
|
|
@ -619,9 +619,9 @@
|
|
|
|
|
+ // If world changed then fire the appropriate change world event else respawn
|
|
|
|
|
+ if (fromWorld != location.getWorld())
|
|
|
|
|
+ {
|
|
|
|
|
+ FMLCommonHandler.instance().firePlayerRespawnEvent(entityplayermp1);
|
|
|
|
|
+ FMLCommonHandler.instance().firePlayerChangedDimensionEvent(entityplayermp1, ((CraftWorld) fromWorld).getHandle().provider.dimensionId,
|
|
|
|
|
+ ((CraftWorld) location.getWorld()).getHandle().provider.dimensionId, (CraftWorld) fromWorld); // Cauldron - fire forge changed dimension event
|
|
|
|
|
+ FMLCommonHandler.instance().firePlayerRespawnEvent(entityplayermp1);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ FMLCommonHandler.instance().firePlayerRespawnEvent(entityplayermp1);
|
|
|
|
|