diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-24 23:11:01 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-24 23:11:01 +0100 |
commit | a07d79e27510188e6c9dc0451d309b8e5210482f (patch) | |
tree | 3838f7887d1b28b840e57919cdc76d77dd5a0a45 /src/main/java/org | |
parent | f700e32e38033fee54f75d7f76914fa31e9d2953 (diff) | |
download | bukkit-a07d79e27510188e6c9dc0451d309b8e5210482f.tar bukkit-a07d79e27510188e6c9dc0451d309b8e5210482f.tar.gz bukkit-a07d79e27510188e6c9dc0451d309b8e5210482f.tar.lz bukkit-a07d79e27510188e6c9dc0451d309b8e5210482f.tar.xz bukkit-a07d79e27510188e6c9dc0451d309b8e5210482f.zip |
Added server.getConsoleSender, blocked access to create a ConsoleCommandSender
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/Bukkit.java | 5 | ||||
-rw-r--r-- | src/main/java/org/bukkit/Server.java | 9 | ||||
-rw-r--r-- | src/main/java/org/bukkit/command/ConsoleCommandSender.java | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index 8438831d..cf4e1194 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -8,6 +8,7 @@ import java.util.UUID; import java.util.logging.Logger; import org.bukkit.World.Environment; import org.bukkit.command.CommandSender; +import org.bukkit.command.ConsoleCommandSender; import org.bukkit.command.PluginCommand; import org.bukkit.entity.Player; import org.bukkit.generator.ChunkGenerator; @@ -260,4 +261,8 @@ public final class Bukkit { public static void reloadWhitelist() { server.reloadWhitelist(); } + + public static ConsoleCommandSender getConsoleSender() { + return server.getConsoleSender(); + } } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index 356036ee..03912866 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -13,6 +13,7 @@ import java.util.logging.Logger; import org.bukkit.command.PluginCommand; import org.bukkit.command.CommandSender; +import org.bukkit.command.ConsoleCommandSender; import org.bukkit.map.MapView; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.ServicesManager; @@ -455,4 +456,12 @@ public interface Server { * @param mode New game mode */ public void setDefaultGameMode(GameMode mode); + + /** + * Gets the {@link ConsoleCommandSender} that may be used as an input source + * for this server. + * + * @return The Console CommandSender + */ + public ConsoleCommandSender getConsoleSender(); } diff --git a/src/main/java/org/bukkit/command/ConsoleCommandSender.java b/src/main/java/org/bukkit/command/ConsoleCommandSender.java index b63e8733..6c59c1b4 100644 --- a/src/main/java/org/bukkit/command/ConsoleCommandSender.java +++ b/src/main/java/org/bukkit/command/ConsoleCommandSender.java @@ -16,7 +16,7 @@ public class ConsoleCommandSender implements CommandSender { private final Server server; private final PermissibleBase perm = new PermissibleBase(this); - public ConsoleCommandSender(Server server) { + protected ConsoleCommandSender(Server server) { this.server = server; } |