From b9501055788e84a2d0e6153c55bdc99955615b0a Mon Sep 17 00:00:00 2001 From: joflashstudios Date: Sun, 7 Jun 2015 00:13:41 -0400 Subject: [PATCH] Created BlockOre helpers to make recipes more readable. These works the same as the ItemParts helpers from e00ba942f830190952667a88304fb0487fd5d1a9 --- src/main/java/techreborn/blocks/BlockOre.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) 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",