mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Free unused map data
This commit is contained in:
parent
0f4ce5a539
commit
28c62be43e
@ -120,37 +120,10 @@ class ChunkParser{
|
|||||||
return $chunk;
|
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(){
|
public function loadMap(){
|
||||||
|
if($this->raw == ""){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$this->loadLocationTable();
|
$this->loadLocationTable();
|
||||||
console("[DEBUG] Loading chunks...", true, true, 2);
|
console("[DEBUG] Loading chunks...", true, true, 2);
|
||||||
for($x = 0; $x < 16; ++$x){
|
for($x = 0; $x < 16; ++$x){
|
||||||
@ -159,6 +132,7 @@ class ChunkParser{
|
|||||||
$this->map[$x][$z] = $this->parseChunk($x, $z);
|
$this->map[$x][$z] = $this->parseChunk($x, $z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$this->raw = b"";
|
||||||
console("[DEBUG] Chunks loaded!", true, true, 2);
|
console("[DEBUG] Chunks loaded!", true, true, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user