Removed can pass threw and on pass threw from fluid parts

This commit is contained in:
DarkGuardsman 2014-01-12 23:42:42 -05:00
parent 341da76724
commit c192cfdf54
4 changed files with 1 additions and 82 deletions

View file

@ -1,4 +1,4 @@
package resonantinduction.api.fluid; package resonantinduction.api.events;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;

View file

@ -1,6 +1,5 @@
package resonantinduction.api.fluid; package resonantinduction.api.fluid;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler; import net.minecraftforge.fluids.IFluidHandler;
@ -30,30 +29,4 @@ public interface INetworkFluidPart extends IFluidHandler, INetworkPart
* is used so the network has a direct method to access the pipes internal fluid storage * is used so the network has a direct method to access the pipes internal fluid storage
*/ */
public FluidStack drainTankContent(int index, int volume, boolean doDrain); public FluidStack drainTankContent(int index, int volume, boolean doDrain);
/**
* 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.
*/
public boolean canPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to);
/**
* 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
* @return true if something happened to completely stop the fluid from moving. Eg. pipe blew
* up, or jammed
*/
public boolean onPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to);
} }

View file

@ -100,14 +100,6 @@ public class TilePipe extends TileFluidNetwork implements IColorCoded, INetworkP
} }
@Override
public boolean onPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to)
{
// TODO do checks for molten pipe so that fluids like water turn into steam, oils and fuels
// burn
return super.onPassThrew(fluid, from, to);
}
@Override @Override
public double getMaxPressure(ForgeDirection side) public double getMaxPressure(ForgeDirection side)
{ {

View file

@ -310,52 +310,6 @@ public abstract class TileFluidNetwork extends TileEntityFluidDevice implements
return type == Connection.FLUIDS || type == Connection.NETWORK; return type == Connection.FLUIDS || type == Connection.NETWORK;
} }
@Override
public boolean canPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to)
{
return this.connectedBlocks.get(from.ordinal()) != null && this.connectedBlocks.get(to.ordinal()) != null && this.damage < this.maxDamage;
}
@Override
public boolean onPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to)
{
FluidContainerMaterial mat = FluidContainerMaterial.get(this.getBlockMetadata());
if (fluid != null && fluid.getFluid() != null && mat != null)
{
if (fluid.getFluid().isGaseous(fluid) && !mat.canSupportGas)
{
// TODO lose 25% of the gas, and render the escaping gas as a particle effect
this.getTileNetwork().drainNetworkTank(this.worldObj, (int) (fluid.amount * .05), true);
}
else if (FluidMasterList.isMolten(fluid.getFluid()) && !mat.canSupportMoltenFluids)
{
// TODO start to heat up the pipe to melting point. When it hits melting point turn
// the pipe to its molten metal equal
// TODO also once it reaches a set heat level start burning up blocks around the
// pipe such as wood
// this.heat += FluidMasterList.getHeatPerPass(fluid.getFluid());
if (heat >= this.maxHeat)
{
this.worldObj.setBlock(xCoord, yCoord, zCoord, Block.fire.blockID);
return true;
}
}
else if (!fluid.getFluid().isGaseous(fluid) && !mat.canSupportFluids)
{
this.damage += 1;
if (this.damage >= this.maxDamage)
{
// TODO test this and make sure its right, as well black fluid block in some
// cases
this.getBlockType().dropBlockAsItem(worldObj, xCoord, yCoord, zCoord, 0, 0);
this.worldObj.setBlock(xCoord, yCoord, zCoord, 0);
return true;
}
}
}
return false;
}
@Override @Override
public void readFromNBT(NBTTagCompound nbt) public void readFromNBT(NBTTagCompound nbt)
{ {