diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/actionbar/ActionBarCompatibilityListener.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/actionbar/ActionBarCompatibilityListener.kt index 7a27d2d..d212a87 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/actionbar/ActionBarCompatibilityListener.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/actionbar/ActionBarCompatibilityListener.kt @@ -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("")) + } } } \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/actionbar/ActionBarUtils.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/actionbar/ActionBarUtils.kt index 27c54d1..ed495e2 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/actionbar/ActionBarUtils.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/actionbar/ActionBarUtils.kt @@ -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)