2015-04-17 00:42:05 +02:00
|
|
|
package techreborn.items;
|
|
|
|
|
2016-03-25 10:47:34 +01:00
|
|
|
|
2015-04-17 00:42:05 +02:00
|
|
|
import net.minecraft.item.ItemStack;
|
2015-07-25 17:37:11 +02:00
|
|
|
import net.minecraftforge.fluids.Fluid;
|
|
|
|
import net.minecraftforge.fluids.FluidRegistry;
|
2016-05-23 19:26:21 +02:00
|
|
|
import org.apache.commons.lang3.Validate;
|
|
|
|
import reborncore.common.util.StringUtils;
|
2015-06-07 06:36:37 +02:00
|
|
|
import techreborn.init.ModItems;
|
2015-04-17 00:42:05 +02:00
|
|
|
|
2016-05-23 19:26:21 +02:00
|
|
|
public class ItemCells
|
2016-03-25 10:47:34 +01:00
|
|
|
{
|
|
|
|
|
2016-05-23 19:26:21 +02:00
|
|
|
@Deprecated
|
2016-03-25 10:47:34 +01:00
|
|
|
public static final String[] types = new String[] { "Berylium", "biomass", "calciumCarbonate", "calcium", "carbon",
|
|
|
|
"chlorine", "deuterium", "diesel", "ethanol", "glyceryl", "helium3", "helium", "heliumPlasma", "hydrogen",
|
|
|
|
"ice", "lithium", "mercury", "methane", "nitrocarbon", "nitroCoalfuel", "nitroDiesel", "nitrogen",
|
|
|
|
"nitrogenDioxide", "oil", "potassium", "seedOil", "silicon", "sodium", "sodiumPersulfate", "sodiumSulfide",
|
|
|
|
"sulfur", "sulfuricAcid", "tritium", "wolframium", "empty", "lava", "water" };
|
|
|
|
|
|
|
|
|
2016-05-23 19:26:21 +02:00
|
|
|
@Deprecated
|
|
|
|
public static ItemStack getCellByName(String name, int count, boolean lookForIC2)
|
2016-03-25 10:47:34 +01:00
|
|
|
{
|
2016-05-23 19:26:21 +02:00
|
|
|
return getCellByName(name, count);
|
2016-03-25 10:47:34 +01:00
|
|
|
}
|
|
|
|
|
2016-05-23 19:26:21 +02:00
|
|
|
public static ItemStack getCellByName(String name, int count)
|
2016-03-25 10:47:34 +01:00
|
|
|
{
|
2016-05-23 19:26:21 +02:00
|
|
|
if(name.equalsIgnoreCase("empty") || name.equalsIgnoreCase("cell")){
|
|
|
|
return new ItemStack(ModItems.emptyCell, count);
|
|
|
|
}
|
2016-03-25 10:47:34 +01:00
|
|
|
Fluid fluid = FluidRegistry.getFluid("fluid" + name.toLowerCase());
|
2016-05-23 19:26:21 +02:00
|
|
|
if(fluid == null) {
|
|
|
|
fluid = FluidRegistry.getFluid(name.toLowerCase());
|
|
|
|
if(fluid == null) {
|
|
|
|
fluid = FluidRegistry.getFluid("fluid" + StringUtils.toFirstCapital(name.toLowerCase()));
|
2016-03-25 10:47:34 +01:00
|
|
|
}
|
|
|
|
}
|
2016-05-23 19:26:21 +02:00
|
|
|
Validate.notNull(fluid, "The fluid " + name + " could not be found");
|
|
|
|
return DynamicCell.getCellWithFluid(fluid, count);
|
2016-03-25 10:47:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static ItemStack getCellByName(String name)
|
|
|
|
{
|
|
|
|
return getCellByName(name, 1);
|
|
|
|
}
|
|
|
|
|
2015-04-17 00:42:05 +02:00
|
|
|
}
|