mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Added player commands, better console API and implemented future player chat
This commit is contained in:
parent
72388fa3cb
commit
c2e55941d8
6 changed files with 186 additions and 131 deletions
|
|
@ -41,13 +41,14 @@ class TimeAPI{
|
|||
$this->server->api->console->register("time", "Manages server time", array($this, "commandHandler"));
|
||||
}
|
||||
|
||||
public function commandHandler($cmd, $params){
|
||||
public function commandHandler($cmd, $params, $issuer){
|
||||
$output = "";
|
||||
switch($cmd){
|
||||
case "time":
|
||||
$p = strtolower(array_shift($params));
|
||||
switch($p){
|
||||
case "check":
|
||||
console("[INFO] Time: ".$this->getDate().", ".$this->getPhase()." (".$this->get(true).")");
|
||||
$output .= "Time: ".$this->getDate().", ".$this->getPhase()." (".$this->get(true).")\n";
|
||||
break;
|
||||
case "add":
|
||||
$this->add(array_shift($params));
|
||||
|
|
@ -68,11 +69,12 @@ class TimeAPI{
|
|||
$this->night();
|
||||
break;
|
||||
default:
|
||||
console("[INFO] Usage: /time <check | set | add | sunrise | day | sunset | night> [time]");
|
||||
$output .= "Usage: /time <check | set | add | sunrise | day | sunset | night> [time]\n";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function night(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue