move network entity IDs to network namespace

we're going to need a dedicated data package, because this stuff isn't just network-specific.
This commit is contained in:
Dylan K. Taylor 2019-07-19 15:33:30 +01:00
parent 0ebd3e6ca2
commit ac12911561
18 changed files with 157 additions and 137 deletions

View File

@ -44,18 +44,18 @@ use pocketmine\nbt\tag\DoubleTag;
use pocketmine\nbt\tag\FloatTag;
use pocketmine\nbt\tag\ListTag;
use pocketmine\nbt\tag\StringTag;
use pocketmine\network\mcpe\protocol\ActorEventPacket;
use pocketmine\network\mcpe\protocol\AddActorPacket;
use pocketmine\network\mcpe\protocol\AnimatePacket;
use pocketmine\network\mcpe\protocol\MoveActorAbsolutePacket;
use pocketmine\network\mcpe\protocol\RemoveActorPacket;
use pocketmine\network\mcpe\protocol\SetActorDataPacket;
use pocketmine\network\mcpe\protocol\SetActorMotionPacket;
use pocketmine\network\mcpe\protocol\types\DataPropertyManager;
use pocketmine\network\mcpe\protocol\types\EntityMetadataFlags;
use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties;
use pocketmine\network\mcpe\protocol\types\EntityMetadataTypes;
use pocketmine\player\Player;
use pocketmine\network\mcpe\protocol\AddActorPacket;
use pocketmine\network\mcpe\protocol\ActorEventPacket;
use pocketmine\network\mcpe\protocol\MoveActorAbsolutePacket;
use pocketmine\network\mcpe\protocol\RemoveActorPacket;
use pocketmine\network\mcpe\protocol\SetActorDataPacket;
use pocketmine\network\mcpe\protocol\SetActorMotionPacket;
use pocketmine\Server;
use pocketmine\timings\Timings;
use pocketmine\timings\TimingsHandler;
@ -78,7 +78,7 @@ use function sin;
use function spl_object_id;
use const M_PI_2;
abstract class Entity extends Location implements EntityIds{
abstract class Entity extends Location{
public const MOTION_THRESHOLD = 0.00001;

View File

@ -42,6 +42,7 @@ use pocketmine\nbt\tag\FloatTag;
use pocketmine\nbt\tag\IntTag;
use pocketmine\nbt\tag\ListTag;
use pocketmine\nbt\tag\StringTag;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\utils\Utils;
use pocketmine\world\World;
use function array_keys;
@ -79,20 +80,20 @@ final class EntityFactory{
//define legacy save IDs first - use them for saving for maximum compatibility with Minecraft PC
//TODO: index them by version to allow proper multi-save compatibility
self::register(Arrow::class, ['Arrow', 'minecraft:arrow'], EntityIds::ARROW);
self::register(Egg::class, ['Egg', 'minecraft:egg'], EntityIds::EGG);
self::register(EnderPearl::class, ['ThrownEnderpearl', 'minecraft:ender_pearl'], EntityIds::ENDER_PEARL);
self::register(ExperienceBottle::class, ['ThrownExpBottle', 'minecraft:xp_bottle'], EntityIds::XP_BOTTLE);
self::register(ExperienceOrb::class, ['XPOrb', 'minecraft:xp_orb'], EntityIds::XP_ORB);
self::register(FallingBlock::class, ['FallingSand', 'minecraft:falling_block'], EntityIds::FALLING_BLOCK);
self::register(ItemEntity::class, ['Item', 'minecraft:item'], EntityIds::ITEM);
self::register(Painting::class, ['Painting', 'minecraft:painting'], EntityIds::PAINTING);
self::register(PrimedTNT::class, ['PrimedTnt', 'PrimedTNT', 'minecraft:tnt'], EntityIds::TNT);
self::register(Snowball::class, ['Snowball', 'minecraft:snowball'], EntityIds::SNOWBALL);
self::register(SplashPotion::class, ['ThrownPotion', 'minecraft:potion', 'thrownpotion'], EntityIds::SPLASH_POTION);
self::register(Squid::class, ['Squid', 'minecraft:squid'], EntityIds::SQUID);
self::register(Villager::class, ['Villager', 'minecraft:villager'], EntityIds::VILLAGER);
self::register(Zombie::class, ['Zombie', 'minecraft:zombie'], EntityIds::ZOMBIE);
self::register(Arrow::class, ['Arrow', 'minecraft:arrow'], EntityLegacyIds::ARROW);
self::register(Egg::class, ['Egg', 'minecraft:egg'], EntityLegacyIds::EGG);
self::register(EnderPearl::class, ['ThrownEnderpearl', 'minecraft:ender_pearl'], EntityLegacyIds::ENDER_PEARL);
self::register(ExperienceBottle::class, ['ThrownExpBottle', 'minecraft:xp_bottle'], EntityLegacyIds::XP_BOTTLE);
self::register(ExperienceOrb::class, ['XPOrb', 'minecraft:xp_orb'], EntityLegacyIds::XP_ORB);
self::register(FallingBlock::class, ['FallingSand', 'minecraft:falling_block'], EntityLegacyIds::FALLING_BLOCK);
self::register(ItemEntity::class, ['Item', 'minecraft:item'], EntityLegacyIds::ITEM);
self::register(Painting::class, ['Painting', 'minecraft:painting'], EntityLegacyIds::PAINTING);
self::register(PrimedTNT::class, ['PrimedTnt', 'PrimedTNT', 'minecraft:tnt'], EntityLegacyIds::TNT);
self::register(Snowball::class, ['Snowball', 'minecraft:snowball'], EntityLegacyIds::SNOWBALL);
self::register(SplashPotion::class, ['ThrownPotion', 'minecraft:potion', 'thrownpotion'], EntityLegacyIds::SPLASH_POTION);
self::register(Squid::class, ['Squid', 'minecraft:squid'], EntityLegacyIds::SQUID);
self::register(Villager::class, ['Villager', 'minecraft:villager'], EntityLegacyIds::VILLAGER);
self::register(Zombie::class, ['Zombie', 'minecraft:zombie'], EntityLegacyIds::ZOMBIE);
self::register(Human::class, ['Human']);

View File

@ -29,13 +29,14 @@ use pocketmine\item\VanillaItems;
use pocketmine\math\Vector3;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\network\mcpe\protocol\ActorEventPacket;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use function atan2;
use function mt_rand;
use function sqrt;
use const M_PI;
class Squid extends WaterAnimal{
public const NETWORK_ID = self::SQUID;
public const NETWORK_ID = EntityLegacyIds::SQUID;
public $width = 0.95;
public $height = 0.95;

View File

@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\entity;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\network\mcpe\protocol\types\EntityMetadataFlags;
use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties;
@ -34,7 +35,7 @@ class Villager extends Living implements Ageable{
public const PROFESSION_BLACKSMITH = 3;
public const PROFESSION_BUTCHER = 4;
public const NETWORK_ID = self::VILLAGER;
public const NETWORK_ID = EntityLegacyIds::VILLAGER;
public $width = 0.6;
public $height = 1.8;

View File

@ -24,10 +24,11 @@ declare(strict_types=1);
namespace pocketmine\entity;
use pocketmine\item\VanillaItems;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use function mt_rand;
class Zombie extends Living{
public const NETWORK_ID = self::ZOMBIE;
public const NETWORK_ID = EntityLegacyIds::ZOMBIE;
public $width = 0.6;
public $height = 1.8;

View File

@ -28,12 +28,13 @@ use pocketmine\entity\Human;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\IntTag;
use pocketmine\nbt\tag\ShortTag;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties;
use pocketmine\player\Player;
use function sqrt;
class ExperienceOrb extends Entity{
public const NETWORK_ID = self::XP_ORB;
public const NETWORK_ID = EntityLegacyIds::XP_ORB;
public const TAG_VALUE_PC = "Value"; //short
public const TAG_VALUE_PE = "experience value"; //int (WTF?)

View File

@ -32,11 +32,12 @@ use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\nbt\tag\ByteTag;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\IntTag;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties;
use function get_class;
class FallingBlock extends Entity{
public const NETWORK_ID = self::FALLING_BLOCK;
public const NETWORK_ID = EntityLegacyIds::FALLING_BLOCK;
public $width = 0.98;
public $height = 0.98;

View File

@ -31,14 +31,15 @@ use pocketmine\event\inventory\InventoryPickupItemEvent;
use pocketmine\item\Item;
use pocketmine\item\ItemIds;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\player\Player;
use pocketmine\network\mcpe\protocol\AddItemActorPacket;
use pocketmine\network\mcpe\protocol\TakeItemActorPacket;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\player\Player;
use function get_class;
use function max;
class ItemEntity extends Entity{
public const NETWORK_ID = self::ITEM;
public const NETWORK_ID = EntityLegacyIds::ITEM;
public const DEFAULT_DESPAWN_DELAY = 6000; //5 minutes
public const NEVER_DESPAWN = -1;

View File

@ -34,13 +34,14 @@ use pocketmine\math\Vector3;
use pocketmine\nbt\tag\ByteTag;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\network\mcpe\protocol\AddPaintingPacket;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\player\Player;
use pocketmine\world\particle\DestroyBlockParticle;
use pocketmine\world\World;
use function ceil;
class Painting extends Entity{
public const NETWORK_ID = self::PAINTING;
public const NETWORK_ID = EntityLegacyIds::PAINTING;
/** @var float */
protected $gravity = 0.0;

View File

@ -29,6 +29,7 @@ use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\event\entity\ExplosionPrimeEvent;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\ShortTag;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\network\mcpe\protocol\types\EntityMetadataFlags;
use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties;
use pocketmine\world\Explosion;
@ -36,7 +37,7 @@ use pocketmine\world\Position;
use pocketmine\world\sound\IgniteSound;
class PrimedTNT extends Entity implements Explosive{
public const NETWORK_ID = self::TNT;
public const NETWORK_ID = EntityLegacyIds::TNT;
public $width = 0.98;
public $height = 0.98;

View File

@ -32,6 +32,7 @@ use pocketmine\math\RayTraceResult;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\network\mcpe\protocol\ActorEventPacket;
use pocketmine\network\mcpe\protocol\TakeItemActorPacket;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\network\mcpe\protocol\types\EntityMetadataFlags;
use pocketmine\player\Player;
use pocketmine\world\sound\ArrowHitSound;
@ -40,7 +41,7 @@ use function mt_rand;
use function sqrt;
class Arrow extends Projectile{
public const NETWORK_ID = self::ARROW;
public const NETWORK_ID = EntityLegacyIds::ARROW;
public const PICKUP_NONE = 0;
public const PICKUP_ANY = 1;

View File

@ -25,10 +25,11 @@ namespace pocketmine\entity\projectile;
use pocketmine\event\entity\ProjectileHitEvent;
use pocketmine\item\VanillaItems;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\world\particle\ItemBreakParticle;
class Egg extends Throwable{
public const NETWORK_ID = self::EGG;
public const NETWORK_ID = EntityLegacyIds::EGG;
//TODO: spawn chickens on collision

View File

@ -30,11 +30,12 @@ use pocketmine\event\entity\ProjectileHitEvent;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\RayTraceResult;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\world\particle\EndermanTeleportParticle;
use pocketmine\world\sound\EndermanTeleportSound;
class EnderPearl extends Throwable{
public const NETWORK_ID = self::ENDER_PEARL;
public const NETWORK_ID = EntityLegacyIds::ENDER_PEARL;
protected function calculateInterceptWithBlock(Block $block, Vector3 $start, Vector3 $end) : ?RayTraceResult{
if($block->getId() !== BlockLegacyIds::AIR and empty($block->getCollisionBoxes())){

View File

@ -24,12 +24,13 @@ declare(strict_types=1);
namespace pocketmine\entity\projectile;
use pocketmine\event\entity\ProjectileHitEvent;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\world\particle\PotionSplashParticle;
use pocketmine\world\sound\PotionSplashSound;
use function mt_rand;
class ExperienceBottle extends Throwable{
public const NETWORK_ID = self::XP_BOTTLE;
public const NETWORK_ID = EntityLegacyIds::XP_BOTTLE;
protected $gravity = 0.07;

View File

@ -24,10 +24,11 @@ declare(strict_types=1);
namespace pocketmine\entity\projectile;
use pocketmine\event\entity\ProjectileHitEvent;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\world\particle\SnowballPoofParticle;
class Snowball extends Throwable{
public const NETWORK_ID = self::SNOWBALL;
public const NETWORK_ID = EntityLegacyIds::SNOWBALL;
protected function onHit(ProjectileHitEvent $event) : void{
for($i = 0; $i < 6; ++$i){

View File

@ -33,6 +33,7 @@ use pocketmine\event\entity\ProjectileHitEntityEvent;
use pocketmine\event\entity\ProjectileHitEvent;
use pocketmine\item\Potion;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\network\mcpe\protocol\types\EntityMetadataFlags;
use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties;
use pocketmine\utils\Color;
@ -43,7 +44,7 @@ use function sqrt;
class SplashPotion extends Throwable{
public const NETWORK_ID = self::SPLASH_POTION;
public const NETWORK_ID = EntityLegacyIds::SPLASH_POTION;
protected $gravity = 0.05;
protected $drag = 0.01;

View File

@ -26,10 +26,10 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\entity\Attribute;
use pocketmine\entity\EntityIds;
use pocketmine\math\Vector3;
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\network\mcpe\protocol\types\EntityLink;
use function array_search;
use function count;
@ -45,104 +45,104 @@ class AddActorPacket extends DataPacket implements ClientboundPacket{
* TODO: remove this on 4.0
*/
public const LEGACY_ID_MAP_BC = [
EntityIds::NPC => "minecraft:npc",
EntityIds::PLAYER => "minecraft:player",
EntityIds::WITHER_SKELETON => "minecraft:wither_skeleton",
EntityIds::HUSK => "minecraft:husk",
EntityIds::STRAY => "minecraft:stray",
EntityIds::WITCH => "minecraft:witch",
EntityIds::ZOMBIE_VILLAGER => "minecraft:zombie_villager",
EntityIds::BLAZE => "minecraft:blaze",
EntityIds::MAGMA_CUBE => "minecraft:magma_cube",
EntityIds::GHAST => "minecraft:ghast",
EntityIds::CAVE_SPIDER => "minecraft:cave_spider",
EntityIds::SILVERFISH => "minecraft:silverfish",
EntityIds::ENDERMAN => "minecraft:enderman",
EntityIds::SLIME => "minecraft:slime",
EntityIds::ZOMBIE_PIGMAN => "minecraft:zombie_pigman",
EntityIds::SPIDER => "minecraft:spider",
EntityIds::SKELETON => "minecraft:skeleton",
EntityIds::CREEPER => "minecraft:creeper",
EntityIds::ZOMBIE => "minecraft:zombie",
EntityIds::SKELETON_HORSE => "minecraft:skeleton_horse",
EntityIds::MULE => "minecraft:mule",
EntityIds::DONKEY => "minecraft:donkey",
EntityIds::DOLPHIN => "minecraft:dolphin",
EntityIds::TROPICALFISH => "minecraft:tropicalfish",
EntityIds::WOLF => "minecraft:wolf",
EntityIds::SQUID => "minecraft:squid",
EntityIds::DROWNED => "minecraft:drowned",
EntityIds::SHEEP => "minecraft:sheep",
EntityIds::MOOSHROOM => "minecraft:mooshroom",
EntityIds::PANDA => "minecraft:panda",
EntityIds::SALMON => "minecraft:salmon",
EntityIds::PIG => "minecraft:pig",
EntityIds::VILLAGER => "minecraft:villager",
EntityIds::COD => "minecraft:cod",
EntityIds::PUFFERFISH => "minecraft:pufferfish",
EntityIds::COW => "minecraft:cow",
EntityIds::CHICKEN => "minecraft:chicken",
EntityIds::BALLOON => "minecraft:balloon",
EntityIds::LLAMA => "minecraft:llama",
EntityIds::IRON_GOLEM => "minecraft:iron_golem",
EntityIds::RABBIT => "minecraft:rabbit",
EntityIds::SNOW_GOLEM => "minecraft:snow_golem",
EntityIds::BAT => "minecraft:bat",
EntityIds::OCELOT => "minecraft:ocelot",
EntityIds::HORSE => "minecraft:horse",
EntityIds::CAT => "minecraft:cat",
EntityIds::POLAR_BEAR => "minecraft:polar_bear",
EntityIds::ZOMBIE_HORSE => "minecraft:zombie_horse",
EntityIds::TURTLE => "minecraft:turtle",
EntityIds::PARROT => "minecraft:parrot",
EntityIds::GUARDIAN => "minecraft:guardian",
EntityIds::ELDER_GUARDIAN => "minecraft:elder_guardian",
EntityIds::VINDICATOR => "minecraft:vindicator",
EntityIds::WITHER => "minecraft:wither",
EntityIds::ENDER_DRAGON => "minecraft:ender_dragon",
EntityIds::SHULKER => "minecraft:shulker",
EntityIds::ENDERMITE => "minecraft:endermite",
EntityIds::MINECART => "minecraft:minecart",
EntityIds::HOPPER_MINECART => "minecraft:hopper_minecart",
EntityIds::TNT_MINECART => "minecraft:tnt_minecart",
EntityIds::CHEST_MINECART => "minecraft:chest_minecart",
EntityIds::COMMAND_BLOCK_MINECART => "minecraft:command_block_minecart",
EntityIds::ARMOR_STAND => "minecraft:armor_stand",
EntityIds::ITEM => "minecraft:item",
EntityIds::TNT => "minecraft:tnt",
EntityIds::FALLING_BLOCK => "minecraft:falling_block",
EntityIds::XP_BOTTLE => "minecraft:xp_bottle",
EntityIds::XP_ORB => "minecraft:xp_orb",
EntityIds::EYE_OF_ENDER_SIGNAL => "minecraft:eye_of_ender_signal",
EntityIds::ENDER_CRYSTAL => "minecraft:ender_crystal",
EntityIds::SHULKER_BULLET => "minecraft:shulker_bullet",
EntityIds::FISHING_HOOK => "minecraft:fishing_hook",
EntityIds::DRAGON_FIREBALL => "minecraft:dragon_fireball",
EntityIds::ARROW => "minecraft:arrow",
EntityIds::SNOWBALL => "minecraft:snowball",
EntityIds::EGG => "minecraft:egg",
EntityIds::PAINTING => "minecraft:painting",
EntityIds::THROWN_TRIDENT => "minecraft:thrown_trident",
EntityIds::FIREBALL => "minecraft:fireball",
EntityIds::SPLASH_POTION => "minecraft:splash_potion",
EntityIds::ENDER_PEARL => "minecraft:ender_pearl",
EntityIds::LEASH_KNOT => "minecraft:leash_knot",
EntityIds::WITHER_SKULL => "minecraft:wither_skull",
EntityIds::WITHER_SKULL_DANGEROUS => "minecraft:wither_skull_dangerous",
EntityIds::BOAT => "minecraft:boat",
EntityIds::LIGHTNING_BOLT => "minecraft:lightning_bolt",
EntityIds::SMALL_FIREBALL => "minecraft:small_fireball",
EntityIds::LLAMA_SPIT => "minecraft:llama_spit",
EntityIds::AREA_EFFECT_CLOUD => "minecraft:area_effect_cloud",
EntityIds::LINGERING_POTION => "minecraft:lingering_potion",
EntityIds::FIREWORKS_ROCKET => "minecraft:fireworks_rocket",
EntityIds::EVOCATION_FANG => "minecraft:evocation_fang",
EntityIds::EVOCATION_ILLAGER => "minecraft:evocation_illager",
EntityIds::VEX => "minecraft:vex",
EntityIds::AGENT => "minecraft:agent",
EntityIds::ICE_BOMB => "minecraft:ice_bomb",
EntityIds::PHANTOM => "minecraft:phantom",
EntityIds::TRIPOD_CAMERA => "minecraft:tripod_camera"
EntityLegacyIds::NPC => "minecraft:npc",
EntityLegacyIds::PLAYER => "minecraft:player",
EntityLegacyIds::WITHER_SKELETON => "minecraft:wither_skeleton",
EntityLegacyIds::HUSK => "minecraft:husk",
EntityLegacyIds::STRAY => "minecraft:stray",
EntityLegacyIds::WITCH => "minecraft:witch",
EntityLegacyIds::ZOMBIE_VILLAGER => "minecraft:zombie_villager",
EntityLegacyIds::BLAZE => "minecraft:blaze",
EntityLegacyIds::MAGMA_CUBE => "minecraft:magma_cube",
EntityLegacyIds::GHAST => "minecraft:ghast",
EntityLegacyIds::CAVE_SPIDER => "minecraft:cave_spider",
EntityLegacyIds::SILVERFISH => "minecraft:silverfish",
EntityLegacyIds::ENDERMAN => "minecraft:enderman",
EntityLegacyIds::SLIME => "minecraft:slime",
EntityLegacyIds::ZOMBIE_PIGMAN => "minecraft:zombie_pigman",
EntityLegacyIds::SPIDER => "minecraft:spider",
EntityLegacyIds::SKELETON => "minecraft:skeleton",
EntityLegacyIds::CREEPER => "minecraft:creeper",
EntityLegacyIds::ZOMBIE => "minecraft:zombie",
EntityLegacyIds::SKELETON_HORSE => "minecraft:skeleton_horse",
EntityLegacyIds::MULE => "minecraft:mule",
EntityLegacyIds::DONKEY => "minecraft:donkey",
EntityLegacyIds::DOLPHIN => "minecraft:dolphin",
EntityLegacyIds::TROPICALFISH => "minecraft:tropicalfish",
EntityLegacyIds::WOLF => "minecraft:wolf",
EntityLegacyIds::SQUID => "minecraft:squid",
EntityLegacyIds::DROWNED => "minecraft:drowned",
EntityLegacyIds::SHEEP => "minecraft:sheep",
EntityLegacyIds::MOOSHROOM => "minecraft:mooshroom",
EntityLegacyIds::PANDA => "minecraft:panda",
EntityLegacyIds::SALMON => "minecraft:salmon",
EntityLegacyIds::PIG => "minecraft:pig",
EntityLegacyIds::VILLAGER => "minecraft:villager",
EntityLegacyIds::COD => "minecraft:cod",
EntityLegacyIds::PUFFERFISH => "minecraft:pufferfish",
EntityLegacyIds::COW => "minecraft:cow",
EntityLegacyIds::CHICKEN => "minecraft:chicken",
EntityLegacyIds::BALLOON => "minecraft:balloon",
EntityLegacyIds::LLAMA => "minecraft:llama",
EntityLegacyIds::IRON_GOLEM => "minecraft:iron_golem",
EntityLegacyIds::RABBIT => "minecraft:rabbit",
EntityLegacyIds::SNOW_GOLEM => "minecraft:snow_golem",
EntityLegacyIds::BAT => "minecraft:bat",
EntityLegacyIds::OCELOT => "minecraft:ocelot",
EntityLegacyIds::HORSE => "minecraft:horse",
EntityLegacyIds::CAT => "minecraft:cat",
EntityLegacyIds::POLAR_BEAR => "minecraft:polar_bear",
EntityLegacyIds::ZOMBIE_HORSE => "minecraft:zombie_horse",
EntityLegacyIds::TURTLE => "minecraft:turtle",
EntityLegacyIds::PARROT => "minecraft:parrot",
EntityLegacyIds::GUARDIAN => "minecraft:guardian",
EntityLegacyIds::ELDER_GUARDIAN => "minecraft:elder_guardian",
EntityLegacyIds::VINDICATOR => "minecraft:vindicator",
EntityLegacyIds::WITHER => "minecraft:wither",
EntityLegacyIds::ENDER_DRAGON => "minecraft:ender_dragon",
EntityLegacyIds::SHULKER => "minecraft:shulker",
EntityLegacyIds::ENDERMITE => "minecraft:endermite",
EntityLegacyIds::MINECART => "minecraft:minecart",
EntityLegacyIds::HOPPER_MINECART => "minecraft:hopper_minecart",
EntityLegacyIds::TNT_MINECART => "minecraft:tnt_minecart",
EntityLegacyIds::CHEST_MINECART => "minecraft:chest_minecart",
EntityLegacyIds::COMMAND_BLOCK_MINECART => "minecraft:command_block_minecart",
EntityLegacyIds::ARMOR_STAND => "minecraft:armor_stand",
EntityLegacyIds::ITEM => "minecraft:item",
EntityLegacyIds::TNT => "minecraft:tnt",
EntityLegacyIds::FALLING_BLOCK => "minecraft:falling_block",
EntityLegacyIds::XP_BOTTLE => "minecraft:xp_bottle",
EntityLegacyIds::XP_ORB => "minecraft:xp_orb",
EntityLegacyIds::EYE_OF_ENDER_SIGNAL => "minecraft:eye_of_ender_signal",
EntityLegacyIds::ENDER_CRYSTAL => "minecraft:ender_crystal",
EntityLegacyIds::SHULKER_BULLET => "minecraft:shulker_bullet",
EntityLegacyIds::FISHING_HOOK => "minecraft:fishing_hook",
EntityLegacyIds::DRAGON_FIREBALL => "minecraft:dragon_fireball",
EntityLegacyIds::ARROW => "minecraft:arrow",
EntityLegacyIds::SNOWBALL => "minecraft:snowball",
EntityLegacyIds::EGG => "minecraft:egg",
EntityLegacyIds::PAINTING => "minecraft:painting",
EntityLegacyIds::THROWN_TRIDENT => "minecraft:thrown_trident",
EntityLegacyIds::FIREBALL => "minecraft:fireball",
EntityLegacyIds::SPLASH_POTION => "minecraft:splash_potion",
EntityLegacyIds::ENDER_PEARL => "minecraft:ender_pearl",
EntityLegacyIds::LEASH_KNOT => "minecraft:leash_knot",
EntityLegacyIds::WITHER_SKULL => "minecraft:wither_skull",
EntityLegacyIds::WITHER_SKULL_DANGEROUS => "minecraft:wither_skull_dangerous",
EntityLegacyIds::BOAT => "minecraft:boat",
EntityLegacyIds::LIGHTNING_BOLT => "minecraft:lightning_bolt",
EntityLegacyIds::SMALL_FIREBALL => "minecraft:small_fireball",
EntityLegacyIds::LLAMA_SPIT => "minecraft:llama_spit",
EntityLegacyIds::AREA_EFFECT_CLOUD => "minecraft:area_effect_cloud",
EntityLegacyIds::LINGERING_POTION => "minecraft:lingering_potion",
EntityLegacyIds::FIREWORKS_ROCKET => "minecraft:fireworks_rocket",
EntityLegacyIds::EVOCATION_FANG => "minecraft:evocation_fang",
EntityLegacyIds::EVOCATION_ILLAGER => "minecraft:evocation_illager",
EntityLegacyIds::VEX => "minecraft:vex",
EntityLegacyIds::AGENT => "minecraft:agent",
EntityLegacyIds::ICE_BOMB => "minecraft:ice_bomb",
EntityLegacyIds::PHANTOM => "minecraft:phantom",
EntityLegacyIds::TRIPOD_CAMERA => "minecraft:tripod_camera"
];
/** @var int|null */

View File

@ -21,9 +21,10 @@
declare(strict_types=1);
namespace pocketmine\entity;
namespace pocketmine\network\mcpe\protocol\types;
interface EntityIds{
final class EntityLegacyIds{
public const CHICKEN = 10;
public const COW = 11;
@ -127,4 +128,8 @@ interface EntityIds{
public const TROPICALFISH = 111, TROPICAL_FISH = 111;
public const COD = 112, FISH = 112;
public const PANDA = 113;
private function __construct(){
//NOOP
}
}