mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Map Generator
This commit is contained in:
parent
1cf47d0328
commit
3b800ff6b4
8 changed files with 486 additions and 2 deletions
|
|
@ -68,6 +68,13 @@ class ChunkParser{
|
|||
return true;
|
||||
}
|
||||
|
||||
public function loadRaw($raw, $file){
|
||||
$this->file = $file;
|
||||
$this->raw = $raw;
|
||||
$this->chunkLength = $this->sectorLength * ord($this->raw{0});
|
||||
return true;
|
||||
}
|
||||
|
||||
private function getOffsetPosition($X, $Z){
|
||||
$data = substr($this->raw, ($X << 2) + ($Z << 7), 4); //$X * 4 + $Z * 128
|
||||
return array(ord($data{0}), ord($data{1}), ord($data{2}), ord($data{3}));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue