Created BlockOre helpers to make recipes more readable.
These works the same as the ItemParts helpers from e00ba942f8
This commit is contained in:
parent
e00ba942f8
commit
b950105578
1 changed files with 18 additions and 3 deletions
|
@ -4,9 +4,6 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
|
||||
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -21,9 +18,27 @@ import techreborn.client.TechRebornCreativeTabMisc;
|
|||
import techreborn.init.ModItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class BlockOre extends Block {
|
||||
|
||||
public static ItemStack getOreByName(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(ModBlocks.ore, count, index);
|
||||
}
|
||||
|
||||
public static ItemStack getOreByName(String name)
|
||||
{
|
||||
return getOreByName(name, 1);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "Galena", "Iridium", "Ruby", "Sapphire", "Bauxite", "Pyrite", "Cinnabar",
|
||||
"Sphalerite", "Tungston", "Sheldonite", "Peridot", "Sodalite",
|
||||
|
|
Loading…
Reference in a new issue