34 lines
960 B
Kotlin
34 lines
960 B
Kotlin
package net.hareworks.ghostdisplays.api
|
|
|
|
import net.hareworks.ghostdisplays.api.audience.AudiencePredicate
|
|
import net.hareworks.ghostdisplays.api.click.ClickPriority
|
|
import net.hareworks.ghostdisplays.api.click.DisplayClickHandler
|
|
import net.hareworks.ghostdisplays.api.click.HandlerRegistration
|
|
import org.bukkit.entity.Display
|
|
import org.bukkit.entity.Interaction
|
|
import org.bukkit.entity.Player
|
|
import java.util.UUID
|
|
|
|
interface DisplayController<T : Display> {
|
|
val display: T
|
|
val interaction: Interaction?
|
|
|
|
fun show(player: Player)
|
|
|
|
fun hide(player: Player)
|
|
|
|
fun isViewing(playerId: UUID): Boolean
|
|
|
|
fun viewerIds(): Set<UUID>
|
|
|
|
fun applyEntityUpdate(mutator: (T) -> Unit)
|
|
|
|
fun addAudience(predicate: AudiencePredicate): HandlerRegistration
|
|
|
|
fun refreshAudience(target: Player? = null)
|
|
|
|
fun destroy()
|
|
|
|
fun onClick(priority: ClickPriority = ClickPriority.NORMAL, handler: DisplayClickHandler): HandlerRegistration
|
|
}
|