Search in sources :

Example 1 with ModifierRecipeBuilder

use of slimeknights.tconstruct.library.recipe.modifiers.adding.ModifierRecipeBuilder in project TinkersConstruct by SlimeKnights.

the class ModifierRecipeProvider method luckRecipes.

/**
 * Common logic to add recipes for luck and unarmed looting
 */
private void luckRecipes(Consumer<FinishedRecipe> consumer, Modifier modifier, Tag<Item> tools, SlotType slotType, boolean unarmed, String folder, String salvage) {
    String key = modifier.getId().getPath();
    // level 1 always requires a slot
    ModifierRecipeBuilder builder1 = ModifierRecipeBuilder.modifier(modifier).setTools(tools).addInput(Tags.Items.INGOTS_COPPER).addInput(SizedIngredient.fromItems(Items.CORNFLOWER, Items.BLUE_ORCHID)).addInput(Tags.Items.INGOTS_COPPER).addInput(Tags.Items.STORAGE_BLOCKS_LAPIS).addInput(Tags.Items.STORAGE_BLOCKS_LAPIS).addSalvage(Items.COPPER_INGOT, 2, 2).addSalvage(Items.LAPIS_LAZULI, 3, 18).setSalvageLevelRange(1, 1).setMaxLevel(1).setSlots(slotType, 1);
    if (unarmed) {
        builder1.setRequirements(ModifierMatch.entry(TinkerModifiers.unarmed.get()));
        builder1.setRequirementsError(TConstruct.makeTranslationKey("recipe", "modifier.unarmed"));
    }
    builder1.saveSalvage(consumer, wrap(modifier, salvage, "_level_1")).save(consumer, wrap(modifier, folder, "_level_1"));
    // level 2 and 3 only charge if not ability
    ModifierRecipeBuilder builder2 = ModifierRecipeBuilder.modifier(modifier).setTools(tools).addInput(Tags.Items.INGOTS_GOLD).addInput(Items.GOLDEN_CARROT).addInput(Tags.Items.INGOTS_GOLD).addInput(Tags.Items.ENDER_PEARLS).addInput(Tags.Items.ENDER_PEARLS).addSalvage(Items.GOLD_INGOT, 2, 3).addSalvage(Items.GOLD_NUGGET, 1, 8).addSalvage(Items.CARROT, // all the magic is gone, its just a carrot now
    0.75f).addSalvage(Items.ENDER_PEARL, 2).setRequirements(ModifierMatch.entry(modifier, 1)).setRequirementsError(makeRequirementsError(key + ".level_2")).setSalvageLevelRange(2, 2).setMaxLevel(2);
    ModifierRecipeBuilder builder3 = ModifierRecipeBuilder.modifier(modifier).setTools(tools).addInput(TinkerMaterials.roseGold.getIngotTag()).addInputSalvage(Items.RABBIT_FOOT, 0.15f).addInput(TinkerMaterials.roseGold.getIngotTag()).addInput(Tags.Items.GEMS_DIAMOND).addInputSalvage(Items.NAME_TAG, 0.1f).addSalvage(Items.DIAMOND, 0.65f).addSalvage(TinkerMaterials.roseGold.getIngotTag(), 2, 2).setRequirements(ModifierMatch.entry(modifier, 2)).setRequirementsError(makeRequirementsError(key + ".level_3")).setSalvageLevelRange(3, 3).setMaxLevel(3);
    if (slotType == SlotType.UPGRADE) {
        builder2.setSlots(slotType, 1);
        builder3.setSlots(slotType, 1);
    }
    builder2.saveSalvage(consumer, wrap(modifier, salvage, "_level_2")).save(consumer, wrap(modifier, folder, "_level_2"));
    builder3.saveSalvage(consumer, wrap(modifier, salvage, "_level_3")).save(consumer, wrap(modifier, folder, "_level_3"));
}
Also used : SwappableModifierRecipeBuilder(slimeknights.tconstruct.library.recipe.modifiers.adding.SwappableModifierRecipeBuilder) OverslimeModifierRecipeBuilder(slimeknights.tconstruct.library.recipe.modifiers.adding.OverslimeModifierRecipeBuilder) ModifierRecipeBuilder(slimeknights.tconstruct.library.recipe.modifiers.adding.ModifierRecipeBuilder) IncrementalModifierRecipeBuilder(slimeknights.tconstruct.library.recipe.modifiers.adding.IncrementalModifierRecipeBuilder)

Aggregations

IncrementalModifierRecipeBuilder (slimeknights.tconstruct.library.recipe.modifiers.adding.IncrementalModifierRecipeBuilder)1 ModifierRecipeBuilder (slimeknights.tconstruct.library.recipe.modifiers.adding.ModifierRecipeBuilder)1 OverslimeModifierRecipeBuilder (slimeknights.tconstruct.library.recipe.modifiers.adding.OverslimeModifierRecipeBuilder)1 SwappableModifierRecipeBuilder (slimeknights.tconstruct.library.recipe.modifiers.adding.SwappableModifierRecipeBuilder)1