Further refactors to prepare for y=-64 lower limit

This commit is contained in:
Dylan K. Taylor
2021-03-18 00:08:16 +00:00
parent b844c4266d
commit eb9a68edee
17 changed files with 101 additions and 51 deletions

View File

@ -36,10 +36,15 @@ interface WorldProvider{
*/
public function __construct(string $path);
/**
* Returns the lowest buildable Y coordinate of this world
*/
public function getWorldMinY() : int;
/**
* Gets the build height limit of this world
*/
public function getWorldHeight() : int;
public function getWorldMaxY() : int;
public function getPath() : string;

View File

@ -132,7 +132,11 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{
return new BedrockWorldData($this->getPath() . DIRECTORY_SEPARATOR . "level.dat");
}
public function getWorldHeight() : int{
public function getWorldMinY() : int{
return 0;
}
public function getWorldMaxY() : int{
return 256;
}

View File

@ -51,7 +51,11 @@ class Anvil extends RegionWorldProvider{
return 19133;
}
public function getWorldHeight() : int{
public function getWorldMinY() : int{
return 0;
}
public function getWorldMaxY() : int{
//TODO: add world height options
return 256;
}

View File

@ -106,7 +106,11 @@ class McRegion extends RegionWorldProvider{
return 19132;
}
public function getWorldHeight() : int{
public function getWorldMinY() : int{
return 0;
}
public function getWorldMaxY() : int{
//TODO: add world height options
return 128;
}

View File

@ -50,7 +50,11 @@ class PMAnvil extends RegionWorldProvider{
return -1; //Not a PC format, only PocketMine-MP
}
public function getWorldHeight() : int{
public function getWorldMinY() : int{
return 0;
}
public function getWorldMaxY() : int{
return 256;
}
}