mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-12-23 01:21:47 +00:00
Fixed NPE when product does not have item meta
This commit is contained in:
parent
51a0813473
commit
787426218b
@ -185,7 +185,7 @@ public class Shop {
|
||||
requirements.put(HologramFormat.Requirement.VENDOR, getVendor().getName());
|
||||
requirements.put(HologramFormat.Requirement.AMOUNT, getProduct().getAmount());
|
||||
requirements.put(HologramFormat.Requirement.ITEM_TYPE, getProduct().getType() + (getProduct().getDurability() > 0 ? ":" + getProduct().getDurability() : ""));
|
||||
requirements.put(HologramFormat.Requirement.ITEM_NAME, getProduct().getItemMeta().getDisplayName());
|
||||
requirements.put(HologramFormat.Requirement.ITEM_NAME, getProduct().hasItemMeta() ? getProduct().getItemMeta().getDisplayName() : null);
|
||||
requirements.put(HologramFormat.Requirement.HAS_ENCHANTMENT, !LanguageUtils.getEnchantmentString(ItemUtils.getEnchantments(getProduct())).isEmpty());
|
||||
requirements.put(HologramFormat.Requirement.BUY_PRICE, getBuyPrice());
|
||||
requirements.put(HologramFormat.Requirement.SELL_PRICE, getSellPrice());
|
||||
|
Loading…
Reference in New Issue
Block a user