aboutsummaryrefslogtreecommitdiff
path: root/spark-forge/src/main/java
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2020-12-14 20:45:12 +0000
committerLuck <git@lucko.me>2020-12-14 20:45:22 +0000
commit7497f91084b5a0b220e3c32612803fc0bfd2fc6e (patch)
tree7cbd2b816141e95bc8a1ac804b90c3895a1fed76 /spark-forge/src/main/java
parent2d2314fcde048548aa92c80929b34187c81cec46 (diff)
downloadspark-7497f91084b5a0b220e3c32612803fc0bfd2fc6e.tar.gz
spark-7497f91084b5a0b220e3c32612803fc0bfd2fc6e.tar.bz2
spark-7497f91084b5a0b220e3c32612803fc0bfd2fc6e.zip
Detect RCON consoles correctly
Diffstat (limited to 'spark-forge/src/main/java')
-rw-r--r--spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java
index 87d394b..b5afd32 100644
--- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java
+++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java
@@ -26,7 +26,8 @@ import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.minecraft.command.ICommandSource;
import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.network.rcon.IServer;
+import net.minecraft.network.rcon.RConConsoleSource;
+import net.minecraft.server.MinecraftServer;
import net.minecraft.util.Util;
import net.minecraft.util.text.IFormattableTextComponent;
import net.minecraft.util.text.ITextComponent;
@@ -45,8 +46,10 @@ public class ForgeCommandSender extends AbstractCommandSender<ICommandSource> {
public String getName() {
if (super.delegate instanceof PlayerEntity) {
return ((PlayerEntity) super.delegate).getGameProfile().getName();
- } else if (super.delegate instanceof IServer) {
+ } else if (super.delegate instanceof MinecraftServer) {
return "Console";
+ } else if (super.delegate instanceof RConConsoleSource) {
+ return "RCON Console";
} else {
return "unknown:" + super.delegate.getClass().getSimpleName();
}