From c3cfc82eb346ec9f7c13c43ee821019c4af5cb69 Mon Sep 17 00:00:00 2001 From: Andre601 <11576465+Andre601@users.noreply.github.com> Date: Sun, 14 Aug 2022 16:30:22 +0200 Subject: [PATCH] Fix inconsistent parsing command behaviour --- .../commands/impl/local/CommandParse.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandParse.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandParse.java index 4664b92..3793116 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandParse.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandParse.java @@ -30,7 +30,6 @@ import me.clip.placeholderapi.PlaceholderAPIPlugin; import me.clip.placeholderapi.commands.PlaceholderCommand; import me.clip.placeholderapi.expansion.PlaceholderExpansion; import me.clip.placeholderapi.util.Msg; -import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.command.CommandSender; @@ -123,13 +122,9 @@ public final class CommandParse extends PlaceholderCommand { } if (broadcast) { - Msg.broadcast(message); + Bukkit.broadcastMessage(message); } else { - if (!(sender instanceof Player)) { - Msg.msg(sender, message); - } else { - ((Player) sender).spigot().sendMessage(TextComponent.fromLegacyText(message)); - } + sender.sendMessage(message); } } @@ -156,7 +151,8 @@ public final class CommandParse extends PlaceholderCommand { final String message = PlaceholderAPI .setRelationalPlaceholders(((Player) targetOne), ((Player) targetTwo), String.join(" ", params.subList(2, params.size()))); - Msg.msg(sender, message); + + sender.sendMessage(message); }