From ea8c7230922fd3fcf542842d75b11afbd438aa2c Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 26 Apr 2019 18:15:31 +0100 Subject: [PATCH] EntityFactory: added some documentation --- src/pocketmine/entity/EntityFactory.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pocketmine/entity/EntityFactory.php b/src/pocketmine/entity/EntityFactory.php index deca79678..467bc3625 100644 --- a/src/pocketmine/entity/EntityFactory.php +++ b/src/pocketmine/entity/EntityFactory.php @@ -51,6 +51,14 @@ use function in_array; use function is_a; use function reset; +/** + * This class manages the creation of entities loaded from disk (and optionally entities created at runtime). + * + * You need to register your entity class into this factory if: + * a) you want to load/save your entity on disk (saving with chunks) + * b) you want to allow custom things to provide a custom class for your entity. Note that you must use + * create(MyEntity::class) instead of `new MyEntity()` if you want to allow this. + */ final class EntityFactory{ private static $entityCount = 1;