From 775ead64ff048caccc3f1bb585eaf1111006a3d5 Mon Sep 17 00:00:00 2001 From: Darkere Date: Sun, 17 May 2020 12:15:09 +0200 Subject: Support external commandsources on Forge (#52) --- .../main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java | 3 +-- spark-forge/src/main/resources/META-INF/accesstransformer.cfg | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 spark-forge/src/main/resources/META-INF/accesstransformer.cfg (limited to 'spark-forge/src') diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java index c017d95..4051d24 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java @@ -79,8 +79,7 @@ public class ForgeServerSparkPlugin extends ForgeSparkPlugin implements Command< String[] args = processArgs(context); if (args == null) return 0; - ICommandSource source = context.getSource().getEntity() instanceof ServerPlayerEntity ? context.getSource().asPlayer() : context.getSource().getServer(); - this.platform.executeCommand(new ForgeCommandSender(source, this), args); + this.platform.executeCommand(new ForgeCommandSender(context.getSource().source, this), args); return Command.SINGLE_SUCCESS; } diff --git a/spark-forge/src/main/resources/META-INF/accesstransformer.cfg b/spark-forge/src/main/resources/META-INF/accesstransformer.cfg new file mode 100644 index 0000000..5f9dd8a --- /dev/null +++ b/spark-forge/src/main/resources/META-INF/accesstransformer.cfg @@ -0,0 +1 @@ +public net.minecraft.command.CommandSource field_197041_c # source \ No newline at end of file -- cgit