From 4892fa7f854ad76fb7ba2cc552de440265375005 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Tue, 30 Nov 2021 08:46:57 +0000 Subject: [PATCH] Disabling action bar now immediately clears it --- .../com/willfp/ecoskills/commands/CommandToggleActionbar.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandToggleActionbar.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandToggleActionbar.kt index c1c72b9..a67840e 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandToggleActionbar.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandToggleActionbar.kt @@ -7,6 +7,8 @@ import com.willfp.eco.core.data.PlayerProfile import com.willfp.eco.core.data.keys.PersistentDataKey import com.willfp.eco.core.data.keys.PersistentDataKeyType import com.willfp.eco.util.NamespacedKeyUtils +import net.md_5.bungee.api.ChatMessageType +import net.md_5.bungee.api.chat.TextComponent import org.bukkit.command.CommandSender import org.bukkit.entity.Player @@ -32,6 +34,7 @@ class CommandToggleActionbar(plugin: EcoPlugin) : Subcommand( if (currentStatus) { player.sendMessage(plugin.langYml.getMessage("enabled-actionbar")) } else { + player.spigot().sendMessage(ChatMessageType.ACTION_BAR, *TextComponent.fromLegacyText("")) player.sendMessage(plugin.langYml.getMessage("disabled-actionbar")) } }