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

com.skillw.pouvoir.internal.feature.hologram.HologramLine.kt Maven / Gradle / Ivy

There is a newer version: 1.6.7-beta-6
Show newest version
package com.skillw.pouvoir.internal.feature.hologram

import com.skillw.pouvoir.internal.feature.hologram.impl.PouEmptyHoloLine
import org.bukkit.Location
import org.bukkit.entity.Player

class HologramLine(location: Location, line: String, vararg viewers: Player) {
    private val holoLine = PouHolo.create(location, line, *viewers) ?: PouEmptyHoloLine()

    init {
        for (viewer in viewers) {
            holoLine.visible(viewer, true)
        }
    }

    constructor(location: Location, line: String, viewers: Set) : this(location, line) {
        for (viewer in viewers) {
            holoLine.visible(viewer, true)
        }
    }

    fun update(line: String) {
        if (!holoLine.isDeleted) {
            holoLine.update(line)
        }
    }

    fun teleport(location: Location) {
        if (!holoLine.isDeleted) {
            holoLine.teleport(location)
        }
    }

    fun delete() {
        holoLine.delete()
    }

    fun destroy() {
        holoLine.destroy()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy