aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/FabricCommandSender.java7
-rw-r--r--spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java7
2 files changed, 10 insertions, 4 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();
}
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();
}