mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 20:07:41 +01:00
check if sender is a player in paper dumpitem command, closes #5858
This commit is contained in:
parent
a59f42457c
commit
a716afea03
@ -51,6 +51,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Paper config reload complete.");
|
||||
}
|
||||
+ private void doDumpItem(CommandSender sender) {
|
||||
+ if (!(sender instanceof Player)) {
|
||||
+ sender.sendMessage("Only players can use this command");
|
||||
+ return;
|
||||
+ }
|
||||
+ ItemStack itemInHand = ((CraftPlayer) sender).getItemInHand();
|
||||
+ net.minecraft.world.item.ItemStack itemStack = CraftItemStack.asNMSCopy(itemInHand);
|
||||
+ net.minecraft.nbt.CompoundTag tag = itemStack.getTag();
|
||||
|
Loading…
Reference in New Issue
Block a user