mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
More work, currently broken
This commit is contained in:
1 parent
fc7dd3e65a
commit
548c5b0835
5 files changed
+42
-87
No files matched your search
@@ -10,16 +10,13 @@ import mekanism.api.Coord4D;
|
||||
import mekanism.common.IFluidContainerManager;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tank.DynamicTankCache;
|
||||
import mekanism.common.tank.SynchronizedTankData;
|
||||
import mekanism.common.tank.SynchronizedTankData.ValveData;
|
||||
import mekanism.common.tank.TankUpdateProtocol;
|
||||
import mekanism.common.util.FluidContainerUtils;
|
||||
import mekanism.common.util.FluidContainerUtils.ContainerEditMode;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
@@ -30,14 +27,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TileEntityDynamicTank extends TileEntityContainerBlock implements IFluidContainerManager
|
||||
{
|
||||
/** Unique inventory ID for the dynamic tank, serves as a way to retrieve cached inventories. */
|
||||
public int inventoryID = -1;
|
||||
|
||||
/** The tank data for this structure. */
|
||||
public SynchronizedTankData structure;
|
||||
|
||||
/** The cache used by this specific tank segment */
|
||||
public DynamicTankCache cachedData = new DynamicTankCache();
|
||||
|
||||
/** Whether or not to send this tank's structure in the next update packet. */
|
||||
public boolean sendStructure;
|
||||
@@ -149,11 +140,6 @@ public class TileEntityDynamicTank extends TileEntityContainerBlock implements I
|
||||
isRendering = false;
|
||||
}
|
||||
|
||||
if(inventoryID != -1 && structure == null)
|
||||
{
|
||||
Mekanism.tankManager.updateCache(inventoryID, cachedData, this);
|
||||
}
|
||||
|
||||
if(structure == null && ticker == 5)
|
||||
{
|
||||
update();
|
||||
@@ -187,10 +173,9 @@ public class TileEntityDynamicTank extends TileEntityContainerBlock implements I
|
||||
{
|
||||
structure.didTick = false;
|
||||
|
||||
if(inventoryID != -1)
|
||||
if(structure.inventoryID != -1)
|
||||
{
|
||||
cachedData.sync(structure);
|
||||
Mekanism.tankManager.updateCache(inventoryID, cachedData, this);
|
||||
Mekanism.tankManager.updateCache(this);
|
||||
}
|
||||
|
||||
manageInventory();
|
||||
@@ -532,35 +517,6 @@ public class TileEntityDynamicTank extends TileEntityContainerBlock implements I
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.readFromNBT(nbtTags);
|
||||
|
||||
if(structure == null)
|
||||
{
|
||||
inventoryID = nbtTags.getInteger("inventoryID");
|
||||
|
||||
if(inventoryID != -1)
|
||||
{
|
||||
cachedData.load(nbtTags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.writeToNBT(nbtTags);
|
||||
|
||||
nbtTags.setInteger("inventoryID", inventoryID);
|
||||
|
||||
if(inventoryID != -1)
|
||||
{
|
||||
cachedData.save(nbtTags);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getRenderBoundingBox()
|
||||
|
||||
Reference in new issue
Block a user