Switched gamemode handler to Player object

This commit is contained in:
Shoghi Cervantes Pueyo
2013-02-06 16:18:15 +01:00
parent 4aa0f8f8d1
commit d2dcf4f43a
10 changed files with 33 additions and 18 deletions

View File

@@ -154,10 +154,10 @@ class BlockAPI{
public function playerBlockBreak(Player $player, Vector3 $vector){
$target = $this->getBlock($vector);
if($target->isBreakable === false or $this->server->gamemode === 2){
return $this->cancelAction($target);
}
$item = $player->equipment;
if(!$target->isBreakable($item, $player) or $this->server->gamemode === 2){
return $this->cancelAction($target);
}
if($this->server->api->dhandle("player.block.break", array("player" => $player, "target" => $target, "item" => $item)) !== false){

View File

@@ -135,7 +135,7 @@ class ServerAPI{
console("[NOTICE] \x1b[33mA new DEVELOPMENT version of PocketMine-MP has been released");
console("[NOTICE] \x1b[33mVersion \"".$info["development"]["version"]."\" [".substr($info["development"]["commit"], 0, 10)."]");
console("[NOTICE] \x1b[36mIf you want to update, get the latest version at ".$info["development"]["download"]);
console("[NOTICE] This message will dissapear when you issue the command \"/update-done\"");
console("[NOTICE] This message will dissapear after issuing the command \"/update-done\"");
sleep(3);
}else{
$this->setProperty("last-update", time());