mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-09 07:20:15 +00:00
Fix crash when a player is added to the world
This commit is contained in:
parent
cfafb584a8
commit
fe70b31881
@ -2778,7 +2778,7 @@ class World implements ChunkManager{
|
||||
throw new AssumptionFailedError("Found two different entities sharing entity ID " . $entity->getId());
|
||||
}
|
||||
}
|
||||
if(!EntityFactory::getInstance()->isRegistered($entity::class)){
|
||||
if(!EntityFactory::getInstance()->isRegistered($entity::class) && !$entity instanceof Player){
|
||||
//canSaveWithChunk is mutable, so that means it could be toggled after adding the entity and cause a crash
|
||||
//later on. Better we just force all entities to have a save ID, even if it might not be needed.
|
||||
throw new \LogicException("Entity " . $entity::class . " is not registered for a save ID in EntityFactory");
|
||||
|
Loading…
x
Reference in New Issue
Block a user