This commit is contained in:
Rseifert 2013-02-20 13:44:38 -05:00
parent 2779c99783
commit 69abbd43f3
11 changed files with 49 additions and 86 deletions

View file

@ -1,12 +0,0 @@
package fluidmech.common.block.liquids;
import hydraulic.core.prefab.LiquidFiniteStill;
public class BlockMilk extends LiquidFiniteStill
{
public BlockMilk(int i)
{
super(i);
this.setBlockName("MilkStill");
}
}

View file

@ -1,12 +0,0 @@
package fluidmech.common.block.liquids;
import hydraulic.core.prefab.LiquidFiniteStill;
public class BlockOil extends LiquidFiniteStill
{
public BlockOil(int i)
{
super(i);
this.setBlockName("OilStill");
}
}

View file

@ -1,12 +0,0 @@
package fluidmech.common.block.liquids;
import hydraulic.core.prefab.LiquidFiniteFlowing;
public class BlockOilFlowing extends LiquidFiniteFlowing
{
public BlockOilFlowing(int i)
{
super(i);
this.setBlockName("OilFlowing");
}
}

View file

@ -1,16 +1,15 @@
package fluidmech.common.tileentity; package fluidmech.common.tileentity;
import fluidmech.common.handlers.UpdateConverter;
import hydraulic.core.helpers.connectionHelper; import hydraulic.core.helpers.connectionHelper;
import hydraulic.core.implement.ColorCode; import hydraulic.core.implement.ColorCode;
import hydraulic.core.implement.IPipe; import hydraulic.core.implement.IColorCoded;
import hydraulic.core.implement.IPressure; import hydraulic.core.implement.IPsiCreator;
import hydraulic.core.implement.IReadOut; import hydraulic.core.implement.IReadOut;
import hydraulic.core.liquids.LiquidHandler; import hydraulic.core.liquids.LiquidHandler;
import java.util.Random; import java.util.Random;
import fluidmech.common.handlers.UpdateConverter;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -22,7 +21,7 @@ import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.liquids.LiquidTank; import net.minecraftforge.liquids.LiquidTank;
public class TileEntityPipe extends TileEntity implements ITankContainer, IReadOut, IPipe public class TileEntityPipe extends TileEntity implements ITankContainer, IReadOut, IColorCoded
{ {
private ColorCode color = ColorCode.NONE; private ColorCode color = ColorCode.NONE;
@ -296,9 +295,9 @@ public class TileEntityPipe extends TileEntity implements ITankContainer, IReadO
connectedBlocks[i] = null; connectedBlocks[i] = null;
} }
} }
else if (ent instanceof IPressure) else if (ent instanceof IPsiCreator)
{ {
if (!((IPressure) ent).canPressureToo(color.getLiquidData(), dir)) if (!((IPsiCreator) ent).getCanPressureTo(color.getLiquidData(), dir))
{ {
connectedBlocks[i] = null; connectedBlocks[i] = null;
} }
@ -329,10 +328,10 @@ public class TileEntityPipe extends TileEntity implements ITankContainer, IReadO
highestPressure = ((TileEntityPipe) connectedBlocks[i]).getPressure(); highestPressure = ((TileEntityPipe) connectedBlocks[i]).getPressure();
} }
} }
if (connectedBlocks[i] instanceof IPressure && ((IPressure) connectedBlocks[i]).canPressureToo(color.getLiquidData(), dir)) if (connectedBlocks[i] instanceof IPsiCreator && ((IPsiCreator) connectedBlocks[i]).getCanPressureTo(color.getLiquidData(), dir))
{ {
int p = ((IPressure) connectedBlocks[i]).presureOutput(color.getLiquidData(), dir); int p = ((IPsiCreator) connectedBlocks[i]).getPressureOut(color.getLiquidData(), dir);
if (p > highestPressure) if (p > highestPressure)
highestPressure = p; highestPressure = p;
} }

View file

