Added helpers for the rest of the item types
This commit is contained in:
parent
b950105578
commit
9fa01eaee2
11 changed files with 208 additions and 3 deletions
|
@ -8,8 +8,26 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemCells extends ItemTR {
|
||||
public static ItemStack getCellByName(String name, int count)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.cells, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getCellByName(String name)
|
||||
{
|
||||
return getCellByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "Berylium", "biomass", "calciumCarbonate", "calcium", "carbon",
|
||||
"chlorine", "deuterium", "diesel", "ethanol", "glyceryl",
|
||||
|
|
|
@ -8,8 +8,26 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemCrushedOre extends Item {
|
||||
public static ItemStack getCrushedOreByName(String name, int count)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.crushedOre, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getCrushedOreByName(String name)
|
||||
{
|
||||
return getCrushedOreByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "Aluminum", "Ardite", "Bauxite", "Cadmium", "Cinnabar", "Cobalt", "DarkIron",
|
||||
"Indium", "Iridium", "Nickel", "Osmium", "Platinum",
|
||||
|
|
|
@ -8,8 +8,27 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemDustTiny extends ItemTR {
|
||||
|
||||
public static ItemStack getTinyDustByName(String name, int count)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.tinyDusts, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getTinyDustByName(String name)
|
||||
{
|
||||
return getTinyDustByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "Almandine", "AluminumBrass", "Aluminum", "Alumite", "Andradite",
|
||||
"Antimony", "Ardite", "Ashes", "Basalt", "Bauxite", "Biotite",
|
||||
|
|
|
@ -8,8 +8,26 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemDusts extends ItemTR {
|
||||
public static ItemStack getDustByName(String name, int count)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.dusts, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getDustByName(String name)
|
||||
{
|
||||
return getDustByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "almandine", "aluminumBrass", "aluminum", "alumite", "andradite",
|
||||
"antimony", "ardite", "ashes", "basalt", "bauxite", "biotite",
|
||||
|
|
|
@ -8,8 +8,27 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemDustsSmall extends ItemTR {
|
||||
|
||||
public static ItemStack getSmallDustByName(String name, int count)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.smallDusts, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getSmallDustByName(String name)
|
||||
{
|
||||
return getSmallDustByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "Almandine", "AluminumBrass", "Aluminum", "Alumite", "Andradite",
|
||||
"Antimony", "Ardite", "Ashes", "Basalt", "Bauxite", "Biotite",
|
||||
|
|
|
@ -8,8 +8,27 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemGems extends Item {
|
||||
|
||||
public static ItemStack getGemByName(String name, int count)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.gems, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getGemByName(String name)
|
||||
{
|
||||
return getGemByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "ruby", "sapphire", "peridot", "redGarnet",
|
||||
"yellowGarnet" };
|
||||
|
|
|
@ -8,8 +8,26 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemIngots extends Item {
|
||||
public static ItemStack getIngotByName(String name, int count)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.ingots, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getIngotByName(String name)
|
||||
{
|
||||
return getIngotByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "aluminum", "antimony", "batteryAlloy", "redAlloy", "blueAlloy", "brass",
|
||||
"bronze", "cadmium", "chrome", "copper", "cupronickel", "electrum", "indium",
|
||||
|
|
|
@ -8,8 +8,27 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemNuggets extends Item {
|
||||
|
||||
public static ItemStack getNuggetByName(String name, int count)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.nuggets, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getNuggetByName(String name)
|
||||
{
|
||||
return getNuggetByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "aluminum", "antimony", "brass", "bronze", "chrome", "copper",
|
||||
"electrum", "invar", "iridium", "iron", "lead",
|
||||
|
|
|
@ -8,8 +8,27 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemPlates extends ItemTR {
|
||||
|
||||
public static ItemStack getPlateByName(String name, int count)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.plate, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getPlateByName(String name)
|
||||
{
|
||||
return getPlateByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "aluminum", "batteryAlloy", "brass", "bronze", "carbon",
|
||||
"chrome", "copper", "diamond", "electrum", "emerald",
|
||||
|
|
|
@ -8,8 +8,27 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemPurifiedCrushedOre extends Item {
|
||||
|
||||
public static ItemStack getPurifiedCrushedOreByName(String name, int count)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.purifiedCrushedOre, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getPurifiedCrushedOreByName(String name)
|
||||
{
|
||||
return getPurifiedCrushedOreByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "Aluminum", "Ardite", "Bauxite", "Cadmium", "Cinnabar", "Cobalt", "DarkIron",
|
||||
"Indium", "Iridium", "Nickel", "Osmium", "Platinum", "Pyrite", "Sphalerite",
|
||||
|
|
|
@ -8,8 +8,27 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class ItemRods extends Item {
|
||||
|
||||
public static ItemStack getRodByName(String name, int count)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.rods, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getRodByName(String name)
|
||||
{
|
||||
return getRodByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "brass", "bronze", "copper", "electrum", "gold", "invar",
|
||||
"iridium", "iron", "lead", "nickel", "platinum",
|
||||
|
|
Loading…
Add table
Reference in a new issue