13
0
geforkt von Mirrors/Paper

check if sender is a player in paper dumpitem command, closes #5858

Dieser Commit ist enthalten in:
MiniDigger | Martin 2021-06-17 20:13:55 +02:00
Ursprung a59f42457c
Commit a716afea03

Datei anzeigen

@ -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();