From 40323c57e515fa05ceb72f4d894c9e9eda72ec04 Mon Sep 17 00:00:00 2001 From: D3v1s0m Date: Wed, 9 Aug 2023 12:55:55 +0530 Subject: [PATCH] fix equipment property --- .../znpcsplus/commands/property/PropertySetCommand.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/commands/property/PropertySetCommand.java b/plugin/src/main/java/lol/pyr/znpcsplus/commands/property/PropertySetCommand.java index 1813ea4..335cc16 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/commands/property/PropertySetCommand.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/commands/property/PropertySetCommand.java @@ -3,6 +3,7 @@ package lol.pyr.znpcsplus.commands.property; import com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState; import com.github.retrooper.packetevents.protocol.world.states.type.StateType; import com.github.retrooper.packetevents.protocol.world.states.type.StateTypes; +import io.github.retrooper.packetevents.util.SpigotConversionUtil; import lol.pyr.director.adventure.command.CommandContext; import lol.pyr.director.adventure.command.CommandHandler; import lol.pyr.director.common.command.CommandExecutionException; @@ -16,7 +17,7 @@ import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.Color; import org.bukkit.DyeColor; -import org.bukkit.inventory.ItemStack; +import com.github.retrooper.packetevents.protocol.item.ItemStack; import java.util.Collections; import java.util.List; @@ -42,12 +43,12 @@ public class PropertySetCommand implements CommandHandler { Object value; String valueName; if (type == ItemStack.class) { - ItemStack bukkitStack = context.ensureSenderIsPlayer().getInventory().getItemInHand(); + org.bukkit.inventory.ItemStack bukkitStack = context.ensureSenderIsPlayer().getInventory().getItemInHand(); if (bukkitStack.getAmount() == 0) { value = null; valueName = "EMPTY"; } else { - value = bukkitStack; + value = SpigotConversionUtil.fromBukkitItemStack(bukkitStack); valueName = bukkitStack.toString(); } }