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\FloatTag;
use pocketmine\nbt\tag\ListTag; use pocketmine\nbt\tag\ListTag;
use pocketmine\nbt\tag\StringTag; 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\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\DataPropertyManager;
use pocketmine\network\mcpe\protocol\types\EntityMetadataFlags; use pocketmine\network\mcpe\protocol\types\EntityMetadataFlags;
use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties; use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties;
use pocketmine\network\mcpe\protocol\types\EntityMetadataTypes; use pocketmine\network\mcpe\protocol\types\EntityMetadataTypes;
use pocketmine\player\Player; 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\Server;
use pocketmine\timings\Timings; use pocketmine\timings\Timings;
use pocketmine\timings\TimingsHandler; use pocketmine\timings\TimingsHandler;
@ -78,7 +78,7 @@ use function sin;
use function spl_object_id; use function spl_object_id;
use const M_PI_2; use const M_PI_2;
abstract class Entity extends Location implements EntityIds{ abstract class Entity extends Location{
public const MOTION_THRESHOLD = 0.00001; 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\IntTag;
use pocketmine\nbt\tag\ListTag; use pocketmine\nbt\tag\ListTag;
use pocketmine\nbt\tag\StringTag; use pocketmine\nbt\tag\StringTag;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\utils\Utils; use pocketmine\utils\Utils;
use pocketmine\world\World; use pocketmine\world\World;
use function array_keys; 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 //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 //TODO: index them by version to allow proper multi-save compatibility
self::register(Arrow::class, ['Arrow', 'minecraft:arrow'], EntityIds::ARROW); self::register(Arrow::class, ['Arrow', 'minecraft:arrow'], EntityLegacyIds::ARROW);
self::register(Egg::class, ['Egg', 'minecraft:egg'], EntityIds::EGG); self::register(Egg::class, ['Egg', 'minecraft:egg'], EntityLegacyIds::EGG);
self::register(EnderPearl::class, ['ThrownEnderpearl', 'minecraft:ender_pearl'], EntityIds::ENDER_PEARL); self::register(EnderPearl::class, ['ThrownEnderpearl', 'minecraft:ender_pearl'], EntityLegacyIds::ENDER_PEARL);
self::register(ExperienceBottle::class, ['ThrownExpBottle', 'minecraft:xp_bottle'], EntityIds::XP_BOTTLE); self::register(ExperienceBottle::class, ['ThrownExpBottle', 'minecraft:xp_bottle'], EntityLegacyIds::XP_BOTTLE);
self::register(ExperienceOrb::class, ['XPOrb', 'minecraft:xp_orb'], EntityIds::XP_ORB); self::register(ExperienceOrb::class, ['XPOrb', 'minecraft:xp_orb'], EntityLegacyIds::XP_ORB);
self::register(FallingBlock::class, ['FallingSand', 'minecraft:falling_block'], EntityIds::FALLING_BLOCK); self::register(FallingBlock::class, ['FallingSand', 'minecraft:falling_block'], EntityLegacyIds::FALLING_BLOCK);
self::register(ItemEntity::class, ['Item', 'minecraft:item'], EntityIds::ITEM); self::register(ItemEntity::class, ['Item', 'minecraft:item'], EntityLegacyIds::ITEM);
self::register(Painting::class, ['Painting', 'minecraft:painting'], EntityIds::PAINTING); self::register(Painting::class, ['Painting', 'minecraft:painting'], EntityLegacyIds::PAINTING);
self::register(PrimedTNT::class, ['PrimedTnt', 'PrimedTNT', 'minecraft:tnt'], EntityIds::TNT); self::register(PrimedTNT::class, ['PrimedTnt', 'PrimedTNT', 'minecraft:tnt'], EntityLegacyIds::TNT);
self::register(Snowball::class, ['Snowball', 'minecraft:snowball'], EntityIds::SNOWBALL); self::register(Snowball::class, ['Snowball', 'minecraft:snowball'], EntityLegacyIds::SNOWBALL);
self::register(SplashPotion::class, ['ThrownPotion', 'minecraft:potion', 'thrownpotion'], EntityIds::SPLASH_POTION); self::register(SplashPotion::class, ['ThrownPotion', 'minecraft:potion', 'thrownpotion'], EntityLegacyIds::SPLASH_POTION);
self::register(Squid::class, ['Squid', 'minecraft:squid'], EntityIds::SQUID); self::register(Squid::class, ['Squid', 'minecraft:squid'], EntityLegacyIds::SQUID);
self::register(Villager::class, ['Villager', 'minecraft:villager'], EntityIds::VILLAGER); self::register(Villager::class, ['Villager', 'minecraft:villager'], EntityLegacyIds::VILLAGER);
self::register(Zombie::class, ['Zombie', 'minecraft:zombie'], EntityIds::ZOMBIE); self::register(Zombie::class, ['Zombie', 'minecraft:zombie'], EntityLegacyIds::ZOMBIE);
self::register(Human::class, ['Human']); self::register(Human::class, ['Human']);

View File

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

View File

@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\entity; namespace pocketmine\entity;
use pocketmine\nbt\tag\CompoundTag; 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\EntityMetadataFlags;
use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties; 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_BLACKSMITH = 3;
public const PROFESSION_BUTCHER = 4; public const PROFESSION_BUTCHER = 4;
public const NETWORK_ID = self::VILLAGER; public const NETWORK_ID = EntityLegacyIds::VILLAGER;
public $width = 0.6; public $width = 0.6;
public $height = 1.8; public $height = 1.8;

View File

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

View File

@ -28,12 +28,13 @@ use pocketmine\entity\Human;
use pocketmine\nbt\tag\CompoundTag; use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\IntTag; use pocketmine\nbt\tag\IntTag;
use pocketmine\nbt\tag\ShortTag; use pocketmine\nbt\tag\ShortTag;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties; use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties;
use pocketmine\player\Player; use pocketmine\player\Player;
use function sqrt; use function sqrt;
class ExperienceOrb extends Entity{ 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_PC = "Value"; //short
public const TAG_VALUE_PE = "experience value"; //int (WTF?) 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\ByteTag;
use pocketmine\nbt\tag\CompoundTag; use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\IntTag; use pocketmine\nbt\tag\IntTag;
use pocketmine\network\mcpe\protocol\types\EntityLegacyIds;
use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties; use pocketmine\network\mcpe\protocol\types\EntityMetadataProperties;
use function get_class; use function get_class;
class FallingBlock extends Entity{ class FallingBlock extends Entity{
public const NETWORK_ID = self::FALLING_BLOCK; public const NETWORK_ID = EntityLegacyIds::FALLING_BLOCK;
public $width = 0.98; public $width = 0.98;
public $height = 0.98; public $height = 0.98;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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