mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-28 07:36:01 +00:00
Packets should be thread safe now
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user