Warn console when using old Vault versions. Bump version number

This commit is contained in:
HappyPikachu 2016-12-26 15:26:48 -05:00
parent 50b32d5f3e
commit ef9297910c
2 changed files with 9 additions and 3 deletions

View File

@ -3,7 +3,7 @@
<groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId>
<version>2.7.4</version>
<version>2.7.5</version>
<name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging>

View File

@ -7,6 +7,7 @@ import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import net.milkbowl.vault.item.Items;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
@ -212,12 +213,17 @@ public class ItemUtil implements ColorUtil {
public static String getName(ItemStack is) {
String text;
String text = "";
if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) {
text = "" + DARKAQUA + ITALIC + is.getItemMeta().getDisplayName();
} else {
text = AQUA + Items.itemByStack(is).getName();
try {
text = AQUA + Items.itemByStack(is).getName();
} catch (NullPointerException ne) {
Bukkit.getLogger().severe("This error is caused by an incompatible version of Vault. Please update!");
ne.printStackTrace();
}
}
return text;