From d75f648106212e8505d2e1c71136ec17de8014ef Mon Sep 17 00:00:00 2001 From: Robotia Date: Mon, 14 Mar 2016 23:49:59 -0400 Subject: [PATCH] Correct event order, fixing #236 --- .../ServerConfigurationManager.java.patch | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch b/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch index e7c0f489..f484a865 100644 --- a/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch +++ b/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch @@ -408,7 +408,7 @@ public EntityPlayerMP createPlayerForUser(GameProfile p_148545_1_) { UUID uuid = EntityPlayer.func_146094_a(p_148545_1_); -@@ -410,80 +626,304 @@ +@@ -410,80 +626,305 @@ return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), p_148545_1_, (ItemInWorldManager)object); } @@ -739,19 +739,20 @@ + break; + } + } -+ //Thermos Start, make sure dimension then respawn events are called -+ // If world changed then fire the appropriate change world event else respawn ++ + FMLCommonHandler.instance().firePlayerRespawnEvent(entityplayermp1); ++ //Thermos Start, make sure respawn THEN dimension change events are called ++ // If world changed then fire the appropriate change world event + if (fromWorld != location.getWorld()) + { + 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); + //Thermos end return entityplayermp1; } -@@ -492,34 +932,112 @@ +@@ -492,34 +933,112 @@ transferPlayerToDimension(p_72356_1_, p_72356_2_, mcServer.worldServerForDimension(p_72356_2_).getDefaultTeleporter()); } @@ -884,7 +885,7 @@ } public void transferEntityToWorld(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, Teleporter teleporter) -@@ -605,6 +1123,109 @@ +@@ -605,6 +1124,109 @@ p_82448_1_.setWorld(p_82448_4_); } @@ -994,7 +995,7 @@ public void sendPlayerInfoToAllPlayers() { if (++this.playerPingIndex > 600) -@@ -612,11 +1233,13 @@ +@@ -612,11 +1234,13 @@ this.playerPingIndex = 0; } @@ -1008,7 +1009,7 @@ } public void sendPacketToAllPlayers(Packet p_148540_1_) -@@ -877,13 +1500,24 @@ +@@ -877,13 +1501,24 @@ for (int j = 0; j < this.playerEntityList.size(); ++j) { EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(j); @@ -1035,7 +1036,7 @@ if (d4 * d4 + d5 * d5 + d6 * d6 < p_148543_8_ * p_148543_8_) { entityplayermp.playerNetServerHandler.sendPacket(p_148543_11_); -@@ -941,13 +1575,16 @@ +@@ -941,13 +1576,16 @@ p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0.0F)); p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, p_72354_2_.getRainStrength(1.0F))); p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(8, p_72354_2_.getWeightedThunderStrength(1.0F))); @@ -1053,7 +1054,7 @@ p_72385_1_.playerNetServerHandler.sendPacket(new S09PacketHeldItemChange(p_72385_1_.inventory.currentItem)); } -@@ -961,9 +1598,17 @@ +@@ -961,9 +1599,17 @@ return this.maxPlayers; } @@ -1072,7 +1073,7 @@ } public void setWhiteListEnabled(boolean p_72371_1_) -@@ -1032,12 +1677,30 @@ +@@ -1032,12 +1678,30 @@ public void removeAllPlayers() {