diff --git a/src/API/ChatAPI.php b/src/API/ChatAPI.php index dadc1179..90ce98f6 100644 --- a/src/API/ChatAPI.php +++ b/src/API/ChatAPI.php @@ -31,6 +31,7 @@ class ChatAPI{ $this->server->api->console->register("say", "", array($this, "commandHandler")); $this->server->api->ban->cmdWhitelist("tell"); $this->server->api->ban->cmdWhitelist("me"); + $this->server->api->console->alias("msg", "tell"); } /** diff --git a/src/API/PluginAPI.php b/src/API/PluginAPI.php index 5fce80a9..06af57d6 100644 --- a/src/API/PluginAPI.php +++ b/src/API/PluginAPI.php @@ -26,6 +26,30 @@ class PluginAPI extends stdClass{ public function __construct(){ $this->server = ServerAPI::request(); $this->randomNonce = Utils::getRandomBytes(16, false); + $this->server->api->console->register("plugins", "", array($this, "commandHandler")); + $this->server->api->console->register("version", "", array($this, "commandHandler")); + $this->server->api->ban->cmdWhitelist("version"); + } + + public function commandHandler($cmd, $params, $issuer, $alias){ + $output = ""; + switch($cmd){ + case "plugins": + $output = "Plugins: "; + foreach($this->getList() as $plugin){ + $output .= $plugin["name"] . ": ".$plugin["version"] .", "; + } + $output = $output === "Plugins: " ? "No plugins installed.\n" : substr($output, 0, -2)."\n"; + break; + case "version": + $output = "PocketMine-MP ".MAJOR_VERSION." ".CODENAME." API #".CURRENT_API_VERSION." for Minecraft: PE ".CURRENT_MINECRAFT_VERSION; + if(GIT_COMMIT !== str_repeat("00", 20)){ + $output .= " (git ".GIT_COMMIT.")"; + } + $output .= "\n"; + break; + } + return $output; } public function getList(){ diff --git a/src/pmf/Level.php b/src/pmf/Level.php index 9621b9c1..1702cca7 100644 --- a/src/pmf/Level.php +++ b/src/pmf/Level.php @@ -224,7 +224,7 @@ class PMFLevel extends PMF{ if(($info[0] & $t) === $t){ // 4096 + 2048 + 2048, Block Data, Meta, Light if(strlen($this->chunks[$index][$Y] = gzread($chunk, 8192)) < 8192){ - console("[NOTICE] Empty corrupt chunk detected [$X,$Z,:$Y], recovering contents"); + console("[NOTICE] Empty corrupt chunk detected [$X,$Z,:$Y], recovering contents", true, true, 2); $this->fillMiniChunk($X, $Z, $Y); } }else{