From 91ecee21271ea820f52dd0c470d17dfb600cb41c Mon Sep 17 00:00:00 2001 From: EngineMachiner Date: Sun, 29 Sep 2024 14:36:47 -0500 Subject: [PATCH] Fix advancements --- .../honkytones/datagen/Advancements.kt | 14 ++++---------- .../resources/assets/honkytones/lang/en_us.json | 4 ++-- .../resources/assets/honkytones/lang/es_ec.json | 4 ++-- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/main/kotlin/com/enginemachiner/honkytones/datagen/Advancements.kt b/src/main/kotlin/com/enginemachiner/honkytones/datagen/Advancements.kt index 9bd932d..d4ff60b 100644 --- a/src/main/kotlin/com/enginemachiner/honkytones/datagen/Advancements.kt +++ b/src/main/kotlin/com/enginemachiner/honkytones/datagen/Advancements.kt @@ -16,7 +16,6 @@ import net.minecraft.item.Items import net.minecraft.predicate.NumberRange import net.minecraft.predicate.entity.EntityEquipmentPredicate import net.minecraft.predicate.entity.EntityPredicate -import net.minecraft.predicate.entity.LootContextPredicate import net.minecraft.predicate.item.EnchantmentPredicate import net.minecraft.predicate.item.ItemPredicate import net.minecraft.text.Text @@ -178,18 +177,13 @@ class Advancements( output: FabricDataOutput ) : FabricAdvancementProvider(outpu override fun conditions(): AdvancementCriterion<*> { - val range = NumberRange.IntRange.atLeast(2) + val range = NumberRange.IntRange.ANY val enchantmentPredicate = EnchantmentPredicate( enchantment, range ) - val player = LootContextPredicate.create() - val itemPredicate = ItemPredicate.Builder.create().tag(tag) - .enchantment( enchantmentPredicate ).build() + val predicate = ItemPredicate.Builder.create() + .enchantment( enchantmentPredicate ).tag(tag).build() - val optional1 = Optional.of(player); val optional2 = Optional.of(itemPredicate) - - val conditions = EnchantedItemCriterion.Conditions( optional1, optional2, range ) - - return Criteria.ENCHANTED_ITEM.create(conditions) + return InventoryChangedCriterion.Conditions.items(predicate) } diff --git a/src/main/resources/assets/honkytones/lang/en_us.json b/src/main/resources/assets/honkytones/lang/en_us.json index adf379c..0b1c9c0 100644 --- a/src/main/resources/assets/honkytones/lang/en_us.json +++ b/src/main/resources/assets/honkytones/lang/en_us.json @@ -182,13 +182,13 @@ "honkytones.advancements.root.description": "Get your first instrument.", - "honkytones.advancements.doot.description": "Steal a skeleton's trumpet.", + "honkytones.advancements.doot.description": "Kill a skeleton using a trumpet.", "honkytones.advancements.keyboard.title": "Classic", "honkytones.advancements.keyboard.description": "Craft a keyboard.", "honkytones.advancements.enchantment.title": "Musical projectiles", - "honkytones.advancements.enchantment.description": "Enchant an instrument with the ranged enchantment.", + "honkytones.advancements.enchantment.description": "Get an instrument with the ranged enchantment.", "honkytones.advancements.instrument.description": "Obtain the instrument.", diff --git a/src/main/resources/assets/honkytones/lang/es_ec.json b/src/main/resources/assets/honkytones/lang/es_ec.json index 7b316c8..7426d49 100644 --- a/src/main/resources/assets/honkytones/lang/es_ec.json +++ b/src/main/resources/assets/honkytones/lang/es_ec.json @@ -182,13 +182,13 @@ "honkytones.advancements.root.description": "Obten tu primer instrumento.", - "honkytones.advancements.doot.description": "Toma la trompeta de un esqueleto.", + "honkytones.advancements.doot.description": "Mata un esqueleto con trompeta.", "honkytones.advancements.keyboard.title": "Clasico", "honkytones.advancements.keyboard.description": "Fabrica un teclado.", "honkytones.advancements.enchantment.title": "Proyectiles musicales", - "honkytones.advancements.enchantment.description": "Encanta un instrumento con el encantamiento de rango.", + "honkytones.advancements.enchantment.description": "Obten un instrumento con el encantamiento de rango.", "honkytones.advancements.instrument.description": "Obten el instrumento.",