mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Added integrated command aliases
This commit is contained in:
@ -1260,6 +1260,28 @@ class Server{
|
||||
$this->whitelist->reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCommandAliases(){
|
||||
$section = $this->getProperty("aliases");
|
||||
$result = [];
|
||||
if(is_array($section)){
|
||||
foreach($section as $key => $value){
|
||||
$commands = [];
|
||||
if(is_array($value)){
|
||||
$commands = $value;
|
||||
}else{
|
||||
$commands[] = $value;
|
||||
}
|
||||
|
||||
$result[$key] = $commands;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Server
|
||||
*/
|
||||
@ -1435,11 +1457,12 @@ class Server{
|
||||
$this->scheduler->scheduleDelayedRepeatingTask(new CallbackTask(array($this, "doAutoSave")), $this->getProperty("ticks-per.autosave", 6000), $this->getProperty("ticks-per.autosave", 6000));
|
||||
}
|
||||
|
||||
$this->scheduler->scheduleDelayedRepeatingTask(new CallbackTask(array($this, "doLevelGC")), $this->getProperty("chunk-gc.period-in-ticks", 600), $this->getProperty("chunk-gc.period-in-ticks", 600));
|
||||
if($this->getProperty("chunk-gc.period-in-ticks", 600) > 0){
|
||||
$this->scheduler->scheduleDelayedRepeatingTask(new CallbackTask(array($this, "doLevelGC")), $this->getProperty("chunk-gc.period-in-ticks", 600), $this->getProperty("chunk-gc.period-in-ticks", 600));
|
||||
}
|
||||
|
||||
$this->enablePlugins(PluginLoadOrder::POSTWORLD);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1494,14 +1517,10 @@ class Server{
|
||||
|
||||
if($type === PluginLoadOrder::POSTWORLD){
|
||||
$this->commandMap->registerServerAliases();
|
||||
$this->loadCustomPermissions();
|
||||
DefaultPermissions::registerCorePermissions();
|
||||
}
|
||||
}
|
||||
|
||||
private function loadCustomPermissions(){
|
||||
DefaultPermissions::registerCorePermissions();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Plugin $plugin
|
||||
*/
|
||||
|
Reference in New Issue
Block a user