resonant-induction/minecraft/liquidmechanics/common/handlers/LiquidData.java
Rseifert a3c43609ea Got rid of Enum system
What i have is not much diffrent but its a start to allowing more liquid
types without having to add them myself. The current method has 3
defualt liquids that are preset. The new system also uses String names
to ID liquid instead of Enums. A new class Called LiquidData will keep
track of the data need to ID, and use the Liquids.

In the process i also fixed a few crafting recipes that were
removed/messed up in a patch a while back.

Plan for new system
*Have default liquid type that come with textures/renders
*Have several univeral pipes that can accept all Liquid types
*Have a way of placeing a universal pipe and then converting to a
regulated pipe, pipe that only take one liquid type
*Have a tool for doing the above
*Change the release Valve to be univeral with a GUI to restrict flow and
Liquid type extracted
2013-01-03 12:18:47 -05:00

40 lines
1 KiB
Java

package liquidmechanics.common.handlers;
import net.minecraftforge.liquids.LiquidStack;
public class LiquidData
{
private boolean isAGas;
private int defaultPresure;
private LiquidStack sampleStack;
private String name;
public LiquidData(String name, LiquidStack stack, boolean gas, int dPressure)
{
this.sampleStack = stack;
this.isAGas = gas;
this.defaultPresure = dPressure;
this.name = name;
}
public static String getName(LiquidData type)
{
if (type != null) { return type.name; }
return "unknown";
}
public static int getPressure(LiquidData type)
{
if (type != null) { return type.defaultPresure; }
return 0;
}
public static LiquidStack getStack(LiquidData type)
{
if (type != null) { return type.sampleStack; }
return new LiquidStack(0,1);
}
public static boolean getCanFloat(LiquidData type)
{
if (type != null) { return type.isAGas; }
return false;
}
}