From d207a5daea18b9a4e20e40e3071d77c5ca542b8a Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sat, 3 Jan 2015 03:38:25 +0100 Subject: [PATCH] WTF, ghost objects and why does this fix it? (and btw, fixes #2488) --- src/pocketmine/block/Block.php | 3 ++- src/pocketmine/item/Item.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index 1cb51ff3c..201e10d53 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -987,6 +987,7 @@ class Block extends Position implements Metadatable{ $this->y = (int) $v->y; $this->z = (int) $v->z; $this->level = $v->level; + $this->boundingBox = null; } /** @@ -1067,7 +1068,7 @@ class Block extends Position implements Metadatable{ if($this->boundingBox !== null){ return $this->boundingBox; }else{ - return $this->boundingBox = $this->recalculateBoundingBox(); + return ($this->boundingBox = $this->recalculateBoundingBox()); } } diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index 8a5de9b75..301dd1e78 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -565,7 +565,7 @@ class Item{ public function getBlock(){ if($this->block instanceof Block){ - return $this->block; + return clone $this->block; }else{ return Block::get(self::AIR); }