diff options
author | Luck <git@lucko.me> | 2020-12-14 20:45:12 +0000 |
---|---|---|
committer | Luck <git@lucko.me> | 2020-12-14 20:45:22 +0000 |
commit | 7497f91084b5a0b220e3c32612803fc0bfd2fc6e (patch) | |
tree | 7cbd2b816141e95bc8a1ac804b90c3895a1fed76 /spark-fabric/src/main/java/me/lucko/spark | |
parent | 2d2314fcde048548aa92c80929b34187c81cec46 (diff) | |
download | spark-7497f91084b5a0b220e3c32612803fc0bfd2fc6e.tar.gz spark-7497f91084b5a0b220e3c32612803fc0bfd2fc6e.tar.bz2 spark-7497f91084b5a0b220e3c32612803fc0bfd2fc6e.zip |
Detect RCON consoles correctly
Diffstat (limited to 'spark-fabric/src/main/java/me/lucko/spark')
-rw-r--r-- | spark-fabric/src/main/java/me/lucko/spark/fabric/FabricCommandSender.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricCommandSender.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricCommandSender.java index c2c5c77..7a176fa 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricCommandSender.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricCommandSender.java @@ -25,8 +25,9 @@ import me.lucko.spark.fabric.plugin.FabricSparkPlugin; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.server.MinecraftServer; import net.minecraft.server.command.CommandOutput; -import net.minecraft.server.dedicated.DedicatedServer; +import net.minecraft.server.rcon.RconCommandOutput; import net.minecraft.text.Text; import java.util.UUID; @@ -45,8 +46,10 @@ public class FabricCommandSender extends AbstractCommandSender<CommandOutput> { public String getName() { if (super.delegate instanceof PlayerEntity) { return ((PlayerEntity) super.delegate).getGameProfile().getName(); - } else if (super.delegate instanceof DedicatedServer) { + } else if (super.delegate instanceof MinecraftServer) { return "Console"; + } else if (super.delegate instanceof RconCommandOutput) { + return "RCON Console"; } else { return "unknown:" + super.delegate.getClass().getSimpleName(); } |