mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 00:25:04 +00:00
This commit is contained in:
@ -31,9 +31,11 @@ class SimpleChunkManager implements ChunkManager{
|
||||
protected $chunks = [];
|
||||
|
||||
protected $seed;
|
||||
protected $worldHeight;
|
||||
|
||||
public function __construct($seed){
|
||||
public function __construct($seed, int $worldHeight = Level::Y_MAX){
|
||||
$this->seed = $seed;
|
||||
$this->worldHeight = $worldHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -159,4 +161,16 @@ class SimpleChunkManager implements ChunkManager{
|
||||
public function getSeed(){
|
||||
return $this->seed;
|
||||
}
|
||||
|
||||
public function getWorldHeight() : int{
|
||||
return $this->worldHeight;
|
||||
}
|
||||
|
||||
public function isInWorld(float $x, float $y, float $z) : bool{
|
||||
return (
|
||||
$x <= INT32_MAX and $x >= INT32_MIN and
|
||||
$y < $this->worldHeight and $y >= 0 and
|
||||
$z <= INT32_MAX and $z >= INT32_MIN
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user