mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Introduce EntityFactory
This contains all of the static stuff that was previously embedded in the Entity static root. This solves a bunch of problems like circular dependencies between parent and child classes, encapsulating logic and reducing the size of the enormous Entity.php.
This commit is contained in:
@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\level\particle;
|
||||
|
||||
use pocketmine\entity\Entity;
|
||||
use pocketmine\entity\EntityFactory;
|
||||
use pocketmine\entity\Skin;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemFactory;
|
||||
@ -80,7 +81,7 @@ class FloatingTextParticle extends Particle{
|
||||
$p = [];
|
||||
|
||||
if($this->entityId === null){
|
||||
$this->entityId = Entity::$entityCount++;
|
||||
$this->entityId = EntityFactory::nextRuntimeId();
|
||||
}else{
|
||||
$pk0 = new RemoveEntityPacket();
|
||||
$pk0->entityUniqueId = $this->entityId;
|
||||
|
Reference in New Issue
Block a user