Finish acquiring item-names thru Vault, fixes #195. Bump version number

This commit is contained in:
HappyPikachu 2018-01-01 22:28:02 -05:00
parent 746685b583
commit 567f5dcd8d
6 changed files with 29 additions and 30 deletions

View File

@ -3,11 +3,10 @@
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId> <artifactId>quests</artifactId>
<version>3.1.7</version> <version>3.1.8</version>
<name>quests</name> <name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url> <url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging> <packaging>jar</packaging>
<description></description>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -81,7 +81,7 @@ public class NpcListener implements Listener {
if (hand.hasItemMeta()) { if (hand.hasItemMeta()) {
text += ChatColor.LIGHT_PURPLE + "" + ChatColor.ITALIC + (hand.getItemMeta().hasDisplayName() ? hand.getItemMeta().getDisplayName() + ChatColor.GRAY + " (" : ""); text += ChatColor.LIGHT_PURPLE + "" + ChatColor.ITALIC + (hand.getItemMeta().hasDisplayName() ? hand.getItemMeta().getDisplayName() + ChatColor.GRAY + " (" : "");
} }
text += ChatColor.AQUA + Quester.prettyItemString(hand.getType().name()) + (hand.getDurability() != 0 ? (":" + ChatColor.BLUE + hand.getDurability()) : "") + ChatColor.GRAY; text += ChatColor.AQUA + ItemUtil.getName(hand) + (hand.getDurability() != 0 ? (":" + ChatColor.BLUE + hand.getDurability()) : "") + ChatColor.GRAY;
if (hand.hasItemMeta()) { if (hand.hasItemMeta()) {
text += (hand.getItemMeta().hasDisplayName() ? ")" : ""); text += (hand.getItemMeta().hasDisplayName() ? ")" : "");
} }

View File

@ -200,42 +200,42 @@ public class PlayerListener implements Listener {
Block block = evt.getClickedBlock(); Block block = evt.getClickedBlock();
Location loc = block.getLocation(); Location loc = block.getLocation();
plugin.questFactory.selectedBlockStarts.put(evt.getPlayer().getUniqueId(), block); plugin.questFactory.selectedBlockStarts.put(evt.getPlayer().getUniqueId(), block);
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")"); evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + ItemUtil.getName(new ItemStack(block.getType())) + ChatColor.GOLD + ")");
} else if (plugin.eventFactory.selectedExplosionLocations.containsKey(evt.getPlayer().getUniqueId())) { } else if (plugin.eventFactory.selectedExplosionLocations.containsKey(evt.getPlayer().getUniqueId())) {
Block block = evt.getClickedBlock(); Block block = evt.getClickedBlock();
Location loc = block.getLocation(); Location loc = block.getLocation();
plugin.eventFactory.selectedExplosionLocations.put(evt.getPlayer().getUniqueId(), block); plugin.eventFactory.selectedExplosionLocations.put(evt.getPlayer().getUniqueId(), block);
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")"); evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + ItemUtil.getName(new ItemStack(block.getType())) + ChatColor.GOLD + ")");
} else if (plugin.eventFactory.selectedEffectLocations.containsKey(evt.getPlayer().getUniqueId())) { } else if (plugin.eventFactory.selectedEffectLocations.containsKey(evt.getPlayer().getUniqueId())) {
Block block = evt.getClickedBlock(); Block block = evt.getClickedBlock();
Location loc = block.getLocation(); Location loc = block.getLocation();
plugin.eventFactory.selectedEffectLocations.put(evt.getPlayer().getUniqueId(), block); plugin.eventFactory.selectedEffectLocations.put(evt.getPlayer().getUniqueId(), block);
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")"); evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + ItemUtil.getName(new ItemStack(block.getType())) + ChatColor.GOLD + ")");
} else if (plugin.eventFactory.selectedMobLocations.containsKey(evt.getPlayer().getUniqueId())) { } else if (plugin.eventFactory.selectedMobLocations.containsKey(evt.getPlayer().getUniqueId())) {
Block block = evt.getClickedBlock(); Block block = evt.getClickedBlock();
Location loc = block.getLocation(); Location loc = block.getLocation();
plugin.eventFactory.selectedMobLocations.put(evt.getPlayer().getUniqueId(), block); plugin.eventFactory.selectedMobLocations.put(evt.getPlayer().getUniqueId(), block);
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")"); evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + ItemUtil.getName(new ItemStack(block.getType()))+ ChatColor.GOLD + ")");
} else if (plugin.eventFactory.selectedLightningLocations.containsKey(evt.getPlayer().getUniqueId())) { } else if (plugin.eventFactory.selectedLightningLocations.containsKey(evt.getPlayer().getUniqueId())) {
Block block = evt.getClickedBlock(); Block block = evt.getClickedBlock();
Location loc = block.getLocation(); Location loc = block.getLocation();
plugin.eventFactory.selectedLightningLocations.put(evt.getPlayer().getUniqueId(), block); plugin.eventFactory.selectedLightningLocations.put(evt.getPlayer().getUniqueId(), block);
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")"); evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + ItemUtil.getName(new ItemStack(block.getType())) + ChatColor.GOLD + ")");
} else if (plugin.eventFactory.selectedTeleportLocations.containsKey(evt.getPlayer().getUniqueId())) { } else if (plugin.eventFactory.selectedTeleportLocations.containsKey(evt.getPlayer().getUniqueId())) {
Block block = evt.getClickedBlock(); Block block = evt.getClickedBlock();
Location loc = block.getLocation(); Location loc = block.getLocation();
plugin.eventFactory.selectedTeleportLocations.put(evt.getPlayer().getUniqueId(), block); plugin.eventFactory.selectedTeleportLocations.put(evt.getPlayer().getUniqueId(), block);
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")"); evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + ItemUtil.getName(new ItemStack(block.getType())) + ChatColor.GOLD + ")");
} else if (plugin.questFactory.selectedKillLocations.containsKey(evt.getPlayer().getUniqueId())) { } else if (plugin.questFactory.selectedKillLocations.containsKey(evt.getPlayer().getUniqueId())) {
Block block = evt.getClickedBlock(); Block block = evt.getClickedBlock();
Location loc = block.getLocation(); Location loc = block.getLocation();
plugin.questFactory.selectedKillLocations.put(evt.getPlayer().getUniqueId(), block); plugin.questFactory.selectedKillLocations.put(evt.getPlayer().getUniqueId(), block);
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")"); evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + ItemUtil.getName(new ItemStack(block.getType())) + ChatColor.GOLD + ")");
} else if (plugin.questFactory.selectedReachLocations.containsKey(evt.getPlayer().getUniqueId())) { } else if (plugin.questFactory.selectedReachLocations.containsKey(evt.getPlayer().getUniqueId())) {
Block block = evt.getClickedBlock(); Block block = evt.getClickedBlock();
Location loc = block.getLocation(); Location loc = block.getLocation();
plugin.questFactory.selectedReachLocations.put(evt.getPlayer().getUniqueId(), block); plugin.questFactory.selectedReachLocations.put(evt.getPlayer().getUniqueId(), block);
evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + Quester.prettyItemString(block.getType().name()) + ChatColor.GOLD + ")"); evt.getPlayer().sendMessage(ChatColor.GOLD + Lang.get("questSelectedLocation") + " " + ChatColor.AQUA + loc.getWorld().getName() + ": " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ() + ChatColor.GOLD + " (" + ChatColor.GREEN + ItemUtil.getName(new ItemStack(block.getType())) + ChatColor.GOLD + ")");
} else if (player.isConversing() == false) { } else if (player.isConversing() == false) {
for (final Quest q : plugin.quests) { for (final Quest q : plugin.quests) {
if (q.blockStart != null) { if (q.blockStart != null) {

View File

@ -379,15 +379,15 @@ public class Quest {
} }
} else if (i.getDurability() != 0) { } else if (i.getDurability() != 0) {
if (i.getEnchantments().isEmpty()) { if (i.getEnchantments().isEmpty()) {
player.sendMessage("- " + ChatColor.DARK_GREEN + Quester.prettyItemString(i.getType().name()) + ":" + i.getDurability() + ChatColor.GRAY + " x " + i.getAmount()); player.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ":" + i.getDurability() + ChatColor.GRAY + " x " + i.getAmount());
} else { } else {
player.sendMessage("- " + ChatColor.DARK_GREEN + Quester.prettyItemString(i.getType().name()) + ":" + i.getDurability() + ChatColor.GRAY + " x " + i.getAmount() + ChatColor.DARK_PURPLE + " " + Lang.get("enchantedItem")); player.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ":" + i.getDurability() + ChatColor.GRAY + " x " + i.getAmount() + ChatColor.DARK_PURPLE + " " + Lang.get("enchantedItem"));
} }
} else { } else {
if (i.getEnchantments().isEmpty()) { if (i.getEnchantments().isEmpty()) {
player.sendMessage("- " + ChatColor.DARK_GREEN + Quester.prettyItemString(i.getType().name()) + ChatColor.GRAY + " x " + i.getAmount()); player.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ChatColor.GRAY + " x " + i.getAmount());
} else { } else {
player.sendMessage("- " + ChatColor.DARK_GREEN + Quester.prettyItemString(i.getType().name()) + ChatColor.GRAY + " x " + i.getAmount() + ChatColor.DARK_PURPLE + " " + Lang.get("enchantedItem")); player.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ChatColor.GRAY + " x " + i.getAmount() + ChatColor.DARK_PURPLE + " " + Lang.get("enchantedItem"));
} }
} }
none = null; none = null;
@ -401,15 +401,15 @@ public class Quest {
} }
} else if (i.getDurability() != 0) { } else if (i.getDurability() != 0) {
if (i.getEnchantments().isEmpty()) { if (i.getEnchantments().isEmpty()) {
player.sendMessage("- " + ChatColor.DARK_GREEN + Quester.prettyItemString(i.getType().name()) + ":" + i.getDurability() + ChatColor.GRAY + " x " + i.getAmount()); player.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ":" + i.getDurability() + ChatColor.GRAY + " x " + i.getAmount());
} else { } else {
player.sendMessage("- " + ChatColor.DARK_GREEN + Quester.prettyItemString(i.getType().name()) + ":" + i.getDurability() + ChatColor.GRAY + " x " + i.getAmount() + ChatColor.DARK_PURPLE + " " + Lang.get("enchantedItem")); player.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ":" + i.getDurability() + ChatColor.GRAY + " x " + i.getAmount() + ChatColor.DARK_PURPLE + " " + Lang.get("enchantedItem"));
} }
} else { } else {
if (i.getEnchantments().isEmpty()) { if (i.getEnchantments().isEmpty()) {
player.sendMessage("- " + ChatColor.DARK_GREEN + Quester.prettyItemString(i.getType().name()) + ChatColor.GRAY + " x " + i.getAmount()); player.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ChatColor.GRAY + " x " + i.getAmount());
} else { } else {
player.sendMessage("- " + ChatColor.DARK_GREEN + Quester.prettyItemString(i.getType().name()) + ChatColor.GRAY + " x " + i.getAmount() + ChatColor.DARK_PURPLE + " " + Lang.get("enchantedItem")); player.sendMessage("- " + ChatColor.DARK_GREEN + ItemUtil.getName(i) + ChatColor.GRAY + " x " + i.getAmount() + ChatColor.DARK_PURPLE + " " + Lang.get("enchantedItem"));
} }
} }
none = null; none = null;

