mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 11:18:52 +00:00
Fixed hotbar reset bugs in block placement
This commit is contained in:
parent
78c242eac4
commit
a7b739d17f
@ -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);
|
||||
|
@ -1223,6 +1223,7 @@ class Player{
|
||||
if($this->spawned === false){
|
||||
break;
|
||||
}
|
||||
|
||||
$data["eid"] = $this->eid;
|
||||
$data["player"] = $this;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user