diff --git a/src/pocketmine/block/Solid.php b/src/pocketmine/block/Solid.php index 10ee27a9fe..587007b0ab 100644 --- a/src/pocketmine/block/Solid.php +++ b/src/pocketmine/block/Solid.php @@ -21,12 +21,7 @@ namespace pocketmine\block; - abstract class Solid extends Block{ - - public function __construct($id, $meta = 0, $name = "Unknown"){ - parent::__construct($id, $meta, $name); - $this->isSolid = true; - $this->isFullBlock = true; - } + public $isSolid = true; + public $isFullBlock = true; } \ No newline at end of file diff --git a/src/pocketmine/level/format/generic/BaseFullChunk.php b/src/pocketmine/level/format/generic/BaseFullChunk.php index 3e48091f53..14ce8f3e86 100644 --- a/src/pocketmine/level/format/generic/BaseFullChunk.php +++ b/src/pocketmine/level/format/generic/BaseFullChunk.php @@ -237,7 +237,10 @@ abstract class BaseFullChunk implements FullChunk{ public function addTile(Tile $tile){ $this->tiles[$tile->getID()] = $tile; - $this->tileList[(($tile->z & 0x0f) << 12) | (($tile->x & 0x0f) << 8) | ($tile->y & 0xff)] = $tile; + if(isset($this->tileList[$index = (($tile->z & 0x0f) << 12) | (($tile->x & 0x0f) << 8) | ($tile->y & 0xff)]) and $this->tileList[$index] !== $tile){ + $this->tileList[$index]->close(); + } + $this->tileList[$index] = $tile; $this->hasChanged = true; }