From 42e2581b5333bf6eb14a4b1c88ae2662097c64fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=81=AA=E8=81=AA?= <178666380@qq.com> Date: Tue, 27 Jun 2017 14:15:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DRcon=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E5=8F=AF=E8=83=BD=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bukkit/craftbukkit/command/CraftSimpleCommandMap.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftSimpleCommandMap.java b/src/main/java/org/bukkit/craftbukkit/command/CraftSimpleCommandMap.java index afb441e..0722da3 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/CraftSimpleCommandMap.java +++ b/src/main/java/org/bukkit/craftbukkit/command/CraftSimpleCommandMap.java @@ -5,12 +5,14 @@ import static org.bukkit.util.Java15Compat.Arrays_copyOfRange; import java.util.regex.Pattern; import net.minecraft.command.ICommandSender; +import net.minecraft.network.rcon.RConConsoleSource; import org.bukkit.Server; import org.bukkit.command.Command; import org.bukkit.command.CommandException; import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; +import org.bukkit.command.RemoteConsoleCommandSender; import org.bukkit.command.SimpleCommandMap; import org.bukkit.craftbukkit.entity.CraftPlayer; @@ -50,6 +52,9 @@ public class CraftSimpleCommandMap extends SimpleCommandMap { { FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager().executeCommand(this.vanillaConsoleSender, commandLine); } + else if (sender instanceof RemoteConsoleCommandSender){ + FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager().executeCommand(RConConsoleSource.instance, commandLine); + } else FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager().executeCommand(((CraftPlayer)sender).getHandle(), commandLine); } else {