30c461bbea
Still working on converting to a more universal liquid system. *Added a enum to tack colors without having to use strings or #s *Fixed LiquidData to not need to feed a LiquidData to get vars of itself *Started Converting Pipes to new system. They will use metadata now to select colors, this will remove any need to use packets. *Created a Update Converter so that older version pipe/tank/etc will be converted to the new system automaticly Issues with push *Just about everything is broken at the moment just backing code up
47 lines
1.1 KiB
Java
47 lines
1.1 KiB
Java
package liquidmechanics.common.handlers;
|
|
|
|
import liquidmechanics.api.helpers.Colors;
|
|
import net.minecraftforge.liquids.LiquidStack;
|
|
|
|
public class LiquidData
|
|
{
|
|
private boolean isAGas;
|
|
private int defaultPressure;
|
|
private LiquidStack sampleStack;
|
|
private String name;
|
|
private Colors color;
|
|
|
|
public LiquidData(String name, LiquidStack stack,Colors color, boolean gas, int dPressure)
|
|
{
|
|
this.sampleStack = stack;
|
|
this.isAGas = gas;
|
|
this.defaultPressure = dPressure;
|
|
this.name = name;
|
|
this.color = color;
|
|
}
|
|
|
|
public String getName()
|
|
{
|
|
if (name != null || !name.equalsIgnoreCase("")) { return name; }
|
|
return "unknown";
|
|
}
|
|
public int getPressure()
|
|
{
|
|
return defaultPressure;
|
|
}
|
|
public LiquidStack getStack()
|
|
{
|
|
if (sampleStack != null) { return sampleStack; }
|
|
return new LiquidStack(0,1);
|
|
}
|
|
public boolean getCanFloat()
|
|
{
|
|
return isAGas;
|
|
}
|
|
public Colors getColor()
|
|
{
|
|
if (color != null) { return color; }
|
|
return Colors.NONE;
|
|
}
|
|
|
|
}
|