From a02f422d857b90eb20d0f02e30cf687aa16d0488 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 17 Nov 2018 16:29:53 +0000 Subject: [PATCH] SubChunk: Fixed constant redefinition on worker threads when autoloading this happens when workers inherit constants but not classes. --- src/pocketmine/level/format/SubChunk.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/level/format/SubChunk.php b/src/pocketmine/level/format/SubChunk.php index a0c811b4f..8ee9a118e 100644 --- a/src/pocketmine/level/format/SubChunk.php +++ b/src/pocketmine/level/format/SubChunk.php @@ -23,7 +23,11 @@ declare(strict_types=1); namespace pocketmine\level\format; -define(__NAMESPACE__ . '\ZERO_NIBBLE_ARRAY', str_repeat("\x00", 2048)); +$name = __NAMESPACE__ . '\ZERO_NIBBLE_ARRAY'; +if(!defined($name)){ + define($name, str_repeat("\x00", 2048)); +} +unset($name); class SubChunk implements SubChunkInterface{ protected $ids;