Merge pull request #82 from D3v1s0m/modular-property-system
fixed equipment property
This commit is contained in:
commit
622d6efd42
1 changed files with 4 additions and 3 deletions
|
@ -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.WrappedBlockState;
|
||||||
import com.github.retrooper.packetevents.protocol.world.states.type.StateType;
|
import com.github.retrooper.packetevents.protocol.world.states.type.StateType;
|
||||||
import com.github.retrooper.packetevents.protocol.world.states.type.StateTypes;
|
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.CommandContext;
|
||||||
import lol.pyr.director.adventure.command.CommandHandler;
|
import lol.pyr.director.adventure.command.CommandHandler;
|
||||||
import lol.pyr.director.common.command.CommandExecutionException;
|
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 net.kyori.adventure.text.format.NamedTextColor;
|
||||||
import org.bukkit.Color;
|
import org.bukkit.Color;
|
||||||
import org.bukkit.DyeColor;
|
import org.bukkit.DyeColor;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import com.github.retrooper.packetevents.protocol.item.ItemStack;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -42,12 +43,12 @@ public class PropertySetCommand implements CommandHandler {
|
||||||
Object value;
|
Object value;
|
||||||
String valueName;
|
String valueName;
|
||||||
if (type == ItemStack.class) {
|
if (type == ItemStack.class) {
|
||||||
ItemStack bukkitStack = context.ensureSenderIsPlayer().getInventory().getItemInHand();
|
org.bukkit.inventory.ItemStack bukkitStack = context.ensureSenderIsPlayer().getInventory().getItemInHand();
|
||||||
if (bukkitStack.getAmount() == 0) {
|
if (bukkitStack.getAmount() == 0) {
|
||||||
value = null;
|
value = null;
|
||||||
valueName = "EMPTY";
|
valueName = "EMPTY";
|
||||||
} else {
|
} else {
|
||||||
value = bukkitStack;
|
value = SpigotConversionUtil.fromBukkitItemStack(bukkitStack);
|
||||||
valueName = bukkitStack.toString();
|
valueName = bukkitStack.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue