mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-24 17:39:52 -05:00
Check if item has ItemMeta to prevent NPE
Former-commit-id: 68bda3b78905fcd1103f63c2bb4555d6f6b4e4fe
This commit is contained in:
1 parent
e0aa49e35d
commit
b34f21c237
1 file changed
+2
-2
@@ -830,11 +830,11 @@ public class MsgUtil {
|
||||
}
|
||||
|
||||
private static void printEnchantment(@NotNull Player p, @NotNull Shop shop, ChatSheetPrinter chatSheetPrinter) {
|
||||
if (shop.getItem().getItemMeta().hasItemFlag(ItemFlag.HIDE_ENCHANTS) && plugin.getConfig().getBoolean("respect-item-flag")) {
|
||||
if (shop.getItem().hasItemMeta()&&shop.getItem().getItemMeta().hasItemFlag(ItemFlag.HIDE_ENCHANTS) && plugin.getConfig().getBoolean("respect-item-flag")) {
|
||||
return;
|
||||
}
|
||||
Map<Enchantment, Integer> enchs = new HashMap<>();
|
||||
if (shop.getItem().hasItemMeta()&& Objects.requireNonNull(shop.getItem().getItemMeta()).hasEnchants()) {
|
||||
if (shop.getItem().hasItemMeta()&& shop.getItem().getItemMeta().hasEnchants()) {
|
||||
enchs = shop.getItem().getItemMeta().getEnchants();
|
||||
}
|
||||
if (!enchs.isEmpty()) {
|
||||
|
||||
Reference in new issue
Block a user