properly check for name spaced keys

This commit is contained in:
Ryder Belserion 2024-10-31 12:03:29 -04:00
parent 565f0295c9
commit 78c98d3c91
No known key found for this signature in database

View File

@ -118,14 +118,13 @@ public class ExpiredMenu extends Holder {
final PersistentDataContainerView container = itemStack.getPersistentDataContainer();
if (!container.has(Keys.auction_button.getNamespacedKey())) return;
final Player player = (Player) event.getWhoClicked();
if (container.has(Keys.auction_button.getNamespacedKey())) {
final String type = container.getOrDefault(Keys.auction_button.getNamespacedKey(), PersistentDataType.STRING, "");
if (type.isEmpty()) return;
final Player player = (Player) event.getWhoClicked();
switch (type) {
case "Back" -> {
menu.click(player);
@ -215,6 +214,7 @@ public class ExpiredMenu extends Holder {
return;
}
}
}
if (Methods.isInvFull(player)) { // run this here obviously as well
player.sendMessage(Messages.INVENTORY_FULL.getMessage(player));