Permalink
Browse files

Added server.getConsoleSender, blocked access to create a ConsoleComm…

…andSender
  • Loading branch information...
1 parent 36f642b commit 7306aa8d3dcd33591cbb313007f45d869c1d1d24 @Dinnerbone Dinnerbone committed Sep 24, 2011
@@ -8,6 +8,7 @@
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 static void setWhitelist(boolean value) {
public static void reloadWhitelist() {
server.reloadWhitelist();
}
+
+ public static ConsoleCommandSender getConsoleSender() {
+ return server.getConsoleSender();
+ }
}
@@ -13,6 +13,7 @@
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 @@
* @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();
}
@@ -16,7 +16,7 @@
private final Server server;
private final PermissibleBase perm = new PermissibleBase(this);
- public ConsoleCommandSender(Server server) {
+ protected ConsoleCommandSender(Server server) {
this.server = server;
}

0 comments on commit 7306aa8

Please sign in to comment.