Skip to content

GuiWindow

WolfyScript edited this page Apr 15, 2021 · 7 revisions

They contain local Buttons and manage the logic to render the Buttons into the inventory.
They are very similar to the GuiCluster and you need to create a class and extend it.

public class YourWindow extends GuiWindow<YourCache> {

    public YourWindow(GuiCluster<YourCache> guiCluster, String key, int size) {
        super(guiCluster, key, size);
    }

    @Override
    public void onInit() {
        //Called on initialization. Used to register Buttons.
        registerButton();
    }

    @Override
    public void onUpdateSync(GuiUpdate<YourCache> guiUpdate) {
        //Updated sync
    }

    @Override
    public void onUpdateAsync(GuiUpdate<YourCache> update) {
        //Updated async
    }

}

To make it easier to access the data of the one who caused the Update there is the GuiUpdate class.

| Home

| GUIs

| NBT Tools

Clone this wiki locally