Last update for now to thresholds

This commit is contained in:
zontreck 2024-07-12 00:45:56 -07:00
parent 1708216b25
commit 3af12a41d9

View file

@ -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<Enchantment, Integer> enchants = EnchantmentHelper.getEnchantments(original);
partial.setTag(tag);
for(Map.Entry<Enchantment, Integer> entry : enchants.entrySet())
{
UUIDUtil.createOfflinePlayerUUID()
UUID.nameUUIDFromBytes()
partial.enchant(entry.getKey(), entry.getValue());
}
partial.setTag(tag);
return partial;
} else return original;