diff --git a/src/main/java/techreborn/blocks/BlockOre.java b/src/main/java/techreborn/blocks/BlockOre.java index 8c85ecf31..ef7828bfd 100644 --- a/src/main/java/techreborn/blocks/BlockOre.java +++ b/src/main/java/techreborn/blocks/BlockOre.java @@ -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",