mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
MAp getFloor() method
This commit is contained in:
parent
3e54ceb8a3
commit
67d5e92def
2 changed files with 24 additions and 1 deletions
|
|
@ -154,6 +154,20 @@ class ChunkParser{
|
|||
fclose($fp);
|
||||
}
|
||||
|
||||
public function getFloor($x, $z){
|
||||
$X = $x >> 4;
|
||||
$Z = $z >> 4;
|
||||
$aX = $x - ($X << 4);
|
||||
$aZ = $z - ($Z << 4);
|
||||
$index = $aZ + ($aX << 4);
|
||||
for($y = 127; $y <= 0; --$y){
|
||||
if($this->map[$X][$Z][0][$index]{$y} !== "\x00"){
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $y;
|
||||
}
|
||||
|
||||
public function getBlock($x, $y, $z){
|
||||
$x = (int) $x;
|
||||
$y = (int) $y;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue