Remove unnecessary BannerPattern copying on block clone

This commit is contained in:
Dylan K. Taylor 2019-08-06 10:18:02 +01:00
parent 9671b4d5cb
commit dec6f73f2f

View File

@ -36,7 +36,6 @@ use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing; use pocketmine\math\Facing;
use pocketmine\math\Vector3; use pocketmine\math\Vector3;
use pocketmine\player\Player; use pocketmine\player\Player;
use pocketmine\utils\Utils;
use pocketmine\world\BlockTransaction; use pocketmine\world\BlockTransaction;
use function assert; use function assert;
use function floor; use function floor;
@ -67,7 +66,8 @@ class Banner extends Transparent{
public function __clone(){ public function __clone(){
parent::__clone(); parent::__clone();
$this->patterns = $this->patterns->map(Utils::cloneCallback()); //pattern objects are considered immutable, so they don't need to be copied
$this->patterns = $this->patterns->copy();
} }
public function getId() : int{ public function getId() : int{