#Self Proclaimed inventory Genius Stumped WIth Inventories truly Tragic

1 messages · Page 1 of 1 (latest)

flint pulsar
#

I'm kinda stumped here. And with Inventories of all things pepesob .

Anyways with my current gui system I end up closing a parent menu to open a child menu

    private fun processRightClick(totemItem: TotemItem, event: InventoryClickEvent) {
        val viewer = viewer();
        val recipeMenu = TotemRecipeMenu(totemItem, this, viewer)
        recipeMenu.open()
    }

For context close() does the following

    public void close() throws IllegalStateException {
        if (this.scene.getBukkitView() == this.viewer.getOpenInventory()) {
            this.viewer.closeInventory();
            PineappleLib.getGuiManager().unregister(this.topInventory);
        }

        throw new IllegalStateException("Attempted to close non-open player gui");
    }

However, when I go back to the old menu using my handleClose handler


    override fun handleClose(event: InventoryCloseEvent) {
        super.handleClose(event)
        totemMenu.open()
    }```
The events stop working?
```java
    public void open() throws IllegalStateException {
        if (this.scene.getBukkitView() == this.viewer.getOpenInventory()) {
            throw new IllegalStateException("Can not re-open same menu twice");
        } else {
            this.decorate();
            PineappleLib.getGuiManager().register(this);
            this.viewer.openInventory(this.scene.getBukkitView());
        }
    }```
I've confirmed no error is thrown
my logs end up printing

[16:12:16] [Server thread/INFO]: Registered: sh.miles.totem.ui.menu.TotemMenu@9f03422 class sh.miles.totem.ui.menu.TotemMenu
[16:12:17] [Server thread/INFO]: Registered: sh.miles.totem.ui.menu.TotemRecipeMenu@5cbbe271 class sh.miles.totem.ui.menu.TotemRecipeMenu
[16:12:17] [Server thread/INFO]: Unregistered: sh.miles.totem.ui.menu.TotemMenu@9f03422 class sh.miles.totem.ui.menu.TotemMenu
[16:12:34] [Server thread/INFO]: Unregistered: sh.miles.totem.ui.menu.TotemRecipeMenu@5cbbe271 class sh.miles.totem.ui.menu.TotemRecipeMenu
[16:12:34] [Server thread/INFO]: Registered: sh.miles.totem.ui.menu.TotemMenu@9f03422 class sh.miles.totem.ui.menu.TotemMenu

cobalt grove
#

delay the open after close by a tick

flint pulsar
#

@cobalt grove thank you bby

#

❤️

cobalt grove
#

im useful for something