Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Commit

Permalink
Correct event order, fixing #236
Browse files Browse the repository at this point in the history
  • Loading branch information
robotia committed Mar 15, 2016
1 parent a9f82c6 commit d75f648
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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());
}

Expand Down Expand Up @@ -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_);
}

Expand Down Expand Up @@ -994,7 +995,7 @@
public void sendPlayerInfoToAllPlayers()
{
if (++this.playerPingIndex > 600)
@@ -612,11 +1233,13 @@
@@ -612,11 +1234,13 @@
this.playerPingIndex = 0;
}

Expand All @@ -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);
Expand All @@ -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)));
Expand All @@ -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;
}

Expand All @@ -1072,7 +1073,7 @@
}

public void setWhiteListEnabled(boolean p_72371_1_)
@@ -1032,12 +1677,30 @@
@@ -1032,12 +1678,30 @@

public void removeAllPlayers()
{
Expand Down

0 comments on commit d75f648

Please sign in to comment.