diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 5e18c2f4..d8f86a4a 100755 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -437,7 +437,7 @@ class BlockAPI{ $item = $player->getSlot($player->slot); if($target->getID() === AIR and $this->server->api->dhandle("player.block.place.invalid", ["player" => $player, "block" => $block, "target" => $target, "item" => $item]) !== true){ //If no block exists or not allowed in CREATIVE - if($this->server->api->dhandle("player.block.place.bypass", ["player" => $player, "block" => $block, "target" => $target, "item" => $item]) !== true){ + if($this->server->api->dhandle("player.block.place.bypass", ["player" => $player, "block" => $block, "target" => $target, "item" => $item]) !== true){ $this->cancelAction($target, $player); return $this->cancelAction($block, $player); } @@ -445,7 +445,7 @@ class BlockAPI{ if($this->server->api->dhandle("player.block.touch", ["type" => "place", "player" => $player, "block" => $block, "target" => $target, "item" => $item]) === false){ if($this->server->api->dhandle("player.block.place.bypass", ["player" => $player, "block" => $block, "target" => $target, "item" => $item]) !== true){ - return $this->cancelAction($block, $player); + return $this->cancelAction($block, $player); } } $this->blockUpdate($target, BLOCK_UPDATE_TOUCH); diff --git a/src/entity/Entity.php b/src/entity/Entity.php index b8cf8aef..2d5ddc46 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -733,7 +733,7 @@ class Entity extends Position{ public function inBlock(Vector3 $block, $radius = 0.8){ $me = new Vector3($this->x - 0.5, $this->y, $this->z - 0.5); - if(($block->y == ((int) $this->y) or $block->y == (((int) $this->y) + 1)) and $block->maxPlainDistance($me) < $radius){ + if(($block->y == (ceil($this->y)) or $block->y == (ceil($this->y) + 1)) and $block->maxPlainDistance($me) < $radius){ return true; } return false; diff --git a/src/network/protocol/ProtocolInfo.php b/src/network/protocol/ProtocolInfo.php index f6d13dd4..44327fe7 100644 --- a/src/network/protocol/ProtocolInfo.php +++ b/src/network/protocol/ProtocolInfo.php @@ -76,7 +76,13 @@ abstract class ProtocolInfo{ //const PLAYER_INPUT_PACKET = 0xb9; } - +/*Unused: + * 0xb5 + * 0xb9 + * 0x96 + * 0x17 + * 0x14 + */ /***REM_START***/ require_once(FILE_PATH . "src/network/raknet/RakNetDataPacket.php"); /***REM_END***/ \ No newline at end of file diff --git a/src/utils/Random.php b/src/utils/Random.php index 85c6ae0b..a208f883 100644 --- a/src/utils/Random.php +++ b/src/utils/Random.php @@ -39,8 +39,8 @@ class Random{ $s = $v1 * $v1 + $v2 * $v2; }while($s >= 1 || $s == 0); $multiplier = sqrt(-2 * log($s) / $s); - $nextNextGaussian = $v2 * $multiplier; - $haveNextNextGaussian = true; + $this->nextNextGaussian = $v2 * $multiplier; + $this->haveNextNextGaussian = true; return $v1 * $multiplier; } }