From 2b6a62be7756c7e6764138cb84c8ac5d3aa92671 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 5 Mar 2019 15:32:06 +0000 Subject: [PATCH] Fixed BlockFactory corruption with signs and banners --- src/pocketmine/block/SignPost.php | 4 ++++ src/pocketmine/block/StandingBanner.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/pocketmine/block/SignPost.php b/src/pocketmine/block/SignPost.php index 48748c6ed..761ea70dd 100644 --- a/src/pocketmine/block/SignPost.php +++ b/src/pocketmine/block/SignPost.php @@ -49,6 +49,10 @@ class SignPost extends Transparent{ $this->text = new SignText(); } + public function __clone(){ + $this->text = clone $this->text; + } + protected function writeStateToMeta() : int{ return $this->rotation; } diff --git a/src/pocketmine/block/StandingBanner.php b/src/pocketmine/block/StandingBanner.php index 18aa39743..f1021445f 100644 --- a/src/pocketmine/block/StandingBanner.php +++ b/src/pocketmine/block/StandingBanner.php @@ -54,6 +54,10 @@ class StandingBanner extends Transparent{ $this->patterns = new Deque(); } + public function __clone(){ + $this->patterns = $this->patterns->map(function(BannerPattern $pattern) : BannerPattern{ return clone $pattern; }); + } + protected function writeStateToMeta() : int{ return $this->rotation; }