Style fixes + Imports

This commit is contained in:
KrystilizeNevaDies 2020-12-10 01:10:46 +10:00 committed by GitHub
parent df536f9aaf
commit f54dc4efe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,6 @@ package net.minestom.server.command;
import net.minestom.server.chat.ColoredText; import net.minestom.server.chat.ColoredText;
import net.minestom.server.chat.JsonMessage; import net.minestom.server.chat.JsonMessage;
import net.minestom.server.chat.RichMessage;
import net.minestom.server.entity.Player; import net.minestom.server.entity.Player;
import net.minestom.server.permission.PermissionHandler; import net.minestom.server.permission.PermissionHandler;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -34,14 +33,16 @@ public interface CommandSender extends PermissionHandler {
/** /**
* Sends a {@link ColoredText} message. * Sends a {@link ColoredText} message.
* * If this is not a {@link Player}, only the content of the message will be sent as a string.
* If this is not a {@link Player}, only the content of the message will be sent as a string.
* *
* @param text The {@link ColoredText} to send. * @param text The {@link ColoredText} to send.
* */ * */
default void sendMessage(@NotNull ColoredText text) { default void sendMessage(@NotNull ColoredText text) {
if (this instanceof Player) ((Player) this).sendMessage((JsonMessage) text); if (this instanceof Player) {
else sendMessage(text.getMessage()); ((Player) this).sendMessage((JsonMessage) text);
} else {
sendMessage(text.getMessage());
}
} }
/** /**