might have fixed tank loading issue

all honesty i'm confused to why the tank is acting up like this. The
code should not be this delicate that a few lines throw it off.
This commit is contained in:
DarkGuardsman 2013-09-13 07:50:41 -04:00
parent fb3a235abe
commit 517af9442d
3 changed files with 5 additions and 16 deletions

View file

@ -99,8 +99,7 @@ public class NetworkFluidContainers extends NetworkFluidTiles
{
if (part instanceof TileEntity)
{
TileEntity ent = ((TileEntity) part);
ent.worldObj.markBlockForUpdate(ent.xCoord, ent.yCoord, ent.zCoord);
((TileEntity) part).worldObj.markBlockForUpdate(((TileEntity) part).xCoord, ((TileEntity) part).yCoord, ((TileEntity) part).zCoord);
}
}
}

View file

@ -1,9 +1,7 @@
package dark.core.prefab.tilenetwork.fluid;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import net.minecraft.tileentity.TileEntity;
@ -22,7 +20,7 @@ public class NetworkFluidTiles extends NetworkTileEntities
/** Fluid Tanks that are connected to the network but not part of it ** */
public final Set<IFluidHandler> connectedTanks = new HashSet<IFluidHandler>();
/** Collective storage of all fluid tiles */
public FluidTank sharedTank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME);
public FluidTank sharedTank;
/** Color code of the network, mainly used for connection rules */
public ColorCode color = ColorCode.NONE;
@ -113,7 +111,6 @@ public class NetworkFluidTiles extends NetworkTileEntities
@Override
public void writeDataToTiles()
{
super.writeDataToTiles();
if (this.combinedStorage().getFluid() != null && this.networkMember.size() > 0)
{
FluidStack stack = this.combinedStorage().getFluid() == null ? null : this.combinedStorage().getFluid().copy();
@ -138,15 +135,14 @@ public class NetworkFluidTiles extends NetworkTileEntities
}
}
}
this.cleanUpMembers();
}
@Override
public void readDataFromTiles()
{
super.readDataFromTiles();
System.out.println("Debug>>FluidTiles>>Reading fluid stack from tiles");
FluidStack stack = null;
this.cleanUpMembers();
for (INetworkPart par : this.networkMember)
{
if (par instanceof INetworkFluidPart)
@ -240,7 +236,6 @@ public class NetworkFluidTiles extends NetworkTileEntities
newNetwork.combinedStorage().setFluid(FluidCraftingHandler.mergeFluidStacks(one, two));
newNetwork.writeDataToTiles();
}
@Override

View file

@ -16,7 +16,6 @@ import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fluids.IFluidTank;
@ -356,11 +355,7 @@ public class TileEntityTank extends TileEntityFluidStorage implements IFluidHand
@Override
public IFluidTank getTank(int index)
{
if (index == 0)
{
return this.getTank();
}
return null;
}
}