fixed messages from commands not disabling correctly

This commit is contained in:
ajgeiss0702
2021-08-01 11:19:25 -07:00
parent f569353213
commit a8668890ce
2 changed files with 4 additions and 0 deletions
@@ -1,6 +1,7 @@
package us.ajg0702.queue.platforms.bungeecord.commands;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import org.jetbrains.annotations.NotNull;
@@ -27,6 +28,7 @@ public class BungeeSender implements ICommandSender {
@Override
public void sendMessage(@NotNull Component message) {
if(PlainTextComponentSerializer.plainText().serialize(message).isEmpty()) return;
BungeeQueue.adventure().sender(handle).sendMessage(message);
}
@@ -3,6 +3,7 @@ package us.ajg0702.queue.platforms.velocity.commands;
import com.velocitypowered.api.command.CommandSource;
import com.velocitypowered.api.proxy.ConsoleCommandSource;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.jetbrains.annotations.NotNull;
import us.ajg0702.queue.api.commands.ICommandSender;
@@ -26,6 +27,7 @@ public class VelocitySender implements ICommandSender {
@Override
public void sendMessage(@NotNull Component message) {
if(PlainTextComponentSerializer.plainText().serialize(message).isEmpty()) return;
handle.sendMessage(message);
}