From d075e748ed1ee964af73cd863b2abd3266f832b6 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Mon, 7 Dec 2020 18:10:22 -0800 Subject: [PATCH] colorful itemdump --- .../0511-Paper-dumpitem-command.patch | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/0511-Paper-dumpitem-command.patch b/Spigot-Server-Patches/0511-Paper-dumpitem-command.patch index 179527e475..5fd01d1ab2 100644 --- a/Spigot-Server-Patches/0511-Paper-dumpitem-command.patch +++ b/Spigot-Server-Patches/0511-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 a12bc81933c15606b7cde46937f504eafc4ff030..d798de637389cc5d5289a6c75304de307b01f493 100644 +index f60800c3bc06a38493e17b00b815f18cb87cc8bf..196648e65c6f58c18e19623474d69d780d542689 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -21,7 +21,9 @@ import org.bukkit.command.CommandSender; @@ -55,7 +55,7 @@ index a12bc81933c15606b7cde46937f504eafc4ff030..d798de637389cc5d5289a6c75304de30 + net.minecraft.server.ItemStack itemStack = CraftItemStack.asNMSCopy(itemInHand); + NBTTagCompound tag = itemStack.getTag(); + if (tag != null) { -+ String nbt = tag.toString(); ++ String nbt = org.bukkit.craftbukkit.util.CraftChatMessage.fromComponent(tag.getNbtPrettyComponent()); + Bukkit.getConsoleSender().sendMessage(nbt); + sender.sendMessage(nbt); + } else { @@ -66,3 +66,15 @@ index a12bc81933c15606b7cde46937f504eafc4ff030..d798de637389cc5d5289a6c75304de30 private void doFixLight(CommandSender sender, String[] args) { if (!(sender instanceof Player)) { sender.sendMessage("Only players can use this command"); +diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java +index 8b9e47b4c7f5dc464fa617a59583df9e30a54045..104b820ee380083ec755c443a4a9c270e525ca45 100644 +--- a/src/main/java/net/minecraft/server/NBTBase.java ++++ b/src/main/java/net/minecraft/server/NBTBase.java +@@ -24,6 +24,7 @@ public interface NBTBase { + return this.toString(); + } + ++ default IChatBaseComponent getNbtPrettyComponent() { return this.l(); } // Paper - OBFHELPER + default IChatBaseComponent l() { + return this.a("", 0); + }