Fix utility buttons not being added properly

This commit is contained in:
zontreck 2024-01-10 03:13:59 -07:00
parent ee0c98ee51
commit 898a9b37f0
3 changed files with 32 additions and 4 deletions

View file

@ -32,14 +32,19 @@ public class ChestGUI
public List<ChestGUIButton> buttons = new ArrayList<>();
private ChestGUIIdentifier id;
private int page =0;
private boolean hasAdd = false;
private boolean hasReset = false;
private boolean hasRemove = false;
public boolean hasAdd = false;
public boolean hasReset = false;
public boolean hasRemove = false;
private Runnable onAdd;
private Runnable onReset;
private Runnable onRemove;
public ChestGUIButton addBtn = null;
public ChestGUIButton resetBtn = null;
public ChestGUIButton removeBtn = null;
public ChestGUI withAdd(Runnable onAdd)
{
@ -97,6 +102,8 @@ public class ChestGUI
onRemove.run();
}, new Vector2i(2, 3));
removeBtn = rem;
container.setStackInSlot(rem.getSlotNum(), rem.buildIcon());
}
@ -108,6 +115,8 @@ public class ChestGUI
onReset.run();
}, new Vector2i(2, 4));
resetBtn = rem;
container.setStackInSlot(rem.getSlotNum(), rem.buildIcon());
}
@ -121,6 +130,8 @@ public class ChestGUI
onAdd.run();
}, new Vector2i(2, 5));
addBtn = rem;
container.setStackInSlot(rem.getSlotNum(), rem.buildIcon());
}
}