Java 类net.minecraftforge.common.crafting.CraftingHelper.ShapedPrimer 实例源码

项目:OpenBlocks    文件:MapResizeRecipe.java   
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;
}
项目:MeeCreeps    文件:InsertCartridgeFactory.java   
@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);
}
项目:MeeCreeps    文件:RemoveCartridgeFactory.java   
@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);
}
项目:MC-Prefab    文件:ModRegistry.java   
/**
 * 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;
}
项目:MeeCreeps    文件:InsertCartridgeFactory.java   
public InsertCartridgeRecipe(ResourceLocation group, ItemStack result, ShapedPrimer primer) {
    super(group, result, primer);
}
项目:MeeCreeps    文件:RemoveCartridgeFactory.java   
public RemoveCartridgeRecipe(ResourceLocation group, ItemStack result, ShapedPrimer primer) {
    super(group, result, primer);
}
项目:Wizardry    文件:RecipeShapedFluid.java   
public RecipeShapedFluid(ResourceLocation loc, ItemStack result, ShapedPrimer primer)
{
    super(loc, result, primer);
}
项目:AbyssalCraft    文件:MiscHandler.java   
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));
}
项目:AbyssalCraft    文件:MiscHandler.java   
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));
}