Fixed hotbar reset bugs in block placement

This commit is contained in:
Shoghi Cervantes 2013-08-19 17:04:02 +02:00
parent 78c242eac4
commit a7b739d17f
2 changed files with 3 additions and 4 deletions

View File

@ -311,13 +311,11 @@ class BlockAPI{
if($target->isActivable === true){ 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){ 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; return false;
} else {
return $this->cancelAction($target, $player);
} }
} }
if(($player->gamemode & 0x02) === 0x02){ //Adventure mode!! 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){ 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){ if($this->server->api->dhandle("player.block.place", array("player" => $player, "block" => $block, "target" => $target, "item" => $item)) === false){
return $this->cancelAction($block, $player); return $this->cancelAction($block, $player);
}elseif($hand->place($item, $player, $block, $target, $face, $fx, $fy, $fz) === false){ }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){ if($hand->getID() === SIGN_POST or $hand->getID() === WALL_SIGN){
$t = $this->server->api->tile->addSign($player->level, $block->x, $block->y, $block->z); $t = $this->server->api->tile->addSign($player->level, $block->x, $block->y, $block->z);

View File

@ -1223,6 +1223,7 @@ class Player{
if($this->spawned === false){ if($this->spawned === false){
break; break;
} }
$data["eid"] = $this->eid; $data["eid"] = $this->eid;
$data["player"] = $this; $data["player"] = $this;