diff --git a/src/entity/EntityFactory.php b/src/entity/EntityFactory.php index 4bd743042..84838670a 100644 --- a/src/entity/EntityFactory.php +++ b/src/entity/EntityFactory.php @@ -173,8 +173,6 @@ final class EntityFactory{ $this->register(Human::class, function(World $world, CompoundTag $nbt) : Human{ return new Human(Helper::parseLocation($nbt, $world), Human::parseSkinNBT($nbt), $nbt); }, ['Human']); - - PaintingMotive::init(); } /** diff --git a/src/entity/object/PaintingMotive.php b/src/entity/object/PaintingMotive.php index a21bba2fc..28b52efe3 100644 --- a/src/entity/object/PaintingMotive.php +++ b/src/entity/object/PaintingMotive.php @@ -24,6 +24,8 @@ declare(strict_types=1); namespace pocketmine\entity\object; class PaintingMotive{ + private static bool $initialized = false; + /** @var PaintingMotive[] */ protected static $motives = []; @@ -76,6 +78,9 @@ class PaintingMotive{ * @return PaintingMotive[] */ public static function getAll() : array{ + if(!self::$initialized){ + self::init(); + } return self::$motives; }