Skip to content

Commit

Permalink
Fix advancements
Browse files Browse the repository at this point in the history
  • Loading branch information
EngineMachiner committed Sep 29, 2024
1 parent 938d3b6 commit 1f65bea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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
Expand Down Expand Up @@ -176,14 +175,13 @@ class Advancements( output: FabricDataOutput ) : FabricAdvancementProvider(outpu

override fun conditions(): AbstractCriterionConditions {

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()

return EnchantedItemCriterion.Conditions( player, itemPredicate, range )
return InventoryChangedCriterion.Conditions.items(predicate)

}

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/honkytones/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/honkytones/lang/es_ec.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",

Expand Down

0 comments on commit 1f65bea

Please sign in to comment.