private static ShapedPrimer createExample() { final ShapedPrimer example = new ShapedPrimer(); example.width = 3; example.height = 3; Ingredient e = Ingredient.fromStacks(MetasGeneric.mapMemory.newItemStack()); Ingredient m = Ingredient.fromStacks(ItemEmptyMap.createMap(Items.emptyMap, 0)); example.input = NonNullList.from( Ingredient.EMPTY, Ingredient.EMPTY, e, Ingredient.EMPTY, e, m, e, Ingredient.EMPTY, e, Ingredient.EMPTY); return example; }
@Override public IRecipe parse(JsonContext context, JsonObject json) { ShapedOreRecipe recipe = ShapedOreRecipe.factory(context, json); ShapedPrimer primer = new ShapedPrimer(); primer.width = recipe.getWidth(); primer.height = recipe.getHeight(); primer.mirrored = JsonUtils.getBoolean(json, "mirrored", true); primer.input = recipe.getIngredients(); return new InsertCartridgeRecipe(new ResourceLocation(MeeCreeps.MODID, "insert_cartridge_factory"), recipe.getRecipeOutput(), primer); }
@Override public IRecipe parse(JsonContext context, JsonObject json) { ShapedOreRecipe recipe = ShapedOreRecipe.factory(context, json); ShapedPrimer primer = new ShapedPrimer(); primer.width = recipe.getWidth(); primer.height = recipe.getHeight(); primer.mirrored = JsonUtils.getBoolean(json, "mirrored", true); primer.input = recipe.getIngredients(); return new RemoveCartridgeRecipe(new ResourceLocation(MeeCreeps.MODID, "remove_cartridge_factory"), recipe.getRecipeOutput(), primer); }
/** * This should only be used for registering recipes for vanilla objects and not mod-specific objects. * @param name The name of the recipe. ModID is pre-pended to it. * @param stack The output of the recipe. * @param recipeComponents The recipe components. */ public static ShapedRecipes AddShapedRecipe(String name, String groupName, ItemStack stack, Object... recipeComponents) { name = Prefab.MODID.toLowerCase().replace(' ', '_') + ":" + name; ShapedPrimer primer = CraftingHelper.parseShaped(recipeComponents); ShapedRecipes shapedrecipes = new ShapedRecipes(groupName, primer.width, primer.height, primer.input, stack); shapedrecipes.setRegistryName(name); ForgeRegistries.RECIPES.register(shapedrecipes); return shapedrecipes; }
public InsertCartridgeRecipe(ResourceLocation group, ItemStack result, ShapedPrimer primer) { super(group, result, primer); }
public RemoveCartridgeRecipe(ResourceLocation group, ItemStack result, ShapedPrimer primer) { super(group, result, primer); }
public RecipeShapedFluid(ResourceLocation loc, ItemStack result, ShapedPrimer primer) { super(loc, result, primer); }
private void addShapedRecipe(IForgeRegistry<IRecipe> reg, ResourceLocation name, ResourceLocation group, @Nonnull ItemStack output, Object... params) { ShapedPrimer primer = CraftingHelper.parseShaped(params); reg.register(new ShapedRecipes(group == null ? "" : group.toString(), primer.width, primer.height, primer.input, output).setRegistryName(name)); }
private void addShapedNBTRecipe(IForgeRegistry<IRecipe> reg, ResourceLocation name, ResourceLocation group, @Nonnull ItemStack output, Object... params) { ShapedPrimer primer = CraftingHelper.parseShaped(params); reg.register(new ShapedNBTRecipe(group == null ? "" : group.toString(), primer.width, primer.height, primer.input, output).setRegistryName(name)); }