use of com.infinityraider.agricraft.reference.AgriNuggetType in project AgriCraft by AgriCraft.
the class ItemNugget method getSubItems.
@Override
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> varients) {
for (AgriNuggetType type : AgriNuggetType.values()) {
ItemStack stack = new ItemStack(item, 1, type.ordinal());
OreDictionary.registerOre(type.nugget, stack);
varients.add(stack);
}
}
use of com.infinityraider.agricraft.reference.AgriNuggetType in project AgriCraft by AgriCraft.
the class ItemNugget method registerRecipes.
@Override
public void registerRecipes() {
for (AgriNuggetType type : AgriNuggetType.values()) {
ItemStack nugget = new ItemStack(this, 9, type.ordinal());
ItemStack ingot = OreDictHelper.getIngot(type.ingot);
AgriCore.getLogger("agricraft").debug("Registering Nugget: {0} For: {1}", type.nugget, type.ingot);
if (ingot != null) {
GameRegistry.addRecipe(new ShapedOreRecipe(ingot, "nnn", "nnn", "nnn", 'n', type.nugget));
GameRegistry.addRecipe(new ShapelessOreRecipe(nugget, type.ingot));
}
}
}
use of com.infinityraider.agricraft.reference.AgriNuggetType in project AgriCraft by AgriCraft.
the class ItemNugget method registerRecipes.
@Override
public void registerRecipes(IForgeRegistry<IRecipe> registry) {
for (AgriNuggetType type : AgriNuggetType.values()) {
// 1) Ore Dictionary registration.
AgriCore.getLogger("agricraft").info("Registering in Ore Dictionary: {0}", type.nugget);
ItemStack oneNugget = new ItemStack(this, 1, type.ordinal());
OreDictionary.registerOre(type.nugget, oneNugget);
// 2) Conditional recipes. Only if the ingot exists, because AgriCraft doesn't add its own.
ItemStack ingot = OreDictHelper.getIngot(type.ingot);
if (!ingot.isEmpty()) {
AgriCore.getLogger("agricraft").info("Adding a recipe to convert nine {0} into one {1}", type.nugget, type.ingot);
final ResourceLocation group = new ResourceLocation(AgriCraft.instance.getModId(), "combine_nugget");
final ResourceLocation name = new ResourceLocation(AgriCraft.instance.getModId(), "combine_nugget_" + type.name().toLowerCase());
final ShapedOreRecipe recipe = new ShapedOreRecipe(group, ingot, "nnn", "nnn", "nnn", 'n', type.nugget);
recipe.setRegistryName(name);
AgriCore.getLogger("agricraft").info("Registering nugget recipe: {0}!", recipe.getRegistryName());
registry.register(recipe);
}
}
}
use of com.infinityraider.agricraft.reference.AgriNuggetType in project AgriCraft by AgriCraft.
the class ItemNugget method getSubItems.
@Override
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> varients) {
if (tab == this.getCreativeTab() || tab == CreativeTabs.SEARCH) {
for (AgriNuggetType type : AgriNuggetType.values()) {
ItemStack stack = new ItemStack(this, 1, type.ordinal());
varients.add(stack);
}
}
}
Aggregations