Auto-Sync
This commit is contained in:
parent
3896f650a2
commit
786158733c
10 changed files with 19 additions and 60 deletions
|
@ -4,14 +4,12 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
import dark.api.ColorCode.IColorCoded;
|
||||
import dark.api.parts.INetworkPart;
|
||||
|
||||
/** Interface used by part that are members of a fluid tile network. Parts in the network will act as
|
||||
* one entity and will be controlled by the network. This means the network need the part to access
|
||||
* the parts in a set way to function correctly
|
||||
*
|
||||
*
|
||||
* @author DarkGuardsman */
|
||||
public interface INetworkFluidPart extends IFluidHandler, INetworkPart
|
||||
{
|
||||
|
@ -29,11 +27,11 @@ public interface INetworkFluidPart extends IFluidHandler, INetworkPart
|
|||
|
||||
/** Can the fluid pass from one side to the next. Used by path finder to see if the fluid can
|
||||
* move threw the pipes.
|
||||
*
|
||||
*
|
||||
* @param fluid - fluid that is trying to pass threw
|
||||
* @param from - direction the fluid is coming from
|
||||
* @param to - direction the fluid is going to
|
||||
*
|
||||
*
|
||||
* @Note only do logic in the method as it may be called many times and expect no change from
|
||||
* the pipes or world.
|
||||
* @return true will let the fluid pass. */
|
||||
|
@ -41,7 +39,7 @@ public interface INetworkFluidPart extends IFluidHandler, INetworkPart
|
|||
|
||||
/** Called while the fluid is passing threw the pipe. This is the pipes chance to modify the
|
||||
* fluid or react to the fluid
|
||||
*
|
||||
*
|
||||
* @param fluid - fluid that is trying to pass threw
|
||||
* @param from - direction the fluid is coming from
|
||||
* @param to - direction the fluid is going to
|
||||
|
|
|
@ -6,7 +6,6 @@ import java.util.List;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import dark.api.ColorCode;
|
||||
import dark.api.fluid.INetworkFluidPart;
|
||||
import dark.api.parts.INetworkPart;
|
||||
import dark.core.prefab.helpers.FluidHelper;
|
||||
|
@ -15,7 +14,7 @@ import dark.core.prefab.tilenetwork.NetworkTileEntities;
|
|||
/** Side note: the network should act like this when done {@link http
|
||||
* ://www.e4training.com/hydraulic_calculators/B1.htm} as well as stay compatible with the forge
|
||||
* Liquids
|
||||
*
|
||||
*
|
||||
* @author Rseifert */
|
||||
public class NetworkFluidContainers extends NetworkFluidTiles
|
||||
{
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
package dark.core.prefab.tilenetwork.fluid;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import dark.api.ColorCode;
|
||||
import dark.api.fluid.INetworkPipe;
|
||||
import dark.api.parts.INetworkPart;
|
||||
import dark.core.prefab.helpers.ConnectionHelper;
|
||||
|
@ -19,7 +14,7 @@ import dark.core.prefab.tilenetwork.NetworkTileEntities;
|
|||
/** Side note: the network should act like this when done {@link http
|
||||
* ://www.e4training.com/hydraulic_calculators/B1.htm} as well as stay compatible with the forge
|
||||
* Liquids
|
||||
*
|
||||
*
|
||||
* @author Rseifert */
|
||||
public class NetworkPipes extends NetworkFluidTiles
|
||||
{
|
||||
|
@ -44,7 +39,7 @@ public class NetworkPipes extends NetworkFluidTiles
|
|||
}
|
||||
|
||||
/** Adds FLuid to this network from one of the connected Pipes
|
||||
*
|
||||
*
|
||||
* @param source - Were this liquid came from
|
||||
* @param stack - LiquidStack to be sent
|
||||
* @param doFill - actually fill the tank or just check numbers
|
||||
|
@ -55,7 +50,7 @@ public class NetworkPipes extends NetworkFluidTiles
|
|||
}
|
||||
|
||||
/** Adds FLuid to this network from one of the connected Pipes
|
||||
*
|
||||
*
|
||||
* @param source - Were this liquid came from
|
||||
* @param stack - LiquidStack to be sent
|
||||
* @param doFill - actually fill the tank or just check numbers
|
||||
|
|
|
@ -12,11 +12,11 @@ import dark.fluid.common.prefab.TileEntityFluidNetworkTile;
|
|||
|
||||
/** Enum to hold info about each pipe material. Values are by default and some can change with pipe
|
||||
* upgrades.
|
||||
*
|
||||
*
|
||||
* @Note unsupportedFluids should only be used by filters. All pipes should allow all fluid types.
|
||||
* However, pipes that can't support the fluid should have an effect. Eg no gas support should cause
|
||||
* the pipe to leak. No molten support should cause the pipe to take damage.
|
||||
*
|
||||
*
|
||||
* @author DarkGuardsman */
|
||||
public enum FluidPartsMaterial
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ public enum FluidPartsMaterial
|
|||
|
||||
public static FluidPartsMaterial get(int i)
|
||||
{
|
||||
if(i < FluidPartsMaterial.values().length)
|
||||
if (i < FluidPartsMaterial.values().length)
|
||||
{
|
||||
return FluidPartsMaterial.values()[i];
|
||||
}
|
||||
|
@ -145,13 +145,13 @@ public enum FluidPartsMaterial
|
|||
|
||||
public boolean canSupport(FluidStack fluid)
|
||||
{
|
||||
if(fluid != null && fluid.getFluid() != null)
|
||||
if (fluid != null && fluid.getFluid() != null)
|
||||
{
|
||||
if(fluid.getFluid().isGaseous(fluid) && this.canSupportGas)
|
||||
if (fluid.getFluid().isGaseous(fluid) && this.canSupportGas)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if(!fluid.getFluid().isGaseous(fluid) && this.canSupportFluids)
|
||||
else if (!fluid.getFluid().isGaseous(fluid) && this.canSupportFluids)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ import com.builtbroken.common.Pair;
|
|||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import dark.api.ColorCode.IColorCoded;
|
||||
import dark.core.prefab.helpers.FluidHelper;
|
||||
import dark.fluid.client.render.BlockRenderHelper;
|
||||
import dark.fluid.common.FluidPartsMaterial;
|
||||
|
|
|
@ -106,7 +106,7 @@ public class TileEntityReleaseValve extends TileEntityFluidDevice implements ITi
|
|||
}
|
||||
|
||||
/** if any of allowed list is true
|
||||
*
|
||||
*
|
||||
* @return true */
|
||||
public boolean isRestricted()
|
||||
{
|
||||
|
|
|
@ -8,7 +8,6 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -18,7 +17,6 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
|
||||
import com.builtbroken.common.Pair;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ public class ThreadFluidNetwork extends Thread
|
|||
//TODO create a thread to off load tile network calculation to reduce strain on the main thread. Things to include are fluid container updates, path finding, and fill target finding.
|
||||
/** Makes a request that this thread calculate the liquid storage locations in the network for
|
||||
* the entire network's volume
|
||||
*
|
||||
*
|
||||
* @even - each tile will get the same fluid level. If false physics will be used to calculate
|
||||
* were the fluid is */
|
||||
public static void calculateStorage(NetworkFluidTiles network, boolean even)
|
||||
|
|
|
@ -1,44 +1,14 @@
|
|||
package dark.fluid.common.pipes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import org.bouncycastle.util.Arrays;
|
||||
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.core.vector.VectorHelper;
|
||||
import universalelectricity.prefab.network.IPacketReceiver;
|
||||
import universalelectricity.prefab.tile.TileEntityAdvanced;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import dark.api.ColorCode;
|
||||
import dark.api.ColorCode.IColorCoded;
|
||||
import dark.api.IToolReadOut;
|
||||
import dark.api.fluid.FluidMasterList;
|
||||
import dark.api.fluid.INetworkPipe;
|
||||
import dark.api.parts.ITileConnector;
|
||||
import dark.core.common.DarkMain;
|
||||
import dark.core.network.PacketHandler;
|
||||
import dark.core.prefab.helpers.FluidHelper;
|
||||
import dark.core.prefab.tilenetwork.NetworkTileEntities;
|
||||
import dark.core.prefab.tilenetwork.fluid.NetworkPipes;
|
||||
import dark.fluid.common.FluidPartsMaterial;
|
||||
|
@ -156,7 +126,7 @@ public class TileEntityPipe extends TileEntityFluidNetworkTile implements IColor
|
|||
}
|
||||
|
||||
/** Calculates flow rate based on viscosity & temp of the fluid as all other factors are know
|
||||
*
|
||||
*
|
||||
* @param fluid - fluidStack
|
||||
* @param temp = tempature of the fluid
|
||||
* @param pressure - pressure difference of were the fluid is flowing too.
|
||||
|
|
|
@ -125,7 +125,7 @@ public abstract class TileEntityFluidNetworkTile extends TileEntityFluidDevice i
|
|||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
|
||||
{
|
||||
if (this.getTileNetwork() != null && resource != null)
|
||||
if (this.getTileNetwork() != null && resource != null)
|
||||
{
|
||||
if (this.getTileNetwork().getNetworkTank() != null && this.getTileNetwork().getNetworkTank().getFluid() != null && this.getTileNetwork().getNetworkTank().getFluid().isFluidEqual(resource))
|
||||
{
|
||||
|
@ -194,7 +194,7 @@ public abstract class TileEntityFluidNetworkTile extends TileEntityFluidDevice i
|
|||
}
|
||||
|
||||
/** Checks to make sure the connection is valid to the tileEntity
|
||||
*
|
||||
*
|
||||
* @param tileEntity - the tileEntity being checked
|
||||
* @param side - side the connection is too */
|
||||
public void validateConnectionSide(TileEntity tileEntity, ForgeDirection side)
|
||||
|
|
Loading…
Add table
Reference in a new issue