mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 14:52:58 +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
@@ -16,13 +16,20 @@ public class PacketEntityMove implements IMessageHandler<EntityMoveMessage, IMes
|
||||
public IMessage onMessage(EntityMoveMessage message, MessageContext context)
|
||||
{
|
||||
EntityPlayer player = PacketHandler.getPlayer(context);
|
||||
Entity entity = player.worldObj.getEntityByID(message.entityId);
|
||||
|
||||
if(entity != null)
|
||||
{
|
||||
entity.setLocationAndAngles(message.pos.xCoord, message.pos.yCoord, message.pos.zCoord, entity.rotationYaw, entity.rotationPitch);
|
||||
}
|
||||
|
||||
PacketHandler.handlePacket(new Runnable() {
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Entity entity = player.worldObj.getEntityByID(message.entityId);
|
||||
|
||||
if(entity != null)
|
||||
{
|
||||
entity.setLocationAndAngles(message.pos.xCoord, message.pos.yCoord, message.pos.zCoord, entity.rotationYaw, entity.rotationPitch);
|
||||
}
|
||||
}
|
||||
}, player.worldObj);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user