Cleanup
This commit is contained in:
parent
2779c99783
commit
69abbd43f3
11 changed files with 49 additions and 86 deletions
|
@ -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");
|
||||
}
|
||||
}
|
|
@ -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");
|
||||
}
|
||||
}
|
|
@ -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");
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
package hydraulic.core.implement;
|
||||
|
||||
public interface IPipe extends IColorCoded
|
||||
{
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
17
src/minecraft/hydraulic/core/implement/IPsiCreator.java
Normal file
17
src/minecraft/hydraulic/core/implement/IPsiCreator.java
Normal 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);
|
||||
}
|
12
src/minecraft/hydraulic/core/implement/IPsiReceiver.java
Normal file
12
src/minecraft/hydraulic/core/implement/IPsiReceiver.java
Normal 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);
|
||||
|
||||
}
|
Loading…
Reference in a new issue