From 69abbd43f318fdc9eb5321028626bc44840d984b Mon Sep 17 00:00:00 2001 From: Rseifert Date: Wed, 20 Feb 2013 13:44:38 -0500 Subject: [PATCH] Cleanup --- .../common/block/liquids/BlockMilk.java | 12 ---------- .../common/block/liquids/BlockOil.java | 12 ---------- .../common/block/liquids/BlockOilFlowing.java | 12 ---------- .../common/tileentity/TileEntityPipe.java | 17 +++++++------- .../common/tileentity/TileEntityPump.java | 8 +++---- .../tileentity/TileEntityReleaseValve.java | 8 +++---- .../common/tileentity/TileEntityTank.java | 8 +++---- .../hydraulic/core/implement/IPipe.java | 6 ----- .../hydraulic/core/implement/IPressure.java | 23 ------------------- .../hydraulic/core/implement/IPsiCreator.java | 17 ++++++++++++++ .../core/implement/IPsiReceiver.java | 12 ++++++++++ 11 files changed, 49 insertions(+), 86 deletions(-) delete mode 100644 src/minecraft/fluidmech/common/block/liquids/BlockMilk.java delete mode 100644 src/minecraft/fluidmech/common/block/liquids/BlockOil.java delete mode 100644 src/minecraft/fluidmech/common/block/liquids/BlockOilFlowing.java delete mode 100644 src/minecraft/hydraulic/core/implement/IPipe.java delete mode 100644 src/minecraft/hydraulic/core/implement/IPressure.java create mode 100644 src/minecraft/hydraulic/core/implement/IPsiCreator.java create mode 100644 src/minecraft/hydraulic/core/implement/IPsiReceiver.java diff --git a/src/minecraft/fluidmech/common/block/liquids/BlockMilk.java b/src/minecraft/fluidmech/common/block/liquids/BlockMilk.java deleted file mode 100644 index 66d429d17..000000000 --- a/src/minecraft/fluidmech/common/block/liquids/BlockMilk.java +++ /dev/null @@ -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"); - } -} diff --git a/src/minecraft/fluidmech/common/block/liquids/BlockOil.java b/src/minecraft/fluidmech/common/block/liquids/BlockOil.java deleted file mode 100644 index e19ddea04..000000000 --- a/src/minecraft/fluidmech/common/block/liquids/BlockOil.java +++ /dev/null @@ -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"); - } -} diff --git a/src/minecraft/fluidmech/common/block/liquids/BlockOilFlowing.java b/src/minecraft/fluidmech/common/block/liquids/BlockOilFlowing.java deleted file mode 100644 index 7da978813..000000000 --- a/src/minecraft/fluidmech/common/block/liquids/BlockOilFlowing.java +++ /dev/null @@ -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"); - } -} diff --git a/src/minecraft/fluidmech/common/tileentity/TileEntityPipe.java b/src/minecraft/fluidmech/common/tileentity/TileEntityPipe.java index 706554520..f306079cb 100644 --- a/src/minecraft/fluidmech/common/tileentity/TileEntityPipe.java +++ b/src/minecraft/fluidmech/common/tileentity/TileEntityPipe.java @@ -1,16 +1,15 @@ package fluidmech.common.tileentity; +import fluidmech.common.handlers.UpdateConverter; import hydraulic.core.helpers.connectionHelper; import hydraulic.core.implement.ColorCode; -import hydraulic.core.implement.IPipe; -import hydraulic.core.implement.IPressure; +import hydraulic.core.implement.IColorCoded; +import hydraulic.core.implement.IPsiCreator; import hydraulic.core.implement.IReadOut; import hydraulic.core.liquids.LiquidHandler; import java.util.Random; -import fluidmech.common.handlers.UpdateConverter; - import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -22,7 +21,7 @@ import net.minecraftforge.liquids.LiquidContainerRegistry; import net.minecraftforge.liquids.LiquidStack; 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; @@ -296,9 +295,9 @@ public class TileEntityPipe extends TileEntity implements ITankContainer, IReadO 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; } @@ -329,10 +328,10 @@ public class TileEntityPipe extends TileEntity implements ITankContainer, IReadO 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) highestPressure = p; } diff --git a/src/minecraft/fluidmech/common/tileentity/TileEntityPump.java b/src/minecraft/fluidmech/common/tileentity/TileEntityPump.java index bb3c6ddc5..3f0694262 100644 --- a/src/minecraft/fluidmech/common/tileentity/TileEntityPump.java +++ b/src/minecraft/fluidmech/common/tileentity/TileEntityPump.java @@ -2,7 +2,7 @@ package fluidmech.common.tileentity; import hydraulic.core.helpers.MetaGroup; import hydraulic.core.implement.ColorCode; -import hydraulic.core.implement.IPressure; +import hydraulic.core.implement.IPsiCreator; import hydraulic.core.implement.IReadOut; import hydraulic.core.liquids.LiquidData; import hydraulic.core.liquids.LiquidHandler; @@ -30,7 +30,7 @@ import com.google.common.io.ByteArrayDataInput; 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); double percentPumped = 0.0; @@ -246,7 +246,7 @@ public class TileEntityPump extends TileEntityElectricityReceiver implements IPa } @Override - public int presureOutput(LiquidData type, ForgeDirection dir) + public int getPressureOut(LiquidData type, ForgeDirection dir) { if (type == this.color.getLiquidData() || type == LiquidHandler.unkown) return this.color.getLiquidData().getPressure(); @@ -254,7 +254,7 @@ public class TileEntityPump extends TileEntityElectricityReceiver implements IPa } @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; } return false; diff --git a/src/minecraft/fluidmech/common/tileentity/TileEntityReleaseValve.java b/src/minecraft/fluidmech/common/tileentity/TileEntityReleaseValve.java index c49a3450a..ee7d2e0df 100644 --- a/src/minecraft/fluidmech/common/tileentity/TileEntityReleaseValve.java +++ b/src/minecraft/fluidmech/common/tileentity/TileEntityReleaseValve.java @@ -3,7 +3,7 @@ package fluidmech.common.tileentity; import hydraulic.core.helpers.connectionHelper; import hydraulic.core.implement.ColorCode; import hydraulic.core.implement.IColorCoded; -import hydraulic.core.implement.IPressure; +import hydraulic.core.implement.IPsiCreator; import hydraulic.core.implement.IReadOut; import hydraulic.core.liquids.LiquidData; import hydraulic.core.liquids.LiquidHandler; @@ -24,7 +24,7 @@ import net.minecraftforge.liquids.ITankContainer; import net.minecraftforge.liquids.LiquidStack; 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 TileEntity[] connected = new TileEntity[6]; @@ -198,7 +198,7 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe } @Override - public int presureOutput(LiquidData type, ForgeDirection dir) + public int getPressureOut(LiquidData type, ForgeDirection dir) { if (type == null) return 0; if (this.canConnect(type.getColor())) { return type.getPressure(); } @@ -206,7 +206,7 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe } @Override - public boolean canPressureToo(LiquidData type, ForgeDirection dir) + public boolean getCanPressureTo(LiquidData type, ForgeDirection dir) { if (type == null) return false; if (this.canConnect(type.getColor())) return true; diff --git a/src/minecraft/fluidmech/common/tileentity/TileEntityTank.java b/src/minecraft/fluidmech/common/tileentity/TileEntityTank.java index 7d2ee5a3d..5ff331d32 100644 --- a/src/minecraft/fluidmech/common/tileentity/TileEntityTank.java +++ b/src/minecraft/fluidmech/common/tileentity/TileEntityTank.java @@ -3,7 +3,7 @@ package fluidmech.common.tileentity; import hydraulic.core.helpers.connectionHelper; import hydraulic.core.implement.ColorCode; import hydraulic.core.implement.IColorCoded; -import hydraulic.core.implement.IPressure; +import hydraulic.core.implement.IPsiCreator; import hydraulic.core.implement.IReadOut; import hydraulic.core.liquids.LiquidData; import hydraulic.core.liquids.LiquidHandler; @@ -28,7 +28,7 @@ import com.google.common.io.ByteArrayDataInput; import fluidmech.common.FluidMech; 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 }; @@ -188,7 +188,7 @@ public class TileEntityTank extends TileEntity implements IPacketReceiver, IRead } @Override - public int presureOutput(LiquidData type, ForgeDirection dir) + public int getPressureOut(LiquidData type, ForgeDirection dir) { if (type == color.getLiquidData() || type == LiquidHandler.unkown) { @@ -201,7 +201,7 @@ public class TileEntityTank extends TileEntity implements IPacketReceiver, IRead } @Override - public boolean canPressureToo(LiquidData type, ForgeDirection dir) + public boolean getCanPressureTo(LiquidData type, ForgeDirection dir) { if (type == color.getLiquidData() || type == LiquidHandler.unkown) { diff --git a/src/minecraft/hydraulic/core/implement/IPipe.java b/src/minecraft/hydraulic/core/implement/IPipe.java deleted file mode 100644 index 8e62ff70b..000000000 --- a/src/minecraft/hydraulic/core/implement/IPipe.java +++ /dev/null @@ -1,6 +0,0 @@ -package hydraulic.core.implement; - -public interface IPipe extends IColorCoded -{ - -} diff --git a/src/minecraft/hydraulic/core/implement/IPressure.java b/src/minecraft/hydraulic/core/implement/IPressure.java deleted file mode 100644 index d9b2b25a3..000000000 --- a/src/minecraft/hydraulic/core/implement/IPressure.java +++ /dev/null @@ -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); -} diff --git a/src/minecraft/hydraulic/core/implement/IPsiCreator.java b/src/minecraft/hydraulic/core/implement/IPsiCreator.java new file mode 100644 index 000000000..1badce48f --- /dev/null +++ b/src/minecraft/hydraulic/core/implement/IPsiCreator.java @@ -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); +} diff --git a/src/minecraft/hydraulic/core/implement/IPsiReceiver.java b/src/minecraft/hydraulic/core/implement/IPsiReceiver.java new file mode 100644 index 000000000..4394255a7 --- /dev/null +++ b/src/minecraft/hydraulic/core/implement/IPsiReceiver.java @@ -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); + +}