mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 07:54:19 +00:00
Free unused map data
This commit is contained in:
parent
0f4ce5a539
commit
28c62be43e
@ -119,46 +119,20 @@ class ChunkParser{
|
||||
}
|
||||
return $chunk;
|
||||
}
|
||||
|
||||
public function getRawColumn($offset, $l){
|
||||
$data = "";
|
||||
if($l === 128){
|
||||
$data = substr($this->raw, $offset, $l);
|
||||
}elseif($l === 64){
|
||||
for($i = 0; $i < $l; ++$i){
|
||||
$d = ord($this->raw{$offset + $i});
|
||||
$data .= chr($d >> 4);
|
||||
$data .= chr($d & 0x0F);
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function parseColumn($offset, $l){
|
||||
$data = array();
|
||||
if($l === 128){
|
||||
for($i = 0; $i < $l; ++$i){
|
||||
$data[] = ord($this->raw{$offset + $i});
|
||||
}
|
||||
}elseif($l === 64){
|
||||
for($i = 0; $i < $l; ++$i){
|
||||
$d = ord($this->raw{$offset + $i});
|
||||
$data[] = $d >> 4;
|
||||
$data[] = $d & 0x0F;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function loadMap(){
|
||||
if($this->raw == ""){
|
||||
return false;
|
||||
}
|
||||
$this->loadLocationTable();
|
||||
console("[DEBUG] Loading chunks...", true, true, 2);
|
||||
for($x = 0; $x < 16; ++$x){
|
||||
$this->map[$x] = array();
|
||||
for($z = 0; $z < 16; ++$z){
|
||||
$this->map[$x][$z] = $this->parseChunk($x, $z);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->raw = b"";
|
||||
console("[DEBUG] Chunks loaded!", true, true, 2);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user