mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +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){
|
||||
$this->nbt = $nbt;
|
||||
|
||||
if(isset($this->nbt->Entities) and $this->nbt->Entities instanceof Enum){
|
||||
$this->nbt->Entities->setTagType(NBT::TAG_Compound);
|
||||
}else{
|
||||
if(!isset($this->nbt->Entities) or !($this->nbt->Entities instanceof Enum)){
|
||||
$this->nbt->Entities = new Enum("Entities", []);
|
||||
$this->nbt->Entities->setTagType(NBT::TAG_Compound);
|
||||
}
|
||||
|
||||
if(isset($this->nbt->TileEntities) and $this->nbt->TileEntities instanceof Enum){
|
||||
$this->nbt->TileEntities->setTagType(NBT::TAG_Compound);
|
||||
}else{
|
||||
if(!isset($this->nbt->TileEntities) or !($this->nbt->TileEntities instanceof Enum)){
|
||||
$this->nbt->TileEntities = new Enum("TileEntities", []);
|
||||
$this->nbt->TileEntities->setTagType(NBT::TAG_Compound);
|
||||
}
|
||||
|
||||
if(isset($this->nbt->TileTicks) and $this->nbt->TileTicks instanceof Enum){
|
||||
$this->nbt->TileTicks->setTagType(NBT::TAG_Compound);
|
||||
}else{
|
||||
if(!isset($this->nbt->TileTicks) or !($this->nbt->TileTicks instanceof Enum)){
|
||||
$this->nbt->TileTicks = new Enum("TileTicks", []);
|
||||
$this->nbt->TileTicks->setTagType(NBT::TAG_Compound);
|
||||
}
|
||||
|
||||
if(isset($this->nbt->Sections) and $this->nbt->Sections instanceof Enum){
|
||||
$this->nbt->Sections->setTagType(NBT::TAG_Compound);
|
||||
}else{
|
||||
if(!isset($this->nbt->Sections) or !($this->nbt->Sections instanceof Enum)){
|
||||
$this->nbt->Sections = new Enum("Sections", []);
|
||||
$this->nbt->Sections->setTagType(NBT::TAG_Compound);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ class NBT{
|
||||
}
|
||||
$buffer = "";
|
||||
for(; $len > 0; --$len, ++$this->offset){
|
||||
$buffer .= @$this->buffer{$this->offset};
|
||||
$buffer .= $this->buffer{$this->offset};
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
|
Loading…
x
Reference in New Issue
Block a user