mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-27 23:33:08 +00:00
Fixed packet security
This commit is contained in:
1 parent
1c90980d68
commit
7ae60615e2
57 files changed
+1149
-984
No files matched your search
@@ -250,38 +250,41 @@ public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTank
|
||||
{
|
||||
super.handlePacketData(dataStream);
|
||||
|
||||
if(clientHasStructure)
|
||||
if(worldObj.isRemote)
|
||||
{
|
||||
clientCapacity = dataStream.readInt();
|
||||
structure.editMode = ContainerEditMode.values()[dataStream.readInt()];
|
||||
|
||||
if(dataStream.readInt() == 1)
|
||||
if(clientHasStructure)
|
||||
{
|
||||
structure.fluidStored = new FluidStack(FluidRegistry.getFluid(dataStream.readInt()), dataStream.readInt());
|
||||
}
|
||||
else {
|
||||
structure.fluidStored = null;
|
||||
}
|
||||
|
||||
if(isRendering)
|
||||
{
|
||||
int size = dataStream.readInt();
|
||||
clientCapacity = dataStream.readInt();
|
||||
structure.editMode = ContainerEditMode.values()[dataStream.readInt()];
|
||||
|
||||
valveViewing.clear();
|
||||
|
||||
for(int i = 0; i < size; i++)
|
||||
if(dataStream.readInt() == 1)
|
||||
{
|
||||
ValveData data = new ValveData();
|
||||
data.location = Coord4D.read(dataStream);
|
||||
data.side = ForgeDirection.getOrientation(dataStream.readInt());
|
||||
structure.fluidStored = new FluidStack(FluidRegistry.getFluid(dataStream.readInt()), dataStream.readInt());
|
||||
}
|
||||
else {
|
||||
structure.fluidStored = null;
|
||||
}
|
||||
|
||||
if(isRendering)
|
||||
{
|
||||
int size = dataStream.readInt();
|
||||
|
||||
valveViewing.add(data);
|
||||
|
||||
TileEntityDynamicTank tileEntity = (TileEntityDynamicTank)data.location.getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity != null)
|
||||
valveViewing.clear();
|
||||
|
||||
for(int i = 0; i < size; i++)
|
||||
{
|
||||
tileEntity.clientHasStructure = true;
|
||||
ValveData data = new ValveData();
|
||||
data.location = Coord4D.read(dataStream);
|
||||
data.side = ForgeDirection.getOrientation(dataStream.readInt());
|
||||
|
||||
valveViewing.add(data);
|
||||
|
||||
TileEntityDynamicTank tileEntity = (TileEntityDynamicTank)data.location.getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity != null)
|
||||
{
|
||||
tileEntity.clientHasStructure = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user