kr.summitsystems.springbukkit.view.ViewItemLayoutHandler.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-bukkit-view Show documentation
Show all versions of spring-bukkit-view Show documentation
Springframework based Bukkit plugin development kit.
package kr.summitsystems.springbukkit.view
import org.bukkit.event.EventHandler
import org.bukkit.event.inventory.InventoryClickEvent
import org.springframework.beans.factory.config.BeanDefinition
import org.springframework.context.annotation.Role
import org.springframework.stereotype.Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Component
class ViewItemLayoutHandler {
@EventHandler
fun onClick(event: InventoryClickEvent) {
val item = event.currentItem
val view = event.inventory.holder
if (item != null && view is ViewItemLayoutContainer) {
val layout = view.findItemLayout(event.rawSlot)
if (layout is ViewItemLayoutHandle) {
layout.handleOnClick(event)
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy