From 1708216b252caf12239e2edd85cd2dbb74c58003 Mon Sep 17 00:00:00 2001 From: zontreck Date: Tue, 7 May 2024 19:35:03 -0700 Subject: [PATCH] HotFix to PartialItem --- gradle.properties | 2 +- src/main/java/dev/zontreck/otemod/items/PartialItem.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index bca5933..0b7979c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -47,7 +47,7 @@ mod_name=Thresholds # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=GPLv3 # The mod version. See https://semver.org/ -mod_version=1201.4.050724.1919 +mod_version=1201.4.050724.1934 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/dev/zontreck/otemod/items/PartialItem.java b/src/main/java/dev/zontreck/otemod/items/PartialItem.java index 66bd5f8..838758b 100644 --- a/src/main/java/dev/zontreck/otemod/items/PartialItem.java +++ b/src/main/java/dev/zontreck/otemod/items/PartialItem.java @@ -95,7 +95,11 @@ public class PartialItem extends Item { ItemStack partial = new ItemStack(ModItems.PARTIAL_ITEM.get(), 1); CompoundTag tag = new CompoundTag(); - tag.put(ItemStack.TAG_ENCH, original.getTag().get(ItemStack.TAG_ENCH)); + Map enchants = EnchantmentHelper.getEnchantments(original); + for(Map.Entry entry : enchants.entrySet()) + { + partial.enchant(entry.getKey(), entry.getValue()); + } partial.setTag(tag);