checktag can now check non MMOItem tags

This commit is contained in:
ASangarin 2020-08-18 15:26:26 +02:00
parent 799f699647
commit 00d7cbc044

View File

@ -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;
}
}