diff options
Diffstat (limited to 'spark-fabric/src/main')
-rw-r--r-- | spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java index 3293853..fbdc2e9 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java @@ -73,7 +73,7 @@ public class FabricServerSparkPlugin extends FabricSparkPlugin implements Comman private static String /*Nullable*/ [] processArgs(CommandContext<ServerCommandSource> context) { String[] split = context.getInput().split(" "); - if (split.length == 0 || !split[0].equals("/spark")) { + if (split.length == 0 || !split[0].equals("/spark") && !split[0].equals("spark")) { return null; } @@ -87,7 +87,8 @@ public class FabricServerSparkPlugin extends FabricSparkPlugin implements Comman return 0; } - this.platform.executeCommand(new FabricCommandSender(context.getSource().getPlayer(), this), args); + CommandOutput source = context.getSource().getEntity() != null ? context.getSource().getEntity() : context.getSource().getMinecraftServer(); + this.platform.executeCommand(new FabricCommandSender(source, this), args); return Command.SINGLE_SUCCESS; } |