Fixed packet security

This commit is contained in:
aidancbrady committed 2016-05-17 13:49:55 -04:00
1 parent 1c90980d68
commit 7ae60615e2
57 files changed
+1149 -984

No files matched your search

@@ -112,19 +112,22 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
@Override
public void handlePacketData(ByteBuf dataStream)
{
facing = dataStream.readInt();
redstone = dataStream.readBoolean();
if(clientFacing != facing)
if(worldObj.isRemote)
{
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
clientFacing = facing;
}
for(ITileComponent component : components)
{
component.read(dataStream);
facing = dataStream.readInt();
redstone = dataStream.readBoolean();
if(clientFacing != facing)
{
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
clientFacing = facing;
}
for(ITileComponent component : components)
{
component.read(dataStream);
}
}
}