View File

@ -468,12 +468,12 @@ public class Quester {
if (enchantment2 == enchantment) { if (enchantment2 == enchantment) {
if (num1 < num2) { if (num1 < num2) {
String obj = Lang.get("enchantItem"); String obj = Lang.get("enchantItem");
obj = obj.replaceAll("<item>", Quester.prettyItemString(mat.name())); obj = obj.replaceAll("<item>", ItemUtil.getName(new ItemStack(mat)));
obj = obj.replaceAll("<enchantment>", Quester.prettyEnchantmentString(enchantment)); obj = obj.replaceAll("<enchantment>", Quester.prettyEnchantmentString(enchantment));
unfinishedObjectives.add(ChatColor.GREEN + obj + ChatColor.GREEN + ": " + num1 + "/" + num2); unfinishedObjectives.add(ChatColor.GREEN + obj + ChatColor.GREEN + ": " + num1 + "/" + num2);
} else { } else {
String obj = Lang.get("enchantItem"); String obj = Lang.get("enchantItem");
obj = obj.replaceAll("<item>", Quester.prettyItemString(mat.name())); obj = obj.replaceAll("<item>", ItemUtil.getName(new ItemStack(mat)));
obj = obj.replaceAll("<enchantment>", Quester.prettyEnchantmentString(enchantment)); obj = obj.replaceAll("<enchantment>", Quester.prettyEnchantmentString(enchantment));
finishedObjectives.add(ChatColor.GRAY + obj + ChatColor.GRAY + ": " + num1 + "/" + num2); finishedObjectives.add(ChatColor.GRAY + obj + ChatColor.GRAY + ": " + num1 + "/" + num2);
} }
@ -1074,7 +1074,7 @@ public class Quester {
quest.nextStage(this); quest.nextStage(this);
} }
} else if (objective.equalsIgnoreCase("breakBlock")) { } else if (objective.equalsIgnoreCase("breakBlock")) {
String message = ChatColor.GREEN + "(" + Lang.get("completed") + ") " + Lang.get("break") + " " + prettyItemString(material.getType().name()); String message = ChatColor.GREEN + "(" + Lang.get("completed") + ") " + Lang.get("break") + " " + ItemUtil.getName(material);
String stack = getQuestData(quest).blocksBroken.toString(); String stack = getQuestData(quest).blocksBroken.toString();
String amount = stack.substring(stack.lastIndexOf(" x ") + 3).replace("}]", ""); String amount = stack.substring(stack.lastIndexOf(" x ") + 3).replace("}]", "");
message = message + " " + amount + "/" + amount; message = message + " " + amount + "/" + amount;
@ -1083,7 +1083,7 @@ public class Quester {
quest.nextStage(this); quest.nextStage(this);
} }
} else if (objective.equalsIgnoreCase("damageBlock")) { } else if (objective.equalsIgnoreCase("damageBlock")) {
String message = ChatColor.GREEN + "(" + Lang.get("completed") + ") " + Lang.get("damage") + " " + prettyItemString(material.getType().name()); String message = ChatColor.GREEN + "(" + Lang.get("completed") + ") " + Lang.get("damage") + " " + ItemUtil.getName(material);
String stack = getQuestData(quest).blocksDamaged.toString(); String stack = getQuestData(quest).blocksDamaged.toString();
String amount = stack.substring(stack.lastIndexOf(" x ") + 3).replace("}]", ""); String amount = stack.substring(stack.lastIndexOf(" x ") + 3).replace("}]", "");
message = message + " " + amount + "/" + amount; message = message + " " + amount + "/" + amount;
@ -1091,7 +1091,7 @@ public class Quester {
quest.nextStage(this); quest.nextStage(this);
} }
} else if (objective.equalsIgnoreCase("placeBlock")) { } else if (objective.equalsIgnoreCase("placeBlock")) {
String message = ChatColor.GREEN + "(" + Lang.get("completed") + ") " + Lang.get("place") + " " + prettyItemString(material.getType().name()); String message = ChatColor.GREEN + "(" + Lang.get("completed") + ") " + Lang.get("place") + " " + ItemUtil.getName(material);
String stack = getQuestData(quest).blocksPlaced.toString(); String stack = getQuestData(quest).blocksPlaced.toString();
String amount = stack.substring(stack.lastIndexOf(" x ") + 3).replace("}]", ""); String amount = stack.substring(stack.lastIndexOf(" x ") + 3).replace("}]", "");
message = message + " " + amount + "/" + amount; message = message + " " + amount + "/" + amount;
@ -1100,7 +1100,7 @@ public class Quester {
quest.nextStage(this); quest.nextStage(this);
} }
} else if (objective.equalsIgnoreCase("useBlock")) { } else if (objective.equalsIgnoreCase("useBlock")) {
String message = ChatColor.GREEN + "(" + Lang.get("completed") + ") " + Lang.get("use") + " " + prettyItemString(material.getType().name()); String message = ChatColor.GREEN + "(" + Lang.get("completed") + ") " + Lang.get("use") + " " + ItemUtil.getName(material);
String stack = getQuestData(quest).blocksUsed.toString(); String stack = getQuestData(quest).blocksUsed.toString();
String amount = stack.substring(stack.lastIndexOf(" x ") + 3).replace("}]", ""); String amount = stack.substring(stack.lastIndexOf(" x ") + 3).replace("}]", "");
message = message + " " + amount + "/" + amount; message = message + " " + amount + "/" + amount;
@ -1109,7 +1109,7 @@ public class Quester {
quest.nextStage(this); quest.nextStage(this);
} }
} else if (objective.equalsIgnoreCase("cutBlock")) { } else if (objective.equalsIgnoreCase("cutBlock")) {
String message = ChatColor.GREEN + "(" + Lang.get("completed") + ") " + Lang.get("cut") + " " + prettyItemString(material.getType().name()); String message = ChatColor.GREEN + "(" + Lang.get("completed") + ") " + Lang.get("cut") + " " + ItemUtil.getName(material);
String stack = getQuestData(quest).blocksCut.toString(); String stack = getQuestData(quest).blocksCut.toString();
String amount = stack.substring(stack.lastIndexOf(" x ") + 3).replace("}]", ""); String amount = stack.substring(stack.lastIndexOf(" x ") + 3).replace("}]", "");
message = message + " " + amount + "/" + amount; message = message + " " + amount + "/" + amount;
@ -1126,7 +1126,7 @@ public class Quester {
} }
} else if (objective.equalsIgnoreCase("enchantItem")) { } else if (objective.equalsIgnoreCase("enchantItem")) {
String obj = Lang.get("enchantItem"); String obj = Lang.get("enchantItem");
obj = obj.replaceAll("<item>", prettyItemString(material.getType().name())); obj = obj.replaceAll("<item>", ItemUtil.getName(material));
obj = obj.replaceAll("<enchantment>", Quester.prettyEnchantmentString(enchantment)); obj = obj.replaceAll("<enchantment>", Quester.prettyEnchantmentString(enchantment));
String message = ChatColor.GREEN + "(" + Lang.get("completed") + ") " + obj; String message = ChatColor.GREEN + "(" + Lang.get("completed") + ") " + obj;
for (Map<Enchantment, Material> map : getCurrentStage(quest).itemsToEnchant.keySet()) { for (Map<Enchantment, Material> map : getCurrentStage(quest).itemsToEnchant.keySet()) {
@ -1500,7 +1500,7 @@ public class Quester {
return capitalized; return capitalized;
} }
// TODO eliminate and replace all with Items.itemByType(is.getType()).getName() // NOTE: Use ItemUtil.getString(itemStack) instead if possible
public static String prettyItemString(String itemName) { public static String prettyItemString(String itemName) {
String baseString = Material.matchMaterial(itemName).toString(); String baseString = Material.matchMaterial(itemName).toString();
String[] substrings = baseString.split("_"); String[] substrings = baseString.split("_");

View File

@ -161,7 +161,7 @@ public class ItemUtil {
if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) { if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) {
text = "" + ChatColor.DARK_AQUA + ChatColor.ITALIC + is.getItemMeta().getDisplayName() + ChatColor.RESET + ChatColor.AQUA + " x " + is.getAmount(); text = "" + ChatColor.DARK_AQUA + ChatColor.ITALIC + is.getItemMeta().getDisplayName() + ChatColor.RESET + ChatColor.AQUA + " x " + is.getAmount();
} else { } else {
text = ChatColor.AQUA + Quester.prettyItemString(is.getType().name()); text = ChatColor.AQUA + getName(is);
if (is.getDurability() != 0) { if (is.getDurability() != 0) {
text += ChatColor.AQUA + ":" + is.getDurability(); text += ChatColor.AQUA + ":" + is.getDurability();
} }
@ -178,7 +178,7 @@ public class ItemUtil {
if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) { if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) {
text = "" + ChatColor.DARK_AQUA + ChatColor.ITALIC + is.getItemMeta().getDisplayName() + ChatColor.RESET + ChatColor.AQUA + " x " + is.getAmount(); text = "" + ChatColor.DARK_AQUA + ChatColor.ITALIC + is.getItemMeta().getDisplayName() + ChatColor.RESET + ChatColor.AQUA + " x " + is.getAmount();
} else { } else {
text = ChatColor.AQUA + Quester.prettyItemString(is.getType().name()); text = ChatColor.AQUA + getName(is);
if (is.getDurability() != 0) { if (is.getDurability() != 0) {
text += ChatColor.AQUA + ":" + is.getDurability(); text += ChatColor.AQUA + ":" + is.getDurability();
} }