mirror of
https://github.com/Auxilor/EcoSkills.git
synced 2025-12-31 12:56:31 +00:00
Improved action bar
This commit is contained in:
@@ -9,6 +9,7 @@ import com.willfp.eco.core.AbstractPacketAdapter
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import net.md_5.bungee.api.ChatMessageType
|
||||
import net.md_5.bungee.api.chat.TextComponent
|
||||
import org.bukkit.GameMode
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.Listener
|
||||
@@ -48,6 +49,8 @@ class ActionBarCompatChatMessage(
|
||||
class ActionBarClearOnGamemode: Listener {
|
||||
@EventHandler
|
||||
fun handle(event: PlayerGameModeChangeEvent) {
|
||||
event.player.spigot().sendMessage(ChatMessageType.ACTION_BAR, *TextComponent.fromLegacyText(""))
|
||||
if (event.newGameMode == GameMode.CREATIVE || event.newGameMode == GameMode.SPECTATOR) {
|
||||
event.player.spigot().sendMessage(ChatMessageType.ACTION_BAR, *TextComponent.fromLegacyText(""))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,6 +53,11 @@ object ActionBarUtils {
|
||||
continue
|
||||
}
|
||||
|
||||
if (plugin.configYml.getBool("persistent-action-bar.scale-health")) {
|
||||
player.isHealthScaled = true
|
||||
player.healthScale = 20.0
|
||||
}
|
||||
|
||||
val message = plugin.configYml
|
||||
.getString("persistent-action-bar.format", false)
|
||||
val component = StringUtils.format(message, player)
|
||||
|
||||
Reference in New Issue
Block a user