Search in sources :

Example 1 with FabricCompoundingRecipe

use of net.silentchaos512.gear.crafting.recipe.compounder.FabricCompoundingRecipe in project Silent-Gear by SilentChaos512.

the class SGearJeiPlugin method registerRecipes.

@Override
public void registerRecipes(IRecipeRegistration reg) {
    assert Minecraft.getInstance().level != null;
    RecipeManager recipeManager = Minecraft.getInstance().level.getRecipeManager();
    // Repair kit hints
    for (RepairKitItem item : Registration.getItems(RepairKitItem.class)) {
        String itemName = NameUtils.fromItem(item).getPath();
        reg.addRecipes(Collections.singleton(new ShapelessRecipe(SilentGear.getId(itemName + "_fill_hint"), "", new ItemStack(item), NonNullList.of(Ingredient.EMPTY, Ingredient.of(item), PartMaterialIngredient.of(PartType.MAIN), PartMaterialIngredient.of(PartType.MAIN), PartMaterialIngredient.of(PartType.MAIN)))), VanillaRecipeCategoryUid.CRAFTING);
        reg.addRecipes(Collections.singleton(new ShapelessRecipe(SilentGear.getId(itemName + "_fill_hint_frag"), "", new ItemStack(item), NonNullList.of(Ingredient.EMPTY, Ingredient.of(item), Ingredient.of(ModItems.FRAGMENT), Ingredient.of(ModItems.FRAGMENT), Ingredient.of(ModItems.FRAGMENT)))), VanillaRecipeCategoryUid.CRAFTING);
    }
    reg.addRecipes(recipeManager.getRecipes().stream().filter(SGearJeiPlugin::isGearCraftingRecipe).collect(Collectors.toList()), GEAR_CRAFTING);
    // Compounders
    reg.addRecipes(recipeManager.getRecipes().stream().filter(r -> r.getType() == CompoundingRecipe.COMPOUNDING_FABRIC_TYPE).collect(Collectors.toList()), Const.COMPOUNDING_FABRIC);
    reg.addRecipes(recipeManager.getRecipes().stream().filter(r -> r.getType() == CompoundingRecipe.COMPOUNDING_GEM_TYPE).collect(Collectors.toList()), Const.COMPOUNDING_GEM);
    reg.addRecipes(recipeManager.getRecipes().stream().filter(r -> r.getType() == CompoundingRecipe.COMPOUNDING_METAL_TYPE).collect(Collectors.toList()), Const.COMPOUNDING_METAL);
    for (int i = 2; i <= 4; ++i) {
        reg.addRecipes(Collections.singleton(CompoundingRecipe.makeExample(Const.FABRIC_COMPOUNDER_INFO, i, new FabricCompoundingRecipe(SilentGear.getId("fabric_example_" + i)))), Const.COMPOUNDING_FABRIC);
        reg.addRecipes(Collections.singleton(CompoundingRecipe.makeExample(Const.GEM_COMPOUNDER_INFO, i, new GemCompoundingRecipe(SilentGear.getId("gem_example_" + i)))), Const.COMPOUNDING_GEM);
        reg.addRecipes(Collections.singleton(CompoundingRecipe.makeExample(Const.METAL_COMPOUNDER_INFO, i, new MetalCompoundingRecipe(SilentGear.getId("metal_example_" + i)))), Const.COMPOUNDING_METAL);
    }
    // Grading
    reg.addRecipes(Collections.singleton(new MaterialGraderRecipeCategory.GraderRecipe()), Const.GRADING);
    // Salvaging
    reg.addRecipes(recipeManager.getRecipes().stream().filter(r -> r.getType() == SalvagingRecipe.SALVAGING_TYPE).collect(Collectors.toList()), Const.SALVAGING);
    addInfoPage(reg, CraftingItems.RED_CARD_UPGRADE);
    addInfoPage(reg, CraftingItems.SPOON_UPGRADE);
    for (Item item : Registration.getItems(item -> item instanceof ICoreTool)) {
        addInfoPage(reg, item);
    }
}
Also used : GemCompoundingRecipe(net.silentchaos512.gear.crafting.recipe.compounder.GemCompoundingRecipe) MetalCompoundingRecipe(net.silentchaos512.gear.crafting.recipe.compounder.MetalCompoundingRecipe) FabricCompoundingRecipe(net.silentchaos512.gear.crafting.recipe.compounder.FabricCompoundingRecipe) ICoreTool(net.silentchaos512.gear.api.item.ICoreTool) RepairKitItem(net.silentchaos512.gear.item.RepairKitItem) RepairKitItem(net.silentchaos512.gear.item.RepairKitItem) Item(net.minecraft.world.item.Item) FragmentItem(net.silentchaos512.gear.item.FragmentItem) CustomMaterialItem(net.silentchaos512.gear.item.CustomMaterialItem) ItemStack(net.minecraft.world.item.ItemStack)

Aggregations

Item (net.minecraft.world.item.Item)1 ItemStack (net.minecraft.world.item.ItemStack)1 ICoreTool (net.silentchaos512.gear.api.item.ICoreTool)1 FabricCompoundingRecipe (net.silentchaos512.gear.crafting.recipe.compounder.FabricCompoundingRecipe)1 GemCompoundingRecipe (net.silentchaos512.gear.crafting.recipe.compounder.GemCompoundingRecipe)1 MetalCompoundingRecipe (net.silentchaos512.gear.crafting.recipe.compounder.MetalCompoundingRecipe)1 CustomMaterialItem (net.silentchaos512.gear.item.CustomMaterialItem)1 FragmentItem (net.silentchaos512.gear.item.FragmentItem)1 RepairKitItem (net.silentchaos512.gear.item.RepairKitItem)1