Added support for DecentHolograms
This commit is contained in:
@@ -66,6 +66,7 @@ import com.willfp.eco.internal.spigot.integrations.customitems.CustomItemsItemsA
|
||||
import com.willfp.eco.internal.spigot.integrations.customitems.CustomItemsOraxen
|
||||
import com.willfp.eco.internal.spigot.integrations.economy.EconomyVault
|
||||
import com.willfp.eco.internal.spigot.integrations.hologram.HologramCMI
|
||||
import com.willfp.eco.internal.spigot.integrations.hologram.HologramDecentHolograms
|
||||
import com.willfp.eco.internal.spigot.integrations.hologram.HologramHolographicDisplays
|
||||
import com.willfp.eco.internal.spigot.integrations.mcmmo.McmmoIntegrationImpl
|
||||
import com.willfp.eco.internal.spigot.integrations.multiverseinventories.MultiverseInventoriesIntegration
|
||||
@@ -213,6 +214,7 @@ abstract class EcoSpigotPlugin : EcoPlugin(
|
||||
// Hologram
|
||||
IntegrationLoader("HolographicDisplays") { HologramManager.register(HologramHolographicDisplays(this)) },
|
||||
IntegrationLoader("CMI") { HologramManager.register(HologramCMI()) },
|
||||
IntegrationLoader("DecentHolograms") { HologramManager.register(HologramDecentHolograms()) },
|
||||
//IntegrationLoader("GHolo") { HologramManager.register(HologramGHolo()) },
|
||||
|
||||
// AFK
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.willfp.eco.internal.spigot.integrations.hologram
|
||||
|
||||
import com.willfp.eco.core.integrations.hologram.Hologram
|
||||
import com.willfp.eco.core.integrations.hologram.HologramWrapper
|
||||
import eu.decentsoftware.holograms.api.DHAPI
|
||||
import me.gholo.api.GHoloAPI
|
||||
import org.bukkit.Location
|
||||
import java.util.UUID
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
class HologramDecentHolograms : HologramWrapper {
|
||||
|
||||
override fun createHologram(location: Location, contents: MutableList<String>): Hologram {
|
||||
val id = UUID.randomUUID().toString()
|
||||
|
||||
val holo = DHAPI.createHologram(id, location, contents)
|
||||
|
||||
return HologramImplGHolo(id)
|
||||
}
|
||||
|
||||
override fun getPluginName(): String {
|
||||
return "GHolo"
|
||||
}
|
||||
|
||||
class HologramImplGHolo(
|
||||
private val id: String,
|
||||
) : Hologram {
|
||||
override fun remove() {
|
||||
DHAPI.getHologram(id)?.destroy()
|
||||
}
|
||||
|
||||
override fun setContents(contents: MutableList<String>) {
|
||||
DHAPI.setHologramLines(DHAPI.getHologram(id), contents)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user