flytegg / twilight

A Kotlin API for Spigot/Paper Minecraft servers providing essential utilities to streamline development.
https://docs.flyte.gg/twilight.html
MIT License
55 stars 8 forks source link

[question] how to open a gui #71

Closed Cooperzilla closed 1 month ago

Cooperzilla commented 1 month ago

Hi, i've made a gui with this but my plugin won't compile

i'm getting this error from my ide

None of the following functions can be called with the arguments supplied. openInventory(Inventory) defined in org. bukkit. entity. Player openInventory(InventoryView) defined in org. bukkit. entity. Player

and this error from gradle

None of the following candidates is applicable: fun openInventory(p0: @NotNull() Inventory): @Nullable() InventoryView? fun openInventory(p0: @NotNull() InventoryView): Unit

and even trying the examples in the readme doesn't work and i get the same errors

MLGPenguin commented 1 month ago

Could you share a screenshot of the type you've provided?

Cooperzilla commented 1 month ago

Could you share a screenshot of the type you've provided?

the type the gui function outputs and what im putting into player.openInventory is gg.flyte.twilight.gui.GUI

MLGPenguin commented 1 month ago

You need to import gg.flyte.twilight.gui.GUI.openInventory or gg.flyte.twilight.gui.openInventory I'm not sure which but it's one of those

Cooperzilla commented 1 month ago

oh ok thank you