Map Generator

This commit is contained in:
Shoghi Cervantes Pueyo
2012-12-23 02:02:02 +01:00
parent 1cf47d0328
commit 3b800ff6b4
8 changed files with 486 additions and 2 deletions

View File

@ -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}));