diff options
author | Darkere <Dark-277@web.de> | 2020-05-17 12:15:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-17 11:15:09 +0100 |
commit | 775ead64ff048caccc3f1bb585eaf1111006a3d5 (patch) | |
tree | 7fc2f21a6c2b6980e2690e8b98db8df96ddbf66c /spark-forge/src | |
parent | f3c21318b53ba130df59990b9330ccf615d2b9b8 (diff) | |
download | spark-775ead64ff048caccc3f1bb585eaf1111006a3d5.tar.gz spark-775ead64ff048caccc3f1bb585eaf1111006a3d5.tar.bz2 spark-775ead64ff048caccc3f1bb585eaf1111006a3d5.zip |
Support external commandsources on Forge (#52)
Diffstat (limited to 'spark-forge/src')
-rw-r--r-- | spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java | 3 | ||||
-rw-r--r-- | spark-forge/src/main/resources/META-INF/accesstransformer.cfg | 1 |
2 files changed, 2 insertions, 2 deletions
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 |