package net.minecraft.data.advancements;

import net.minecraft.advancements.critereon.LocationTrigger;
import net.minecraft.world.level.levelgen.feature.StructureFeature;
import net.minecraft.advancements.critereon.LocationPredicate;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.advancements.critereon.CuredZombieVillagerTrigger;
import net.minecraft.advancements.critereon.ChangeDimensionTrigger;
import net.minecraft.world.level.dimension.DimensionType;
import net.minecraft.advancements.critereon.EntityHurtPlayerTrigger;
import net.minecraft.advancements.critereon.DamageSourcePredicate;
import net.minecraft.advancements.critereon.DamagePredicate;
import net.minecraft.advancements.critereon.EnchantedItemTrigger;
import net.minecraft.advancements.RequirementsStrategy;
import net.minecraft.world.item.Items;
import net.minecraft.advancements.CriterionTriggerInstance;
import net.minecraft.advancements.critereon.InventoryChangeTrigger;
import net.minecraft.network.chat.Component;
import net.minecraft.world.level.ItemLike;
import net.minecraft.advancements.FrameType;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.advancements.Advancement;
import java.util.function.Consumer;

public class StoryAdvancements implements Consumer<Consumer<Advancement>> {
    @Override
    public void accept(final Consumer<Advancement> consumer) {
        final Advancement u3 = Advancement.Builder.advancement().display(Blocks.GRASS_BLOCK, new TranslatableComponent("advancements.story.root.title", new Object[0]), new TranslatableComponent("advancements.story.root.description", new Object[0]), new ResourceLocation("textures/gui/advancements/backgrounds/stone.png"), FrameType.TASK, false, false, false).addCriterion("crafting_table", InventoryChangeTrigger.TriggerInstance.hasItem(Blocks.CRAFTING_TABLE)).save(consumer, "story/root");
        final Advancement u4 = Advancement.Builder.advancement().parent(u3).display(Items.WOODEN_PICKAXE, new TranslatableComponent("advancements.story.mine_stone.title", new Object[0]), new TranslatableComponent("advancements.story.mine_stone.description", new Object[0]), null, FrameType.TASK, true, true, false).addCriterion("get_stone", InventoryChangeTrigger.TriggerInstance.hasItem(Blocks.COBBLESTONE)).save(consumer, "story/mine_stone");
        final Advancement u5 = Advancement.Builder.advancement().parent(u4).display(Items.STONE_PICKAXE, new TranslatableComponent("advancements.story.upgrade_tools.title", new Object[0]), new TranslatableComponent("advancements.story.upgrade_tools.description", new Object[0]), null, FrameType.TASK, true, true, false).addCriterion("stone_pickaxe", InventoryChangeTrigger.TriggerInstance.hasItem(Items.STONE_PICKAXE)).save(consumer, "story/upgrade_tools");
        final Advancement u6 = Advancement.Builder.advancement().parent(u5).display(Items.IRON_INGOT, new TranslatableComponent("advancements.story.smelt_iron.title", new Object[0]), new TranslatableComponent("advancements.story.smelt_iron.description", new Object[0]), null, FrameType.TASK, true, true, false).addCriterion("iron", InventoryChangeTrigger.TriggerInstance.hasItem(Items.IRON_INGOT)).save(consumer, "story/smelt_iron");
        final Advancement u7 = Advancement.Builder.advancement().parent(u6).display(Items.IRON_PICKAXE, new TranslatableComponent("advancements.story.iron_tools.title", new Object[0]), new TranslatableComponent("advancements.story.iron_tools.description", new Object[0]), null, FrameType.TASK, true, true, false).addCriterion("iron_pickaxe", InventoryChangeTrigger.TriggerInstance.hasItem(Items.IRON_PICKAXE)).save(consumer, "story/iron_tools");
        final Advancement u8 = Advancement.Builder.advancement().parent(u7).display(Items.DIAMOND, new TranslatableComponent("advancements.story.mine_diamond.title", new Object[0]), new TranslatableComponent("advancements.story.mine_diamond.description", new Object[0]), null, FrameType.TASK, true, true, false).addCriterion("diamond", InventoryChangeTrigger.TriggerInstance.hasItem(Items.DIAMOND)).save(consumer, "story/mine_diamond");
        final Advancement u9 = Advancement.Builder.advancement().parent(u6).display(Items.LAVA_BUCKET, new TranslatableComponent("advancements.story.lava_bucket.title", new Object[0]), new TranslatableComponent("advancements.story.lava_bucket.description", new Object[0]), null, FrameType.TASK, true, true, false).addCriterion("lava_bucket", InventoryChangeTrigger.TriggerInstance.hasItem(Items.LAVA_BUCKET)).save(consumer, "story/lava_bucket");
        final Advancement u10 = Advancement.Builder.advancement().parent(u6).display(Items.IRON_CHESTPLATE, new TranslatableComponent("advancements.story.obtain_armor.title", new Object[0]), new TranslatableComponent("advancements.story.obtain_armor.description", new Object[0]), null, FrameType.TASK, true, true, false).requirements(RequirementsStrategy.OR).addCriterion("iron_helmet", InventoryChangeTrigger.TriggerInstance.hasItem(Items.IRON_HELMET)).addCriterion("iron_chestplate", InventoryChangeTrigger.TriggerInstance.hasItem(Items.IRON_CHESTPLATE)).addCriterion("iron_leggings", InventoryChangeTrigger.TriggerInstance.hasItem(Items.IRON_LEGGINGS)).addCriterion("iron_boots", InventoryChangeTrigger.TriggerInstance.hasItem(Items.IRON_BOOTS)).save(consumer, "story/obtain_armor");
        final Advancement u11 = Advancement.Builder.advancement().parent(u8).display(Items.ENCHANTED_BOOK, new TranslatableComponent("advancements.story.enchant_item.title", new Object[0]), new TranslatableComponent("advancements.story.enchant_item.description", new Object[0]), null, FrameType.TASK, true, true, false).addCriterion("enchanted_item", EnchantedItemTrigger.TriggerInstance.enchantedItem()).save(consumer, "story/enchant_item");
        final Advancement u12 = Advancement.Builder.advancement().parent(u9).display(Blocks.OBSIDIAN, new TranslatableComponent("advancements.story.form_obsidian.title", new Object[0]), new TranslatableComponent("advancements.story.form_obsidian.description", new Object[0]), null, FrameType.TASK, true, true, false).addCriterion("obsidian", InventoryChangeTrigger.TriggerInstance.hasItem(Blocks.OBSIDIAN)).save(consumer, "story/form_obsidian");
        final Advancement u13 = Advancement.Builder.advancement().parent(u10).display(Items.SHIELD, new TranslatableComponent("advancements.story.deflect_arrow.title", new Object[0]), new TranslatableComponent("advancements.story.deflect_arrow.description", new Object[0]), null, FrameType.TASK, true, true, false).addCriterion("deflected_projectile", EntityHurtPlayerTrigger.TriggerInstance.entityHurtPlayer(DamagePredicate.Builder.damageInstance().type(DamageSourcePredicate.Builder.damageType().isProjectile(true)).blocked(true))).save(consumer, "story/deflect_arrow");
        final Advancement u14 = Advancement.Builder.advancement().parent(u8).display(Items.DIAMOND_CHESTPLATE, new TranslatableComponent("advancements.story.shiny_gear.title", new Object[0]), new TranslatableComponent("advancements.story.shiny_gear.description", new Object[0]), null, FrameType.TASK, true, true, false).requirements(RequirementsStrategy.OR).addCriterion("diamond_helmet", InventoryChangeTrigger.TriggerInstance.hasItem(Items.DIAMOND_HELMET)).addCriterion("diamond_chestplate", InventoryChangeTrigger.TriggerInstance.hasItem(Items.DIAMOND_CHESTPLATE)).addCriterion("diamond_leggings", InventoryChangeTrigger.TriggerInstance.hasItem(Items.DIAMOND_LEGGINGS)).addCriterion("diamond_boots", InventoryChangeTrigger.TriggerInstance.hasItem(Items.DIAMOND_BOOTS)).save(consumer, "story/shiny_gear");
        final Advancement u15 = Advancement.Builder.advancement().parent(u12).display(Items.FLINT_AND_STEEL, new TranslatableComponent("advancements.story.enter_the_nether.title", new Object[0]), new TranslatableComponent("advancements.story.enter_the_nether.description", new Object[0]), null, FrameType.TASK, true, true, false).addCriterion("entered_nether", ChangeDimensionTrigger.TriggerInstance.changedDimensionTo(DimensionType.NETHER)).save(consumer, "story/enter_the_nether");
        final Advancement u16 = Advancement.Builder.advancement().parent(u15).display(Items.GOLDEN_APPLE, new TranslatableComponent("advancements.story.cure_zombie_villager.title", new Object[0]), new TranslatableComponent("advancements.story.cure_zombie_villager.description", new Object[0]), null, FrameType.GOAL, true, true, false).addCriterion("cured_zombie", CuredZombieVillagerTrigger.TriggerInstance.curedZombieVillager()).save(consumer, "story/cure_zombie_villager");
        final Advancement u17 = Advancement.Builder.advancement().parent(u15).display(Items.ENDER_EYE, new TranslatableComponent("advancements.story.follow_ender_eye.title", new Object[0]), new TranslatableComponent("advancements.story.follow_ender_eye.description", new Object[0]), null, FrameType.TASK, true, true, false).addCriterion("in_stronghold", LocationTrigger.TriggerInstance.located(LocationPredicate.inFeature(Feature.STRONGHOLD))).save(consumer, "story/follow_ender_eye");
        final Advancement u18 = Advancement.Builder.advancement().parent(u17).display(Blocks.END_STONE, new TranslatableComponent("advancements.story.enter_the_end.title", new Object[0]), new TranslatableComponent("advancements.story.enter_the_end.description", new Object[0]), null, FrameType.TASK, true, true, false).addCriterion("entered_end", ChangeDimensionTrigger.TriggerInstance.changedDimensionTo(DimensionType.THE_END)).save(consumer, "story/enter_the_end");
    }
}
