registered Atomic Science's nuke gas
This commit is contained in:
parent
b9c91738ba
commit
28a5429c2c
1 changed files with 176 additions and 151 deletions
|
@ -55,7 +55,11 @@ public class LiquidHandler
|
|||
@ForgeSubscribe
|
||||
public void liquidRegisterEvent(LiquidDictionary.LiquidRegisterEvent event)
|
||||
{
|
||||
if (event.Name.equalsIgnoreCase("methane"))
|
||||
if (event.Name.equalsIgnoreCase("UraniumHexafluoride"))
|
||||
{
|
||||
allowedLiquids.add(new LiquidData("UraniumHexafluoride", event.Liquid, ColorCode.GREEN, true, 100));
|
||||
}
|
||||
else if (event.Name.equalsIgnoreCase("methane"))
|
||||
{
|
||||
allowedLiquids.add(new LiquidData("methane", event.Liquid, ColorCode.LIME, true, 100));
|
||||
}
|
||||
|
@ -87,14 +91,16 @@ public class LiquidHandler
|
|||
/**
|
||||
* Gets the LiquidData linked to the liquid by name
|
||||
*
|
||||
* @param name
|
||||
* - String name, not case sensitive
|
||||
* @param name - String name, not case sensitive
|
||||
*/
|
||||
public static LiquidData get(String name)
|
||||
{
|
||||
for (LiquidData data : LiquidHandler.allowedLiquids)
|
||||
{
|
||||
if (data.getName().equalsIgnoreCase(name)) { return data; }
|
||||
if (data.getName().equalsIgnoreCase(name))
|
||||
{
|
||||
return data;
|
||||
}
|
||||
}
|
||||
return unkown;
|
||||
}
|
||||
|
@ -103,14 +109,17 @@ public class LiquidHandler
|
|||
{
|
||||
for (LiquidData data : LiquidHandler.allowedLiquids)
|
||||
{
|
||||
if (stack.isLiquidEqual(data.getStack())) { return data; }
|
||||
if (stack.isLiquidEqual(data.getStack()))
|
||||
{
|
||||
return data;
|
||||
}
|
||||
}
|
||||
return unkown;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the name of the liquidStack using either LiquidData or running threw
|
||||
* the LiquidDirectory mapping
|
||||
* gets the name of the liquidStack using either LiquidData or running threw the LiquidDirectory
|
||||
* mapping
|
||||
*/
|
||||
public static String getName(LiquidStack stack)
|
||||
{
|
||||
|
@ -123,7 +132,10 @@ public class LiquidHandler
|
|||
Map<String, LiquidStack> l = LiquidDictionary.getLiquids();
|
||||
for (Entry<String, LiquidStack> liquid : l.entrySet())
|
||||
{
|
||||
if (liquid.getValue().isLiquidEqual(stack)) { return liquid.getKey(); }
|
||||
if (liquid.getValue().isLiquidEqual(stack))
|
||||
{
|
||||
return liquid.getKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
return "unkown";
|
||||
|
@ -134,7 +146,8 @@ public class LiquidHandler
|
|||
*/
|
||||
public static LiquidStack getStack(LiquidData type, int vol)
|
||||
{
|
||||
if (type == null) return null;
|
||||
if (type == null)
|
||||
return null;
|
||||
return new LiquidStack(type.getStack().itemID, vol, type.getStack().itemMeta);
|
||||
}
|
||||
|
||||
|
@ -143,13 +156,19 @@ public class LiquidHandler
|
|||
*/
|
||||
public static LiquidStack getStack(LiquidStack stack, int vol)
|
||||
{
|
||||
if (stack == null) { return null; }
|
||||
if (stack == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new LiquidStack(stack.itemID, vol, stack.itemMeta);
|
||||
}
|
||||
|
||||
public static int getMeta(LiquidData stack)
|
||||
{
|
||||
if (stack != null && stack != unkown) { return stack.getColor().ordinal(); }
|
||||
if (stack != null && stack != unkown)
|
||||
{
|
||||
return stack.getColor().ordinal();
|
||||
}
|
||||
return 15;
|
||||
}
|
||||
|
||||
|
@ -162,10 +181,14 @@ public class LiquidHandler
|
|||
{
|
||||
for (LiquidData data : allowedLiquids)
|
||||
{
|
||||
if (data.getStack().itemID == id) { return data; }
|
||||
if (data.getStack().itemID == id)
|
||||
{
|
||||
return data;
|
||||
}
|
||||
}
|
||||
return unkown;
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumes one item of a the ItemStack
|
||||
*/
|
||||
|
@ -173,8 +196,10 @@ public class LiquidHandler
|
|||
{
|
||||
if (stack.stackSize == 1)
|
||||
{
|
||||
if (stack.getItem().hasContainerItem()) return stack.getItem().getContainerItemStack(stack);
|
||||
else return null;
|
||||
if (stack.getItem().hasContainerItem())
|
||||
return stack.getItem().getContainerItemStack(stack);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue