Last update for now to thresholds
This commit is contained in:
parent
1708216b25
commit
3af12a41d9
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
package dev.zontreck.otemod.items;
|
package dev.zontreck.otemod.items;
|
||||||
|
|
||||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||||
|
import net.minecraft.core.UUIDUtil;
|
||||||
import net.minecraft.core.registries.Registries;
|
import net.minecraft.core.registries.Registries;
|
||||||
import net.minecraft.nbt.*;
|
import net.minecraft.nbt.*;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
@ -18,6 +19,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class PartialItem extends Item
|
public class PartialItem extends Item
|
||||||
{
|
{
|
||||||
|
@ -96,12 +98,14 @@ public class PartialItem extends Item
|
||||||
ItemStack partial = new ItemStack(ModItems.PARTIAL_ITEM.get(), 1);
|
ItemStack partial = new ItemStack(ModItems.PARTIAL_ITEM.get(), 1);
|
||||||
CompoundTag tag = new CompoundTag();
|
CompoundTag tag = new CompoundTag();
|
||||||
Map<Enchantment, Integer> enchants = EnchantmentHelper.getEnchantments(original);
|
Map<Enchantment, Integer> enchants = EnchantmentHelper.getEnchantments(original);
|
||||||
|
partial.setTag(tag);
|
||||||
for(Map.Entry<Enchantment, Integer> entry : enchants.entrySet())
|
for(Map.Entry<Enchantment, Integer> entry : enchants.entrySet())
|
||||||
{
|
{
|
||||||
|
UUIDUtil.createOfflinePlayerUUID()
|
||||||
|
UUID.nameUUIDFromBytes()
|
||||||
partial.enchant(entry.getKey(), entry.getValue());
|
partial.enchant(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
partial.setTag(tag);
|
|
||||||
|
|
||||||
return partial;
|
return partial;
|
||||||
} else return original;
|
} else return original;
|
||||||
|
|
Reference in a new issue