mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Fixed paintings not working in newly generated worlds
Paintings would not work unless at least one entity was loaded from disk (or saved).
This commit is contained in:
parent
a323a5e56d
commit
0ea3861d43
@ -173,8 +173,6 @@ final class EntityFactory{
|
|||||||
$this->register(Human::class, function(World $world, CompoundTag $nbt) : Human{
|
$this->register(Human::class, function(World $world, CompoundTag $nbt) : Human{
|
||||||
return new Human(Helper::parseLocation($nbt, $world), Human::parseSkinNBT($nbt), $nbt);
|
return new Human(Helper::parseLocation($nbt, $world), Human::parseSkinNBT($nbt), $nbt);
|
||||||
}, ['Human']);
|
}, ['Human']);
|
||||||
|
|
||||||
PaintingMotive::init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,6 +24,8 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\entity\object;
|
namespace pocketmine\entity\object;
|
||||||
|
|
||||||
class PaintingMotive{
|
class PaintingMotive{
|
||||||
|
private static bool $initialized = false;
|
||||||
|
|
||||||
/** @var PaintingMotive[] */
|
/** @var PaintingMotive[] */
|
||||||
protected static $motives = [];
|
protected static $motives = [];
|
||||||
|
|
||||||
@ -76,6 +78,9 @@ class PaintingMotive{
|
|||||||
* @return PaintingMotive[]
|
* @return PaintingMotive[]
|
||||||
*/
|
*/
|
||||||
public static function getAll() : array{
|
public static function getAll() : array{
|
||||||
|
if(!self::$initialized){
|
||||||
|
self::init();
|
||||||
|
}
|
||||||
return self::$motives;
|
return self::$motives;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user