From a7b739d17f7c4d9e247194ca175d44d2b75a7ebb Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Mon, 19 Aug 2013 17:04:02 +0200 Subject: [PATCH] Fixed hotbar reset bugs in block placement --- src/API/BlockAPI.php | 6 ++---- src/Player.php | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 5e7cf4b6..484a98ed 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -311,13 +311,11 @@ class BlockAPI{ if($target->isActivable === true){ if($this->server->api->dhandle("player.block.activate", array("player" => $player, "block" => $block, "target" => $target, "item" => $item)) !== false and $target->onActivate($item, $player) === true){ return false; - } else { - return $this->cancelAction($target, $player); } } if(($player->gamemode & 0x02) === 0x02){ //Adventure mode!! - return $this->cancelAction($block, $player); + return $this->cancelAction($block, $player, false); } if($block->y > 127 or $block->y < 0){ @@ -352,7 +350,7 @@ class BlockAPI{ if($this->server->api->dhandle("player.block.place", array("player" => $player, "block" => $block, "target" => $target, "item" => $item)) === false){ return $this->cancelAction($block, $player); }elseif($hand->place($item, $player, $block, $target, $face, $fx, $fy, $fz) === false){ - return $this->cancelAction($block, $player); + return $this->cancelAction($block, $player, false); } if($hand->getID() === SIGN_POST or $hand->getID() === WALL_SIGN){ $t = $this->server->api->tile->addSign($player->level, $block->x, $block->y, $block->z); diff --git a/src/Player.php b/src/Player.php index 26c7ec7a..32191cd2 100644 --- a/src/Player.php +++ b/src/Player.php @@ -1223,6 +1223,7 @@ class Player{ if($this->spawned === false){ break; } + $data["eid"] = $this->eid; $data["player"] = $this;