IF
IF copied to clipboard
GuiItem ClickEvent not fired when clicking a CycleButton
val gui = object : ChestGui(6, "test") {
val cycleButton = CycleButton(2, 2, 1, 1)
init {
Color.values().map {
val pane = StaticPane(0, 0, 1, 1)
val itemStack = ItemBuilder(Material.STONE).name(it.name).build()
val guiItem = GuiItem(itemStack) { event ->
println("ClickEvent not fired")
println("ClickEvent not fired")
println("ClickEvent not fired")
println("ClickEvent not fired")
println("ClickEvent not fired")
}
pane.addItem(guiItem, 0, 0)
pane
}.forEach { cycleButton.addPane(it) }
addPane(cycleButton)
}
}
Bukkit.getOnlinePlayers().forEach {
gui.show(it)
}
I can't seem to reproduce this issue. Could you try attempting this on the newest version? This has been an issue in the past, but should've been resolved a year ago.