net.silkmc.silk.igui.elements.GuiFreeSlot.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of silk-igui Show documentation
Show all versions of silk-igui Show documentation
Silk is a Minecraft API for Kotlin
package net.silkmc.silk.igui.elements
import net.minecraft.world.item.ItemStack
import net.silkmc.silk.igui.GuiElement
import net.silkmc.silk.igui.events.GuiClickEvent
class GuiFreeSlot(
private val onClick: (suspend (GuiClickEvent) -> Unit)?,
) : GuiElement {
override suspend fun getItemStack(slotIndex: Int): ItemStack = ItemStack.EMPTY
override fun shouldCancel(clickEvent: GuiClickEvent) = false
override suspend fun onClick(clickEvent: GuiClickEvent) {
onClick?.invoke(clickEvent)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy