use of net.minecraftforge.oredict.ShapedOreRecipe in project Railcraft by Railcraft.
the class CraftingPlugin method addRecipe.
public static void addRecipe(@Nullable ItemStack result, Object... recipeArray) {
ProcessedRecipe processedRecipe;
try {
processedRecipe = processRecipe(RecipeType.SHAPED, result, recipeArray);
} catch (InvalidRecipeException ex) {
Game.logTrace(Level.WARN, ex.getRawMessage());
return;
}
if (processedRecipe.isOreRecipe) {
IRecipe recipe = new ShapedOreRecipe(processedRecipe.result, processedRecipe.recipeArray);
addRecipe(recipe);
} else
GameRegistry.addRecipe(processedRecipe.result, processedRecipe.recipeArray);
}
use of net.minecraftforge.oredict.ShapedOreRecipe 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 net.minecraftforge.oredict.ShapedOreRecipe in project BetterWithAddons by DaedalusGame.
the class InteractionCondensedOutputs method addCondensingRecipe.
private void addCondensingRecipe(ForgeRegistry<IRecipe> registry, String id, ItemStack output, ItemStack material, ItemStack frame) {
ItemStack outmaterial = material.copy();
outmaterial.setCount(8);
ResourceLocation compressLoc = new ResourceLocation(Reference.MOD_ID, "compress_" + id);
registry.register(new ShapedOreRecipe(compressLoc, output, "aaa", "aba", "aaa", 'a', material, 'b', frame).setRegistryName(compressLoc));
}
Aggregations