NichtStudioCode / InvUI

A spigot library for creating custom inventory-based GUIs.
MIT License
242 stars 19 forks source link

Impossible change title on 1.19.4 #25

Closed Spliterash closed 1 year ago

Spliterash commented 1 year ago

I get this error when trying update inventory title.

[DefaultDispatcher-worker-21/WARN]: java.lang.UnsupportedOperationException: Unable to construct this menu by type
[DefaultDispatcher-worker-21/WARN]:     at net.minecraft.world.inventory.Container.a(Container.java:126)
[DefaultDispatcher-worker-21/WARN]:     at MtDialog-1.0.0.jar//ru.minetopia.mtdialog.shadow.invui.inventoryaccess.r13.InventoryUtilsImpl.updateOpenInventoryTitle(InventoryUtilsImpl.java:69)
[DefaultDispatcher-worker-21/WARN]:     at MtDialog-1.0.0.jar//ru.minetopia.mtdialog.shadow.invui.invui.window.AbstractWindow.changeTitle(AbstractWindow.java:306)

GUI Init code

val gui = Gui.normal()
    .setStructure(
        ". . . . . . . . .",
        ". . . . . . . . .",
        ". . . . . . . . .",

        ". . . . . . . . .",
        "0 0 0 0 . 1 1 1 1",
        ". . . . . . . . .",
        "2 2 2 2 . 3 3 3 3",
    )
    .apply {
        repeat(4) { i ->
            addIngredient(i.digitToChar(), SimpleItem(item(i)) { click(i) })
        }
    }
    .build()

window = Window
    .merged()
    .setGui(gui)
    .setTitle(AdventureComponentWrapper(createBuilder().build()))
    .build(player)

Title change code

window.changeTitle(AdventureComponentWrapper(builder.build()))

Server: Pufferfish 1.19.4 InvUI: xyz.xenondevs.invui:invui:1.0-SNAPSHOT

Spliterash commented 1 year ago

I dont know why, but problem exist only in first 1-2 minute, after server start