Respawning in dimensions should now properly set the dimension ID for the new player instance.

This commit is contained in:
LexManos 2012-04-17 08:47:22 -07:00
parent e462ecb9b9
commit 75a40177ec

View file

@ -62,7 +62,15 @@
} }
/** /**
@@ -289,6 +294,10 @@ @@ -245,6 +250,7 @@
var5.copyPlayer(par1EntityPlayerMP);
}
+ var5.dimension = par2;
var5.entityId = par1EntityPlayerMP.entityId;
var5.playerNetServerHandler = par1EntityPlayerMP.playerNetServerHandler;
WorldServer var6 = this.mcServer.getWorldManager(par1EntityPlayerMP.dimension);
@@ -289,6 +295,10 @@
*/ */
public void sendPlayerToOtherDimension(EntityPlayerMP par1EntityPlayerMP, int par2) public void sendPlayerToOtherDimension(EntityPlayerMP par1EntityPlayerMP, int par2)
{ {
@ -73,7 +81,7 @@
int var3 = par1EntityPlayerMP.dimension; int var3 = par1EntityPlayerMP.dimension;
WorldServer var4 = this.mcServer.getWorldManager(par1EntityPlayerMP.dimension); WorldServer var4 = this.mcServer.getWorldManager(par1EntityPlayerMP.dimension);
par1EntityPlayerMP.dimension = par2; par1EntityPlayerMP.dimension = par2;
@@ -296,33 +305,14 @@ @@ -296,33 +306,14 @@
par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, var5.getWorldInfo().getTerrainType(), var5.getHeight(), par1EntityPlayerMP.itemInWorldManager.getGameType())); par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, var5.getWorldInfo().getTerrainType(), var5.getHeight(), par1EntityPlayerMP.itemInWorldManager.getGameType()));
var4.removePlayer(par1EntityPlayerMP); var4.removePlayer(par1EntityPlayerMP);
par1EntityPlayerMP.isDead = false; par1EntityPlayerMP.isDead = false;
@ -113,7 +121,7 @@
{ {
ChunkCoordinates var12 = var5.getEntrancePortalLocation(); ChunkCoordinates var12 = var5.getEntrancePortalLocation();
var6 = (double)var12.posX; var6 = (double)var12.posX;
@@ -342,7 +332,7 @@ @@ -342,7 +333,7 @@
par1EntityPlayerMP.setLocationAndAngles(var6, par1EntityPlayerMP.posY, var8, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch); par1EntityPlayerMP.setLocationAndAngles(var6, par1EntityPlayerMP.posY, var8, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch);
var5.updateEntityWithOptionalForce(par1EntityPlayerMP, false); var5.updateEntityWithOptionalForce(par1EntityPlayerMP, false);
var5.chunkProviderServer.chunkLoadOverride = true; var5.chunkProviderServer.chunkLoadOverride = true;
@ -122,7 +130,7 @@
var5.chunkProviderServer.chunkLoadOverride = false; var5.chunkProviderServer.chunkLoadOverride = false;
} }
@@ -372,9 +362,9 @@ @@ -372,9 +363,9 @@
this.sendPacketToAllPlayers(new Packet201PlayerInfo(var1.username, true, var1.ping)); this.sendPacketToAllPlayers(new Packet201PlayerInfo(var1.username, true, var1.ping));
} }
@ -134,7 +142,7 @@
} }
} }
@@ -907,7 +897,7 @@ @@ -907,7 +898,7 @@
public String[] func_52019_t() public String[] func_52019_t()
{ {