Fixed changing item bugs with Menu, added Menu#allowsChangingHeldItem

This commit is contained in:
Auxilor
2022-10-01 22:24:24 +01:00
parent 0eba82b221
commit bc22adae84
5 changed files with 70 additions and 16 deletions

View File

@@ -162,6 +162,15 @@ public interface Menu {
*/
void refresh(@NotNull Player player);
/**
* If the menu allows changing the held item.
*
* @return If allowed.
*/
default boolean allowsChangingHeldItem() {
return false;
}
/**
* Call a menu event.
*

View File

@@ -186,6 +186,15 @@ public interface MenuBuilder extends PageBuilder {
return this;
}
/**
* Allow the player to change their held item.
*
* @return The builder.
*/
default MenuBuilder allowChangingHeldItem() {
return this;
}
/**
* Build the menu.
*