mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
a
This commit is contained in:
parent
978447cdbb
commit
b30cdd3b2f
8 changed files with 94 additions and 18 deletions
|
|
@ -22,10 +22,18 @@ class ConsoleAPI{
|
|||
$this->register("difficulty", "<0|1|2|3>", [$this, "defaultCommands"]);
|
||||
$this->register("stop", "", [$this, "defaultCommands"]);
|
||||
$this->register("defaultgamemode", "<mode>", [$this, "defaultCommands"]);
|
||||
$this->server->api->ban->cmdWhitelist("help");
|
||||
$this->server->api->ban->cmdWhitelist("status");
|
||||
$this->cmdWhitelist("help");
|
||||
$this->cmdWhitelist("status");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Whitelists a CMD so everyone can issue it - Even non OPs.
|
||||
* @param string $cmd Command to Whitelist
|
||||
*/
|
||||
public function cmdWhitelist($cmd){
|
||||
$this->server->api->ban->cmdWhitelist[strtolower(trim($cmd))] = true;
|
||||
}
|
||||
|
||||
public function register($cmd, $help, $callback){
|
||||
if(!is_callable($callback)){
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue