From a6e10a824af5a7de097da58b5e54fe0fbbedfedd Mon Sep 17 00:00:00 2001 From: Auxilor Date: Tue, 14 Jun 2022 08:28:49 +0100 Subject: [PATCH] Changed _name to _active_name and added _name --- .../com/willfp/boosters/boosters/Booster.kt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/boosters/Booster.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/boosters/Booster.kt index d4d4bb1..3aec029 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/boosters/Booster.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/boosters/Booster.kt @@ -19,7 +19,7 @@ import com.willfp.libreforge.effects.Effects import org.bukkit.Bukkit import org.bukkit.entity.Player import org.bukkit.inventory.ItemStack -import java.util.* +import java.util.UUID import kotlin.math.floor class Booster( @@ -145,15 +145,24 @@ class Booster( active?.player?.savedDisplayName ?: "" } ) - + + PlaceholderManager.registerPlaceholder( + PlayerlessPlaceholder( + plugin, + "${id}_active_name", + ) { + val active = this.active + + active?.booster?.name ?: "" + } + ) + PlaceholderManager.registerPlaceholder( PlayerlessPlaceholder( plugin, "${id}_name", ) { - val active = this.active - - active?.booster?.name ?: "" + this.name } )