mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 17:22:55 +01:00
Added server.getConsoleSender, blocked access to create a ConsoleCommandSender
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
6c051c6e18
commit
9549d7be86
3 changed files with 15 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue