mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 00:29:54 +00:00
Better Anvil chunk loading
This commit is contained in:
parent
ec93ed3e3d
commit
9e74169d74
@ -42,30 +42,22 @@ class Chunk extends BaseChunk{
|
|||||||
public function __construct($level, Compound $nbt){
|
public function __construct($level, Compound $nbt){
|
||||||
$this->nbt = $nbt;
|
$this->nbt = $nbt;
|
||||||
|
|
||||||
if(isset($this->nbt->Entities) and $this->nbt->Entities instanceof Enum){
|
if(!isset($this->nbt->Entities) or !($this->nbt->Entities instanceof Enum)){
|
||||||
$this->nbt->Entities->setTagType(NBT::TAG_Compound);
|
|
||||||
}else{
|
|
||||||
$this->nbt->Entities = new Enum("Entities", []);
|
$this->nbt->Entities = new Enum("Entities", []);
|
||||||
$this->nbt->Entities->setTagType(NBT::TAG_Compound);
|
$this->nbt->Entities->setTagType(NBT::TAG_Compound);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($this->nbt->TileEntities) and $this->nbt->TileEntities instanceof Enum){
|
if(!isset($this->nbt->TileEntities) or !($this->nbt->TileEntities instanceof Enum)){
|
||||||
$this->nbt->TileEntities->setTagType(NBT::TAG_Compound);
|
|
||||||
}else{
|
|
||||||
$this->nbt->TileEntities = new Enum("TileEntities", []);
|
$this->nbt->TileEntities = new Enum("TileEntities", []);
|
||||||
$this->nbt->TileEntities->setTagType(NBT::TAG_Compound);
|
$this->nbt->TileEntities->setTagType(NBT::TAG_Compound);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($this->nbt->TileTicks) and $this->nbt->TileTicks instanceof Enum){
|
if(!isset($this->nbt->TileTicks) or !($this->nbt->TileTicks instanceof Enum)){
|
||||||
$this->nbt->TileTicks->setTagType(NBT::TAG_Compound);
|
|
||||||
}else{
|
|
||||||
$this->nbt->TileTicks = new Enum("TileTicks", []);
|
$this->nbt->TileTicks = new Enum("TileTicks", []);
|
||||||
$this->nbt->TileTicks->setTagType(NBT::TAG_Compound);
|
$this->nbt->TileTicks->setTagType(NBT::TAG_Compound);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($this->nbt->Sections) and $this->nbt->Sections instanceof Enum){
|
if(!isset($this->nbt->Sections) or !($this->nbt->Sections instanceof Enum)){
|
||||||
$this->nbt->Sections->setTagType(NBT::TAG_Compound);
|
|
||||||
}else{
|
|
||||||
$this->nbt->Sections = new Enum("Sections", []);
|
$this->nbt->Sections = new Enum("Sections", []);
|
||||||
$this->nbt->Sections->setTagType(NBT::TAG_Compound);
|
$this->nbt->Sections->setTagType(NBT::TAG_Compound);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ class NBT{
|
|||||||
}
|
}
|
||||||
$buffer = "";
|
$buffer = "";
|
||||||
for(; $len > 0; --$len, ++$this->offset){
|
for(; $len > 0; --$len, ++$this->offset){
|
||||||
$buffer .= @$this->buffer{$this->offset};
|
$buffer .= $this->buffer{$this->offset};
|
||||||
}
|
}
|
||||||
|
|
||||||
return $buffer;
|
return $buffer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user