NichtStudioCode / InvUI

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

The GUI doesn't load on 1.19.4 #37

Closed Emibergo02 closed 1 year ago

Emibergo02 commented 1 year ago

my build.gradle

    dependencies {

    implementation 'org.projectlombok:lombok:1.18.22'
    implementation 'xyz.xenondevs.invui:invui-core:1.8'
    implementation 'xyz.xenondevs.invui:inventory-access-r13:1.8:remapped-mojang'
    compileOnly "org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT"

    implementation "dev.jorel:commandapi-bukkit-shade:9.0.1"

    implementation 'com.github.Exlll.ConfigLib:configlib-yaml:v4.2.0'

    annotationProcessor('org.projectlombok:lombok:1.18.26')

}
shadowJar {
    dependencies {
        include dependency("dev.jorel:commandapi-bukkit-shade:9.0.1")

        include dependency('com.github.stefvanschie.inventoryframework:IF:0.10.9')
        include dependency("com.github.Exlll.ConfigLib:configlib-yaml:v4.2.0")
        include dependency("xyz.xenondevs.invui:invui-core:1.8")
        include dependency("xyz.xenondevs.invui:inventory-access-r13:1.8:remapped-mojang")
    }
    relocate("dev.jorel.commandapi", "dev.unnm3d.lib.commandapi")

    relocate 'de.exlll.configlib', 'dev.unnm3d.lib.configlib'
    relocate 'xyz.xenondevs.invui', 'dev.unnm3d.lib.invui'
    relocate 'xyz.xenondevs.inventoryaccess', 'dev.unnm3d.lib.inventoryaccess'
}

my command with default code

        return new CommandAPICommand("kgui")
                .executesPlayer((player, args) -> {
                    Bukkit.getLogger().info("test");
                    SimpleItem border = new SimpleItem(new ItemBuilder(Material.BLACK_STAINED_GLASS_PANE));
                    Gui gui = Gui.normal()
                            .setStructure(
                                    "# # # # # # # # #",
                                    "# . . . . . . . #",
                                    "# . . . . . . . #",
                                    "# # # # # # # # #")
                            .addIngredient('#', border)
                            .build();
                    Window window = Window.single()
                            .setViewer(player)
                            .setGui(gui)
                            .setTitle("InvUI")
                            .build();
                    window.open();

                });

console sends "test" but the gui is not displayed to player i chose this library because i can modify the bottom inventory of the player but it is the only library that doesn't work at all without any error on console

NichtStudioCode commented 1 year ago

Solved in Discord conversation.

The issue was the usage of the mojang-mapped version of inventory-access on a spigot-mapped server with the CommandAPI hiding the resulting exception