geforkt von Mirrors/Paper
check if sender is a player in paper dumpitem command, closes #5858
Dieser Commit ist enthalten in:
Ursprung
a59f42457c
Commit
a716afea03
@ -51,6 +51,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Paper config reload complete.");
|
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Paper config reload complete.");
|
||||||
}
|
}
|
||||||
+ private void doDumpItem(CommandSender sender) {
|
+ private void doDumpItem(CommandSender sender) {
|
||||||
|
+ if (!(sender instanceof Player)) {
|
||||||
|
+ sender.sendMessage("Only players can use this command");
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
+ ItemStack itemInHand = ((CraftPlayer) sender).getItemInHand();
|
+ ItemStack itemInHand = ((CraftPlayer) sender).getItemInHand();
|
||||||
+ net.minecraft.world.item.ItemStack itemStack = CraftItemStack.asNMSCopy(itemInHand);
|
+ net.minecraft.world.item.ItemStack itemStack = CraftItemStack.asNMSCopy(itemInHand);
|
||||||
+ net.minecraft.nbt.CompoundTag tag = itemStack.getTag();
|
+ net.minecraft.nbt.CompoundTag tag = itemStack.getTag();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren