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

@@ -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;
}