mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 04:00:29 +00:00
Entity: add abstract getNetworkTypeId(), remove NETWORK_ID constant
this now requires that subclasses supply a proper NETWORK_ID.
This commit is contained in:
@@ -252,8 +252,8 @@ class ItemFactory{
|
||||
|
||||
foreach(EntityFactory::getInstance()->getKnownTypes() as $className){
|
||||
/** @var Living|string $className */
|
||||
if(is_a($className, Living::class, true) and $className::NETWORK_ID !== -1){
|
||||
$this->register(new SpawnEgg(ItemIds::SPAWN_EGG, $className::NETWORK_ID, "Spawn Egg", $className));
|
||||
if(is_a($className, Living::class, true) and $className::getNetworkTypeId() !== -1){
|
||||
$this->register(new SpawnEgg(ItemIds::SPAWN_EGG, $className::getNetworkTypeId(), "Spawn Egg", $className));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user