Cleaned up Menu API

This commit is contained in:
Auxilor
2022-11-08 18:11:27 +00:00
parent d3a7ef72e8
commit d5ddcaea4b
5 changed files with 29 additions and 11 deletions

View File

@@ -63,11 +63,29 @@ public interface Menu {
* @param player The player
* @param menu The menu.
* @return The slot.
* @deprecated Menu shouldn't be a parameter.
*/
default Slot getSlot(int row,
int column,
@NotNull Player player,
@NotNull Menu menu) {
@Deprecated(since = "6.46.0", forRemoval = true)
default Slot getSlot(final int row,
final int column,
@NotNull final Player player,
@NotNull final Menu menu) {
return this.getSlot(row, column, player);
}
/**
* Get a slot at a given row and column.
* <p>
* Defaults to static slot if no reactive slot exists.
*
* @param row The row.
* @param column The column.
* @param player The player
* @return The slot.
*/
default Slot getSlot(final int row,
final int column,
@NotNull final Player player) {
return this.getSlot(row, column);
}

View File

@@ -83,7 +83,7 @@ public final class Page implements GUIComponent {
delegate = Eco.get().blendMenuState(page, menu);
}
return page.getSlot(row, column, player, delegate);
return page.getSlot(row, column, player);
}
@Override