All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.silkmc.silk.igui.elements.GuiFreeSlot.kt Maven / Gradle / Ivy

There is a newer version: 1.10.7
Show newest version
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