mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 15:19:56 +00:00
Addresses #4024
This commit is contained in:
parent
95abec1886
commit
781de3efab
@ -1236,6 +1236,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
* @return Block
|
||||
*/
|
||||
public function getBlock(Vector3 $pos, $cached = true) : Block{
|
||||
$pos = $pos->floor();
|
||||
$index = Level::blockHash($pos->x, $pos->y, $pos->z);
|
||||
if($cached and isset($this->blockCache[$index])){
|
||||
return $this->blockCache[$index];
|
||||
@ -1370,6 +1371,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
* @return bool Whether the block has been updated or not
|
||||
*/
|
||||
public function setBlock(Vector3 $pos, Block $block, bool $direct = false, bool $update = true) : bool{
|
||||
$pos = $pos->floor();
|
||||
if($pos->y < 0 or $pos->y >= 128){
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user