Created ItemParts helpers to make recipes more readable.
This makes recipes easier to both write and understand, because I don't have to wonder what ModItems.parts #8 is, I can just see "dataOrb."
This commit is contained in:
parent
31bf279afe
commit
e00ba942f8
1 changed files with 18 additions and 0 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 ItemParts extends Item {
|
||||
public static ItemStack getPartByName(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.parts, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getPartByName(String name)
|
||||
{
|
||||
return getPartByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "advancedCircuitParts", "basicCircuitBoard", "advancedCircuitBoard", "processorCircuitBoard",
|
||||
"energyFlowCircuit", "dataControlCircuit", "dataOrb", "dataStorageCircuit",
|
||||
|
|
Loading…
Reference in a new issue