From 4e0673ffb50551d8710a31021dadde2f99934a23 Mon Sep 17 00:00:00 2001 From: btwonion Date: Thu, 15 Aug 2024 17:25:19 +0200 Subject: [PATCH] fix telekinesis not enchantable in et --- build.gradle.kts | 2 +- changelog.md | 3 +-- .../dev/nyon/telekinesis/TelekinesisEnchantmentGenerator.kt | 5 +++-- .../{in_enchanting_table.json => non_treasure.json} | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename versions/1.21/src/main/generated/data/minecraft/tags/enchantment/{in_enchanting_table.json => non_treasure.json} (100%) diff --git a/build.gradle.kts b/build.gradle.kts index 7ee0ab7..d72299b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ plugins { } val beta: Int? = null // Pattern is '1.0.0-beta1-1.20.6-pre.2' -val featureVersion = "3.0.2${if (beta != null) "-beta$beta" else ""}" +val featureVersion = "3.0.3${if (beta != null) "-beta$beta" else ""}" val mcVersion = property("mcVersion")!!.toString() val mcVersionRange = property("mcVersionRange")!!.toString() version = "$featureVersion-$mcVersion" diff --git a/changelog.md b/changelog.md index fe13692..fa9ebf3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,2 +1 @@ -- fix enchantment not tradeable in >=1.20.6 -- use yacl 3.5.x for config creation \ No newline at end of file +- fix enchantment not enchantable in enchanting table in >=1.20.6 \ No newline at end of file diff --git a/src/main/kotlin/dev/nyon/telekinesis/TelekinesisEnchantmentGenerator.kt b/src/main/kotlin/dev/nyon/telekinesis/TelekinesisEnchantmentGenerator.kt index 33b1225..23d04fd 100644 --- a/src/main/kotlin/dev/nyon/telekinesis/TelekinesisEnchantmentGenerator.kt +++ b/src/main/kotlin/dev/nyon/telekinesis/TelekinesisEnchantmentGenerator.kt @@ -36,13 +36,14 @@ private class TelekinesisEnchantmentTagProvider( ) : EnchantmentTagProvider(output, completableFuture) { override fun addTags(registries: HolderLookup.Provider) { fun minecraftTagKey(value: String): TagKey = TagKey.create(Registries.ENCHANTMENT, ResourceLocation.fromNamespaceAndPath("minecraft", value)) + val enchantmentResourceKey = ResourceKey.create(Registries.ENCHANTMENT, telekinesisEnchantmentId) listOf( getOrCreateTagBuilder(telekinesisEffectId), getOrCreateTagBuilder(minecraftTagKey("tradeable")), getOrCreateTagBuilder(minecraftTagKey("treasure")), - getOrCreateTagBuilder(minecraftTagKey("in_enchanting_table")) + getOrCreateTagBuilder(minecraftTagKey("non_treasure")) ).forEach { - it.add(telekinesisEnchantmentId) + it.addOptional(enchantmentResourceKey) } } } diff --git a/versions/1.21/src/main/generated/data/minecraft/tags/enchantment/in_enchanting_table.json b/versions/1.21/src/main/generated/data/minecraft/tags/enchantment/non_treasure.json similarity index 100% rename from versions/1.21/src/main/generated/data/minecraft/tags/enchantment/in_enchanting_table.json rename to versions/1.21/src/main/generated/data/minecraft/tags/enchantment/non_treasure.json