From 95f2f347ff82cb78cb0b48e60fcef88d5b9a79bd Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Sun, 19 May 2013 23:03:09 +0200 Subject: [PATCH] Updated Level::setMiniChunk() and Level::setRawBlock --- src/world/Level.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/world/Level.php b/src/world/Level.php index 908bfd2c25..ef51dc7eef 100644 --- a/src/world/Level.php +++ b/src/world/Level.php @@ -206,7 +206,15 @@ class Level{ } public function setBlockRaw(Vector3 $pos, Block $block){ - return $this->level->setBlock($pos->x, $pos->y, $pos->z, $block->getID(), $block->getMetadata()); + if(($ret = $this->level->setBlock($pos->x, $pos->y, $pos->z, $block->getID(), $block->getMetadata())) === true){ + if(!isset($this->changedBlocks[$i])){ + $this->changedBlocks[$i] = array(); + $this->changedCount[$i] = 0; + } + $this->changedBlocks[$i][] = $block; + ++$this->changedCount[$i]; + } + return $ret; } public function setBlock(Vector3 $pos, Block $block, $update = true, $tiles = false){ @@ -250,6 +258,7 @@ class Level{ } public function setMiniChunk($X, $Y, $Z, $data){ + $this->changedCount[$X.":".$Y.":".$Z] = 4096; return $this->level->setMiniChunk($X, $Y, $Z, $data); }