@ -2,7 +2,7 @@ package fluidmech.common.tileentity;
import hydraulic.core.helpers.MetaGroup; import hydraulic.core.helpers.MetaGroup;
import hydraulic.core.implement.ColorCode; import hydraulic.core.implement.ColorCode;
import hydraulic.core.implement.IPressure; import hydraulic.core.implement.IPsiCreator;
import hydraulic.core.implement.IReadOut; import hydraulic.core.implement.IReadOut;
import hydraulic.core.liquids.LiquidData; import hydraulic.core.liquids.LiquidData;
import hydraulic.core.liquids.LiquidHandler; import hydraulic.core.liquids.LiquidHandler;
@ -30,7 +30,7 @@ import com.google.common.io.ByteArrayDataInput;
import fluidmech.common.FluidMech; import fluidmech.common.FluidMech;
public class TileEntityPump extends TileEntityElectricityReceiver implements IPacketReceiver, IReadOut, IPressure public class TileEntityPump extends TileEntityElectricityReceiver implements IPacketReceiver, IReadOut, IPsiCreator
{ {
public final double WATTS_PER_TICK = (400/20); public final double WATTS_PER_TICK = (400/20);
double percentPumped = 0.0; double percentPumped = 0.0;
@ -246,7 +246,7 @@ public class TileEntityPump extends TileEntityElectricityReceiver implements IPa
} }
@Override @Override
public int presureOutput(LiquidData type, ForgeDirection dir) public int getPressureOut(LiquidData type, ForgeDirection dir)
{ {
if (type == this.color.getLiquidData() || type == LiquidHandler.unkown) if (type == this.color.getLiquidData() || type == LiquidHandler.unkown)
return this.color.getLiquidData().getPressure(); return this.color.getLiquidData().getPressure();
@ -254,7 +254,7 @@ public class TileEntityPump extends TileEntityElectricityReceiver implements IPa
} }
@Override @Override
public boolean canPressureToo(LiquidData type, ForgeDirection dir) public boolean getCanPressureTo(LiquidData type, ForgeDirection dir)
{ {
if (dir == this.side.getOpposite() && (type == this.color.getLiquidData() || type == LiquidHandler.unkown)) { return true; } if (dir == this.side.getOpposite() && (type == this.color.getLiquidData() || type == LiquidHandler.unkown)) { return true; }
return false; return false;

View file

@ -3,7 +3,7 @@ package fluidmech.common.tileentity;
import hydraulic.core.helpers.connectionHelper; import hydraulic.core.helpers.connectionHelper;
import hydraulic.core.implement.ColorCode; import hydraulic.core.implement.ColorCode;
import hydraulic.core.implement.IColorCoded; import hydraulic.core.implement.IColorCoded;
import hydraulic.core.implement.IPressure; import hydraulic.core.implement.IPsiCreator;
import hydraulic.core.implement.IReadOut; import hydraulic.core.implement.IReadOut;
import hydraulic.core.liquids.LiquidData; import hydraulic.core.liquids.LiquidData;
import hydraulic.core.liquids.LiquidHandler; import hydraulic.core.liquids.LiquidHandler;
@ -24,7 +24,7 @@ import net.minecraftforge.liquids.ITankContainer;
import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.liquids.LiquidStack;
import universalelectricity.prefab.implement.IRedstoneReceptor; import universalelectricity.prefab.implement.IRedstoneReceptor;
public class TileEntityReleaseValve extends TileEntity implements IPressure, IReadOut, IRedstoneReceptor, IInventory public class TileEntityReleaseValve extends TileEntity implements IPsiCreator, IReadOut, IRedstoneReceptor, IInventory
{ {
public boolean[] allowed = new boolean[ColorCode.values().length - 1]; public boolean[] allowed = new boolean[ColorCode.values().length - 1];
public TileEntity[] connected = new TileEntity[6]; public TileEntity[] connected = new TileEntity[6];
@ -198,7 +198,7 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe
} }
@Override @Override
public int presureOutput(LiquidData type, ForgeDirection dir) public int getPressureOut(LiquidData type, ForgeDirection dir)
{ {
if (type == null) return 0; if (type == null) return 0;
if (this.canConnect(type.getColor())) { return type.getPressure(); } if (this.canConnect(type.getColor())) { return type.getPressure(); }
@ -206,7 +206,7 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe
} }
@Override @Override
public boolean canPressureToo(LiquidData type, ForgeDirection dir) public boolean getCanPressureTo(LiquidData type, ForgeDirection dir)
{ {
if (type == null) return false; if (type == null) return false;
if (this.canConnect(type.getColor())) return true; if (this.canConnect(type.getColor())) return true;

View file

@ -3,7 +3,7 @@ package fluidmech.common.tileentity;
import hydraulic.core.helpers.connectionHelper; import hydraulic.core.helpers.connectionHelper;
import hydraulic.core.implement.ColorCode; import hydraulic.core.implement.ColorCode;
import hydraulic.core.implement.IColorCoded; import hydraulic.core.implement.IColorCoded;
import hydraulic.core.implement.IPressure; import hydraulic.core.implement.IPsiCreator;
import hydraulic.core.implement.IReadOut; import hydraulic.core.implement.IReadOut;
import hydraulic.core.liquids.LiquidData; import hydraulic.core.liquids.LiquidData;
import hydraulic.core.liquids.LiquidHandler; import hydraulic.core.liquids.LiquidHandler;
@ -28,7 +28,7 @@ import com.google.common.io.ByteArrayDataInput;
import fluidmech.common.FluidMech; import fluidmech.common.FluidMech;
import fluidmech.common.handlers.UpdateConverter; import fluidmech.common.handlers.UpdateConverter;
public class TileEntityTank extends TileEntity implements IPacketReceiver, IReadOut, IPressure, ITankContainer, IColorCoded public class TileEntityTank extends TileEntity implements IPacketReceiver, IReadOut, IPsiCreator, ITankContainer, IColorCoded
{ {
public TileEntity[] cc = { null, null, null, null, null, null }; public TileEntity[] cc = { null, null, null, null, null, null };
@ -188,7 +188,7 @@ public class TileEntityTank extends TileEntity implements IPacketReceiver, IRead
} }
@Override @Override
public int presureOutput(LiquidData type, ForgeDirection dir) public int getPressureOut(LiquidData type, ForgeDirection dir)
{ {
if (type == color.getLiquidData() || type == LiquidHandler.unkown) if (type == color.getLiquidData() || type == LiquidHandler.unkown)
{ {
@ -201,7 +201,7 @@ public class TileEntityTank extends TileEntity implements IPacketReceiver, IRead
} }
@Override @Override
public boolean canPressureToo(LiquidData type, ForgeDirection dir) public boolean getCanPressureTo(LiquidData type, ForgeDirection dir)
{ {
if (type == color.getLiquidData() || type == LiquidHandler.unkown) if (type == color.getLiquidData() || type == LiquidHandler.unkown)
{ {

View file

@ -1,6 +0,0 @@
package hydraulic.core.implement;
public interface IPipe extends IColorCoded
{
}

View file

@ -1,23 +0,0 @@
package hydraulic.core.implement;
import hydraulic.core.liquids.LiquidData;
import net.minecraftforge.common.ForgeDirection;
public interface IPressure
{
/**
* @param type - Liquid type
* @param dir - direction pressure is being request to output
* @return pressure if can output for the type or direction
*/
public int presureOutput(LiquidData type, ForgeDirection dir);
/**
* Quick way to check if the TE will output pressure
*
* @param type - Liquid type
* @param dir - direction
* @return
*/
public boolean canPressureToo(LiquidData type, ForgeDirection dir);
}

View file

@ -0,0 +1,17 @@
package hydraulic.core.implement;
import hydraulic.core.liquids.LiquidData;
import net.minecraftforge.common.ForgeDirection;
public interface IPsiCreator
{
/**
* gets the PressureOutput of a device
*/
public int getPressureOut(LiquidData type, ForgeDirection dir);
/**
* Quick way to check if the TE will output pressure
*/
public boolean getCanPressureTo(LiquidData type, ForgeDirection dir);
}

View file

@ -0,0 +1,12 @@
package hydraulic.core.implement;
import net.minecraftforge.common.ForgeDirection;
public interface IPsiReceiver
{
/**
* gets the devices pressure from a given side
*/
public int getInputPressure(ForgeDirection side);
}