diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 19de2e02c..ac0ff28a0 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -325,6 +325,7 @@ class BlockAPI{ return; } $this->updateBlock($data["x"], $data["y"], $data["z"], isset($data["type"]) ? $data["type"]:BLOCK_UPDATE_RANDOM); + return true; } public function flowLavaOn($source, $face){ diff --git a/src/API/PlayerAPI.php b/src/API/PlayerAPI.php index fd5a17994..14b3aa916 100644 --- a/src/API/PlayerAPI.php +++ b/src/API/PlayerAPI.php @@ -54,6 +54,7 @@ class PlayerAPI{ $player->setHealth(min(20, $player->getHealth() + $data), "regeneration"); } } + return true; } break; case "player.death": @@ -103,6 +104,7 @@ class PlayerAPI{ } } $this->server->chat(false, $message); + return true; break; } } diff --git a/src/API/PluginAPI.php b/src/API/PluginAPI.php index 84f45f2de..881bb191d 100644 --- a/src/API/PluginAPI.php +++ b/src/API/PluginAPI.php @@ -76,7 +76,7 @@ class PluginAPI extends stdClass{ if(!isset($info["name"]) or !isset($info["version"]) or !isset($info["class"]) or !isset($info["author"])){ console("[ERROR] [PluginAPI] Failed parsing of ".basename($file)); } - console("[INFO] [PluginAPI] Loading plugin \"\x1b[32m".$info["name"]."\x1b[0m\" \x1b[35m".$info["version"]."\x1b[0m by \x1b[36m".$info["author"]."\x1b[0m"); + console("[INFO] [PluginAPI] Loading plugin \"\x1b[32m".$info["name"]."\x1b[0m\" \x1b[35m".$info["version"]." #".intval($info["apiversion"])."\x1b[0m by \x1b[36m".$info["author"]."\x1b[0m"); if(class_exists($info["class"])){ console("[ERROR] [PluginAPI] Failed loading plugin: class exists"); } @@ -84,8 +84,10 @@ class PluginAPI extends stdClass{ console("[ERROR] [PluginAPI] Failed loading plugin: evaluation error"); } $className = trim($info["class"]); - if(!isset($info["apiversion"]) or intval($info["apiversion"]) < CURRENT_API_VERSION){ - console("[ERROR] [PluginAPI] Plugin \"".$info["name"]."\" uses an outdated API! It can crash or corrupt the server!"); + if(isset($info["apiversion"]) and intval($info["apiversion"]) > CURRENT_API_VERSION){ + console("[ERROR] [PluginAPI] Plugin \"".$info["name"]."\" uses a newer API! It can crash or corrupt the server!"); + }elseif(!isset($info["apiversion"]) or intval($info["apiversion"]) < CURRENT_API_VERSION){ + console("[NOTICE] [PluginAPI] Plugin \"".$info["name"]."\" uses an old API"); } if(isset($info["api"]) and $info["api"] !== true){ console("[INFO] [PluginAPI] Plugin \"\x1b[36m".$info["name"]."\x1b[0m\" got raw access to Server methods"); diff --git a/src/Deprecation.php b/src/Deprecation.php index b4077b649..485480af5 100644 --- a/src/Deprecation.php +++ b/src/Deprecation.php @@ -29,6 +29,7 @@ the Free Software Foundation, either version 3 of the License, or class Deprecation{ public static $events = array( "world.block.change" => "block.change", + "block.drop" => "item.drop", ); diff --git a/src/PocketMinecraftServer.php b/src/PocketMinecraftServer.php index 99a9fa74c..6ea8b2258 100644 --- a/src/PocketMinecraftServer.php +++ b/src/PocketMinecraftServer.php @@ -216,7 +216,7 @@ class PocketMinecraftServer{ $this->preparedSQL->selectHandlers->clear(); $this->preparedSQL->selectHandlers->bindValue(":name", $event, SQLITE3_TEXT); $handlers = $this->preparedSQL->selectHandlers->execute(); - $result = true; + $result = null; if($handlers !== false and $handlers !== true){ console("[INTERNAL] Handling ".$event, true, true, 3); $call = array(); @@ -225,7 +225,7 @@ class PocketMinecraftServer{ } $handlers->finalize(); foreach($call as $hnid => $boolean){ - if($result !== false){ + if($result !== false and $result !== true){ $called[$hnid] = true; $handler = $this->handlers[$hnid]; if(is_array($handler)){