diff --git a/patches/server/0470-Paper-dumpitem-command.patch b/patches/server/0470-Paper-dumpitem-command.patch index 22793d827..76a52b98a 100644 --- a/patches/server/0470-Paper-dumpitem-command.patch +++ b/patches/server/0470-Paper-dumpitem-command.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Paper dumpitem command Let's you quickly view the item in your hands NBT data diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index de45163023f436d386e90e6ded5e6105ba3ecf35..8fdfcf001cf2ed6184d86ee033ede08fdf9aa5d6 100644 +index de45163023f436d386e90e6ded5e6105ba3ecf35..160f3cdee21d8a3aa2ed726a7fbfce460dff26f3 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -20,6 +20,7 @@ import net.minecraft.server.level.ServerPlayer; @@ -46,11 +46,15 @@ index de45163023f436d386e90e6ded5e6105ba3ecf35..8fdfcf001cf2ed6184d86ee033ede08f case "debug": doDebug(sender, args); break; -@@ -466,6 +472,19 @@ public class PaperCommand extends Command { +@@ -466,6 +472,23 @@ public class PaperCommand extends Command { 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();