Added integrated command aliases

This commit is contained in:
Shoghi Cervantes
2014-06-17 15:21:06 +02:00
parent e8cc52f99e
commit 032710a2de
3 changed files with 219 additions and 8 deletions

View File

@ -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
*/