diff --git a/src/pocketmine/level/format/anvil/Chunk.php b/src/pocketmine/level/format/anvil/Chunk.php index d3491c0c0..c9bd003e7 100644 --- a/src/pocketmine/level/format/anvil/Chunk.php +++ b/src/pocketmine/level/format/anvil/Chunk.php @@ -152,7 +152,7 @@ class Chunk extends BaseChunk{ } public function toBinary(){ - $nbt = $this->getNBT(); + $nbt = clone $this->getNBT(); $nbt->xPos = new Int("xPos", $this->x); $nbt->zPos = new Int("zPos", $this->z); diff --git a/src/pocketmine/level/format/mcregion/Chunk.php b/src/pocketmine/level/format/mcregion/Chunk.php index c3b99a86b..0463ac361 100644 --- a/src/pocketmine/level/format/mcregion/Chunk.php +++ b/src/pocketmine/level/format/mcregion/Chunk.php @@ -248,7 +248,7 @@ class Chunk extends BaseFullChunk{ } public function toBinary(){ - $nbt = $this->getNBT(); + $nbt = clone $this->getNBT(); $nbt->xPos = new Int("xPos", $this->x); $nbt->zPos = new Int("zPos", $this->z);