Packets should be thread safe now

This commit is contained in:
aidancbrady committed 2016-06-17 15:56:22 -04:00
1 parent 542e806644
commit e4aed3f7c1
25 files changed
+788 -624

No files matched your search

@@ -20,13 +20,19 @@ public class PacketPortalFX implements IMessageHandler<PortalFXMessage, IMessage
{
EntityPlayer player = PacketHandler.getPlayer(context);
Random random = new Random();
for(int i = 0; i < 50; i++)
{
player.worldObj.spawnParticle(EnumParticleTypes.PORTAL, message.coord4D.xCoord + random.nextFloat(), message.coord4D.yCoord + random.nextFloat(), message.coord4D.zCoord + random.nextFloat(), 0.0F, 0.0F, 0.0F);
player.worldObj.spawnParticle(EnumParticleTypes.PORTAL, message.coord4D.xCoord + random.nextFloat(), message.coord4D.yCoord + 1 + random.nextFloat(), message.coord4D.zCoord + random.nextFloat(), 0.0F, 0.0F, 0.0F);
}
PacketHandler.handlePacket(new Runnable() {
@Override
public void run()
{
Random random = new Random();
for(int i = 0; i < 50; i++)
{
player.worldObj.spawnParticle(EnumParticleTypes.PORTAL, message.coord4D.xCoord + random.nextFloat(), message.coord4D.yCoord + random.nextFloat(), message.coord4D.zCoord + random.nextFloat(), 0.0F, 0.0F, 0.0F);
player.worldObj.spawnParticle(EnumParticleTypes.PORTAL, message.coord4D.xCoord + random.nextFloat(), message.coord4D.yCoord + 1 + random.nextFloat(), message.coord4D.zCoord + random.nextFloat(), 0.0F, 0.0F, 0.0F);
}
}
}, player.worldObj);
return null;
}