Entity: add abstract getNetworkTypeId(), remove NETWORK_ID constant

this now requires that subclasses supply a proper NETWORK_ID.
This commit is contained in:
Dylan K. Taylor
2020-05-16 16:08:12 +01:00
parent 67666db827
commit c30dd9f1b6
21 changed files with 34 additions and 32 deletions

View File

@ -31,10 +31,12 @@ use pocketmine\nbt\tag\ShortTag;
use pocketmine\network\mcpe\protocol\types\entity\EntityLegacyIds;
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties;
use pocketmine\player\Player;
use function realpath;
use function sqrt;
class ExperienceOrb extends Entity{
public const NETWORK_ID = EntityLegacyIds::XP_ORB;
public static function getNetworkTypeId() : int{ return EntityLegacyIds::XP_ORB; }
public const TAG_VALUE_PC = "Value"; //short
public const TAG_VALUE_PE = "experience value"; //int (WTF?)