From 3af12a41d99079031c614b3a06d7f77465aacd43 Mon Sep 17 00:00:00 2001 From: zontreck Date: Fri, 12 Jul 2024 00:45:56 -0700 Subject: [PATCH] Last update for now to thresholds --- src/main/java/dev/zontreck/otemod/items/PartialItem.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/dev/zontreck/otemod/items/PartialItem.java b/src/main/java/dev/zontreck/otemod/items/PartialItem.java index 838758b..542d099 100644 --- a/src/main/java/dev/zontreck/otemod/items/PartialItem.java +++ b/src/main/java/dev/zontreck/otemod/items/PartialItem.java @@ -1,6 +1,7 @@ package dev.zontreck.otemod.items; import dev.zontreck.libzontreck.util.ChatHelpers; +import net.minecraft.core.UUIDUtil; import net.minecraft.core.registries.Registries; import net.minecraft.nbt.*; import net.minecraft.network.chat.Component; @@ -18,6 +19,7 @@ import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.UUID; public class PartialItem extends Item { @@ -96,12 +98,14 @@ public class PartialItem extends Item ItemStack partial = new ItemStack(ModItems.PARTIAL_ITEM.get(), 1); CompoundTag tag = new CompoundTag(); Map enchants = EnchantmentHelper.getEnchantments(original); + partial.setTag(tag); for(Map.Entry entry : enchants.entrySet()) { + UUIDUtil.createOfflinePlayerUUID() + UUID.nameUUIDFromBytes() partial.enchant(entry.getKey(), entry.getValue()); } - partial.setTag(tag); return partial; } else return original;