From 00d7cbc044db2fb3dc99f6c1fd774ce61d405b78 Mon Sep 17 00:00:00 2001 From: ASangarin Date: Tue, 18 Aug 2020 15:26:26 +0200 Subject: [PATCH] checktag can now check non MMOItem tags --- .../command/mmoitems/debug/CheckTagCommandTreeNode.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/Indyuce/mmoitems/command/mmoitems/debug/CheckTagCommandTreeNode.java b/src/main/java/net/Indyuce/mmoitems/command/mmoitems/debug/CheckTagCommandTreeNode.java index 043c0445..f26c419e 100644 --- a/src/main/java/net/Indyuce/mmoitems/command/mmoitems/debug/CheckTagCommandTreeNode.java +++ b/src/main/java/net/Indyuce/mmoitems/command/mmoitems/debug/CheckTagCommandTreeNode.java @@ -24,11 +24,12 @@ public class CheckTagCommandTreeNode extends CommandTreeNode { } Player player = (Player) sender; + String tag = args[2].contains("#") ? args[2].substring(1) : "MMOITEMS_" + args[2]; NBTItem item = MMOLib.plugin.getVersion().getWrapper().getNBTItem(player.getInventory().getItemInMainHand()); player.sendMessage(ChatColor.DARK_GRAY + "" + ChatColor.STRIKETHROUGH + "--------------------------------------------------"); - player.sendMessage(ChatColor.AQUA + "Boolean = " + ChatColor.RESET + item.getBoolean("MMOITEMS_" + args[2].toUpperCase().replace("-", "_"))); - player.sendMessage(ChatColor.AQUA + "Double = " + ChatColor.RESET + item.getDouble("MMOITEMS_" + args[2].toUpperCase().replace("-", "_"))); - player.sendMessage(ChatColor.AQUA + "String = " + ChatColor.RESET + item.getString("MMOITEMS_" + args[2].toUpperCase().replace("-", "_"))); + player.sendMessage(ChatColor.AQUA + "Boolean = " + ChatColor.RESET + item.getBoolean(tag.toUpperCase().replace("-", "_"))); + player.sendMessage(ChatColor.AQUA + "Double = " + ChatColor.RESET + item.getDouble(tag.toUpperCase().replace("-", "_"))); + player.sendMessage(ChatColor.AQUA + "String = " + ChatColor.RESET + item.getString(tag.toUpperCase().replace("-", "_"))); return CommandResult.SUCCESS; } }