mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Fixed many bugs!
- Asset issue with Dynamic Valve fixed - Fixed pipes connecting to Dynamic Valves when not part of structure - Fixed stack overflow when rendering valve fluids - Fixed transmitter networks considering pull-based block connections as acceptor connections - Fixed dynamic tanks maintaining a fluid type even when it has been depleted - Fixed "clearIfNecessary()" transmitter calls not working
This commit is contained in:
1 parent
09f1a04764
commit
6f0cf3a166
9 files changed
+118
-108
No files matched your search
@@ -89,6 +89,11 @@ public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTank
|
||||
{
|
||||
if(structure != null)
|
||||
{
|
||||
if(structure.fluidStored != null && structure.fluidStored.amount <= 0)
|
||||
{
|
||||
structure.fluidStored = null;
|
||||
}
|
||||
|
||||
manageInventory();
|
||||
}
|
||||
}
|
||||
@@ -281,28 +286,27 @@ public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTank
|
||||
{
|
||||
data.add(structure.volume*TankUpdateProtocol.FLUID_PER_TANK);
|
||||
data.add(structure.editMode.ordinal());
|
||||
}
|
||||
|
||||
if(structure != null && structure.fluidStored != null)
|
||||
{
|
||||
data.add(1);
|
||||
data.add(structure.fluidStored.fluidID);
|
||||
data.add(structure.fluidStored.amount);
|
||||
}
|
||||
else {
|
||||
data.add(0);
|
||||
}
|
||||
|
||||
if(structure != null && isRendering)
|
||||
{
|
||||
data.add(structure.valves.size());
|
||||
|
||||
for(ValveData valveData : structure.valves)
|
||||
|
||||
if(structure.fluidStored != null)
|
||||
{
|
||||
valveData.location.write(data);
|
||||
data.add(1);
|
||||
data.add(structure.fluidStored.fluidID);
|
||||
data.add(structure.fluidStored.amount);
|
||||
}
|
||||
else {
|
||||
data.add(0);
|
||||
}
|
||||
|
||||
if(isRendering)
|
||||
{
|
||||
data.add(structure.valves.size());
|
||||
|
||||
data.add(valveData.side.ordinal());
|
||||
data.add(valveData.serverFluid);
|
||||
for(ValveData valveData : structure.valves)
|
||||
{
|
||||
valveData.location.write(data);
|
||||
data.add(valveData.side.ordinal());
|
||||
data.add(valveData.serverFluid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,47 +322,47 @@ public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTank
|
||||
{
|
||||
clientCapacity = dataStream.readInt();
|
||||
structure.editMode = ContainerEditMode.values()[dataStream.readInt()];
|
||||
}
|
||||
|
||||
if(dataStream.readInt() == 1)
|
||||
{
|
||||
structure.fluidStored = new FluidStack(dataStream.readInt(), dataStream.readInt());
|
||||
}
|
||||
else {
|
||||
structure.fluidStored = null;
|
||||
}
|
||||
|
||||
if(clientHasStructure && isRendering)
|
||||
{
|
||||
int size = dataStream.readInt();
|
||||
|
||||
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());
|
||||
int viewingTicks = 0;
|
||||
structure.fluidStored = new FluidStack(dataStream.readInt(), dataStream.readInt());
|
||||
}
|
||||
else {
|
||||
structure.fluidStored = null;
|
||||
}
|
||||
|
||||
if(dataStream.readBoolean())
|
||||
{
|
||||
viewingTicks = 30;
|
||||
}
|
||||
if(isRendering)
|
||||
{
|
||||
int size = dataStream.readInt();
|
||||
|
||||
if(viewingTicks == 0)
|
||||
for(int i = 0; i < size; i++)
|
||||
{
|
||||
if(valveViewing.containsKey(data) && valveViewing.get(data) > 0)
|
||||
ValveData data = new ValveData();
|
||||
data.location = Coord4D.read(dataStream);
|
||||
data.side = ForgeDirection.getOrientation(dataStream.readInt());
|
||||
int viewingTicks = 0;
|
||||
|
||||
if(dataStream.readBoolean())
|
||||
{
|
||||
continue;
|
||||
viewingTicks = 30;
|
||||
}
|
||||
}
|
||||
|
||||
valveViewing.put(data, viewingTicks);
|
||||
if(viewingTicks == 0)
|
||||
{
|
||||
if(valveViewing.containsKey(data) && valveViewing.get(data) > 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
TileEntityDynamicTank tileEntity = (TileEntityDynamicTank)data.location.getTileEntity(worldObj);
|
||||
valveViewing.put(data, viewingTicks);
|
||||
|
||||
if(tileEntity != null)
|
||||
{
|
||||
tileEntity.clientHasStructure = true;
|
||||
TileEntityDynamicTank tileEntity = (TileEntityDynamicTank)data.location.getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity != null)
|
||||
{
|
||||
tileEntity.clientHasStructure = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user