mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +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
@@ -31,20 +31,26 @@ public class PacketTileEntity implements IMessageHandler<TileEntityMessage, IMes
|
||||
return null;
|
||||
}
|
||||
|
||||
TileEntity tileEntity = message.coord4D.getTileEntity(player.worldObj);
|
||||
|
||||
if(CapabilityUtils.hasCapability(tileEntity, BaseCapabilities.TILE_NETWORK_CAPABILITY, null))
|
||||
{
|
||||
ITileNetwork network = CapabilityUtils.getCapability(tileEntity, BaseCapabilities.TILE_NETWORK_CAPABILITY, null);
|
||||
|
||||
try {
|
||||
network.handlePacketData(message.storedBuffer);
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
PacketHandler.handlePacket(new Runnable() {
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
TileEntity tileEntity = message.coord4D.getTileEntity(player.worldObj);
|
||||
|
||||
if(CapabilityUtils.hasCapability(tileEntity, BaseCapabilities.TILE_NETWORK_CAPABILITY, null))
|
||||
{
|
||||
ITileNetwork network = CapabilityUtils.getCapability(tileEntity, BaseCapabilities.TILE_NETWORK_CAPABILITY, null);
|
||||
|
||||
try {
|
||||
network.handlePacketData(message.storedBuffer);
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
message.storedBuffer.release();
|
||||
}
|
||||
}
|
||||
|
||||
message.storedBuffer.release();
|
||||
}
|
||||
}, player.worldObj);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user