Fixed changing item bugs with Menu, added Menu#allowsChangingHeldItem
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user