Skip to content

Commit

Permalink
Menu hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubix327 committed May 28, 2022
1 parent 72d1319 commit 222ea79
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/main/java/org/mineacademy/fo/menu/Menu.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.mineacademy.fo.exception.FoException;
import org.mineacademy.fo.menu.button.Button;
import org.mineacademy.fo.menu.button.Button.DummyButton;
import org.mineacademy.fo.menu.button.ButtonReturnBack;
import org.mineacademy.fo.menu.model.InventoryDrawer;
import org.mineacademy.fo.menu.model.ItemCreator;
import org.mineacademy.fo.menu.model.MenuClickLocation;
Expand Down Expand Up @@ -93,10 +92,6 @@ public abstract class Menu {
* Parent menu
*/
private final Menu parent;
/**
* The return button to the previous menu, null if none
*/
private final Button returnButton;
/**
* The registrator responsible for scanning the class and making buttons
* function
Expand Down Expand Up @@ -191,7 +186,6 @@ protected Menu(final Menu parent) {
*/
protected Menu(final Menu parent, final boolean returnMakesNewInstance) {
this.parent = parent;
this.returnButton = parent != null ? new ButtonReturnBack(parent, returnMakesNewInstance) : Button.makeEmpty();
}

/**
Expand Down Expand Up @@ -500,16 +494,16 @@ protected final void redraw() {
/**
* Draws the bottom bar for the player inventory
* Adds the info and the return button.
*
* @deprecated Items are now compiled using {@link #getItemAt}.
*/
@Deprecated
private Map<Integer, ItemStack> compileBottomBar0() {
final Map<Integer, ItemStack> items = new HashMap<>();

if (addInfoButton() && getInfo() != null)
items.put(getInfoButtonPosition(), Button.makeInfo(getInfo()).getItem());

if (addReturnButton() && !(returnButton instanceof DummyButton))
items.put(getReturnButtonPosition(), returnButton.getItem());

return items;
}

Expand Down

0 comments on commit 222ea79

Please sign in to comment.