Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.advancedcombat.common.data;
- import com.advancedcombat.init.ACItems;
- import net.minecraft.data.*;
- import net.minecraft.item.Items;
- import net.minecraft.tags.ItemTags;
- import net.minecraft.util.IItemProvider;
- import javax.annotation.Nonnull;
- import java.util.function.Consumer;
- public class ACRecipeProvider extends RecipeProvider {
- public ACRecipeProvider(DataGenerator generator) {
- super(generator);
- }
- @Override
- protected void buildShapelessRecipes(@Nonnull Consumer<IFinishedRecipe> consumer) {
- ShapedRecipeBuilder.shaped(ACItems.advanced_stone.get()).pattern("IXI").pattern("XIX").pattern("IXI").define('X', Items.STONE).define('I', Items.COBBLESTONE).unlockedBy("has_stone", has(Items.STONE)).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.reinforced_obsidian.get()).pattern("IXI").pattern("XIX").pattern("IXI").define('X', ACItems.advanced_stone.get()).define('I', Items.OBSIDIAN).unlockedBy("has_stone", has(Items.STONE)).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.advanced_bow.get()).pattern("XIX").pattern("XAX").pattern("XIX").define('X', ItemTags.LOGS).define('I', Items.IRON_BLOCK).define('A', Items.BOW).unlockedBy("has_iron_block", has(Items.IRON_BLOCK)).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.advanced_shield.get()).pattern("XIX").pattern("XAX").pattern("XIX").define('X', ItemTags.LOGS).define('I', Items.IRON_BLOCK).define('A', Items.SHIELD).unlockedBy("has_iron_block", has(Items.IRON_BLOCK)).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.wooden_helmet.get()).pattern("XXX").pattern("X X").define('X', ItemTags.LOGS).unlockedBy("has_log", has(ItemTags.LOGS)).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.wooden_chestplate.get()).pattern("X X").pattern("XXX").pattern("XXX").define('X', ItemTags.LOGS).unlockedBy("has_log", has(ItemTags.LOGS)).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.wooden_leggings.get()).pattern("XXX").pattern("X X").pattern("X X").define('X', ItemTags.LOGS).unlockedBy("has_log", has(ItemTags.LOGS)).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.wooden_boots.get()).pattern("X X").pattern("X X").define('X', ItemTags.LOGS).unlockedBy("has_log", has(ItemTags.LOGS)).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.stone_helmet.get()).pattern("AXA").pattern("X X").define('X', Items.STONE).define('A', ACItems.advanced_stone.get()).unlockedBy("has_advanced_stone", has(ACItems.advanced_stone.get())).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.stone_chestplate.get()).pattern("X X").pattern("XAX").pattern("XAX").define('X', Items.STONE).define('A', ACItems.advanced_stone.get()).unlockedBy("has_advanced_stone", has(ACItems.advanced_stone.get())).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.stone_leggings.get()).pattern("AXA").pattern("X X").pattern("X X").define('X', Items.STONE).define('A', ACItems.advanced_stone.get()).unlockedBy("has_advanced_stone", has(ACItems.advanced_stone.get())).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.stone_boots.get()).pattern("A A").pattern("X X").define('X', Items.STONE).define('A', ACItems.advanced_stone.get()).unlockedBy("has_advanced_stone", has(ACItems.advanced_stone.get())).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.obsidian_helmet.get()).pattern("AXA").pattern("X X").define('X', Items.OBSIDIAN).define('A', ACItems.reinforced_obsidian.get()).unlockedBy("has_reinforced_obsidian", has(ACItems.reinforced_obsidian.get())).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.obsidian_chestplate.get()).pattern("X X").pattern("XAX").pattern("XAX").define('X', Items.OBSIDIAN).define('A', ACItems.reinforced_obsidian.get()).unlockedBy("has_reinforced_obsidian", has(ACItems.reinforced_obsidian.get())).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.obsidian_leggings.get()).pattern("AXA").pattern("X X").pattern("X X").define('X', Items.OBSIDIAN).define('A', ACItems.reinforced_obsidian.get()).unlockedBy("has_reinforced_obsidian", has(ACItems.reinforced_obsidian.get())).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.obsidian_boots.get()).pattern("A A").pattern("X X").define('X', Items.OBSIDIAN).define('A', ACItems.reinforced_obsidian.get()).unlockedBy("has_reinforced_obsidian", has(ACItems.reinforced_obsidian.get())).save(consumer);
- // Normal Upgrades
- addTier1Upgrade(consumer, ACItems.sharpness_upgrade.get(), Items.FLINT, Items.IRON_SWORD);
- addTier1Upgrade(consumer, ACItems.smite_upgrade.get(), Items.ROTTEN_FLESH, Items.BONE);
- addTier1Upgrade(consumer, ACItems.bane_of_arthropods_upgrade.get(), Items.SPIDER_EYE, Items.STRING);
- addTier1Upgrade(consumer, ACItems.knockback_upgrade.get(), Items.PISTON, Items.SLIME_BLOCK);
- addTier1Upgrade(consumer, ACItems.fire_aspect_upgrade.get(), Items.FIRE_CHARGE, Items.COAL_BLOCK);
- addTier1Upgrade(consumer, ACItems.looting_upgrade.get(), Items.GOLD_INGOT, Items.GOLDEN_SWORD);
- addTier1Upgrade(consumer, ACItems.unbreaking_upgrade.get(), Items.OBSIDIAN, Items.DIAMOND_CHESTPLATE);
- addTier1Upgrade(consumer, ACItems.mending_upgrade.get(), Items.ANVIL, Items.POPPED_CHORUS_FRUIT);
- addTier1Upgrade(consumer, ACItems.protection_upgrade.get(), Items.LEATHER_CHESTPLATE, Items.SHIELD);
- addTier1Upgrade(consumer, ACItems.fire_protection_upgrade.get(), Items.NETHER_BRICK, Items.FLINT_AND_STEEL);
- addTier1Upgrade(consumer, ACItems.blast_protection_upgrade.get(), Items.OBSIDIAN, Items.TNT);
- addTier1Upgrade(consumer, ACItems.projectile_protection_upgrade.get(), Items.ARROW, Items.BOW);
- addTier1Upgrade(consumer, ACItems.feather_falling_upgrade.get(), Items.FEATHER, Items.HAY_BLOCK);
- addTier1Upgrade(consumer, ACItems.respiration_upgrade.get(), Items.TROPICAL_FISH, Items.GLASS_BOTTLE);
- addTier1Upgrade(consumer, ACItems.aqua_affinity_upgrade.get(), Items.TROPICAL_FISH, Items.IRON_PICKAXE);
- addTier1Upgrade(consumer, ACItems.thorns_upgrade.get(), Items.CACTUS, Items.FLINT);
- addTier1Upgrade(consumer, ACItems.depth_strider_upgrade.get(), Items.LEATHER_BOOTS, Items.WATER_BUCKET);
- addTier1Upgrade(consumer, ACItems.frost_walker_upgrade.get(), Items.GOLDEN_BOOTS, Items.ICE);
- addTier1Upgrade(consumer, ACItems.efficiency_upgrade.get(), Items.REDSTONE, Items.DIAMOND_PICKAXE);
- addTier1Upgrade(consumer, ACItems.silk_touch_upgrade.get(), Items.STRING, Items.GOLDEN_PICKAXE);
- addTier1Upgrade(consumer, ACItems.fortune_upgrade.get(), Items.DIAMOND, Items.GOLD_BLOCK);
- addTier1Upgrade(consumer, ACItems.power_upgrade.get(), Items.ARROW, Items.FLINT);
- addTier1Upgrade(consumer, ACItems.punch_upgrade.get(), Items.ARROW, Items.PISTON);
- addTier1Upgrade(consumer, ACItems.flame_upgrade.get(), Items.BLAZE_ROD, Items.COAL_BLOCK);
- addTier1Upgrade(consumer, ACItems.infinity_upgrade.get(), Items.BOW, Items.GOLDEN_APPLE);
- addTier1Upgrade(consumer, ACItems.luck_of_the_sea_upgrade.get(), Items.FISHING_ROD, Items.RABBIT_FOOT);
- addTier1Upgrade(consumer, ACItems.lure_upgrade.get(), Items.FISHING_ROD, Items.TROPICAL_FISH);
- ShapedRecipeBuilder.shaped(ACItems.advanced_wooden_sword.get()).pattern("XXX").pattern("XIX").pattern("XXX").define('X', ItemTags.LOGS).define('I', Items.WOODEN_SWORD).unlockedBy("has_wooden_sword", has(Items.WOODEN_SWORD)).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.advanced_stone_sword.get()).pattern("XXX").pattern("XIX").pattern("XXX").define('X', ACItems.advanced_stone.get()).define('I', Items.STONE_SWORD).unlockedBy("has_advanced_stone", has(ACItems.advanced_stone.get())).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.advanced_golden_sword.get()).pattern("XXX").pattern("XIX").pattern("XXX").define('X', Items.GOLD_BLOCK).define('I', Items.GOLDEN_SWORD).unlockedBy("has_golden_sword", has(Items.GOLDEN_SWORD)).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.advanced_iron_sword.get()).pattern("XXX").pattern("XIX").pattern("XXX").define('X', Items.IRON_BLOCK).define('I', Items.IRON_SWORD).unlockedBy("has_iron_sword", has(Items.IRON_SWORD)).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.advanced_emerald_sword.get()).pattern("XXX").pattern("XIX").pattern("XXX").define('X', Items.EMERALD_BLOCK).define('I', Items.GOLDEN_SWORD).unlockedBy("has_golden_sword", has(Items.GOLDEN_SWORD)).save(consumer);
- ShapedRecipeBuilder.shaped(ACItems.advanced_diamond_sword.get()).pattern("XXX").pattern("XIX").pattern("XXX").define('X', Items.DIAMOND_BLOCK).define('I', Items.DIAMOND_SWORD).unlockedBy("has_diamond_sword", has(Items.DIAMOND_SWORD)).save(consumer);
- }
- /** Base recipe for tier 1 & 2 enchantment upgrades. */
- private static void addTier1Upgrade(Consumer<IFinishedRecipe> consumer, IItemProvider craftedItem, IItemProvider ingredientItem, IItemProvider ingredientItem2) {
- craftedItem.asItem().getDefaultInstance().setDamageValue(1);
- ShapedRecipeBuilder.shaped(craftedItem).define('I', Items.PAPER).define('X', ingredientItem).define('A', ingredientItem2).pattern("IXI").pattern("XAX").pattern("IXI").unlockedBy("has_item", has(Items.PAPER)).save(consumer);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement