mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
Properly switch to string entity IDs
This commit is contained in:
@ -32,7 +32,7 @@ use pocketmine\event\inventory\InventoryPickupArrowEvent;
|
||||
use pocketmine\item\VanillaItems;
|
||||
use pocketmine\math\RayTraceResult;
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityLegacyIds;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityIds;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataFlags;
|
||||
use pocketmine\player\Player;
|
||||
@ -42,7 +42,7 @@ use function sqrt;
|
||||
|
||||
class Arrow extends Projectile{
|
||||
|
||||
public static function getNetworkTypeId() : int{ return EntityLegacyIds::ARROW; }
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::ARROW; }
|
||||
|
||||
public const PICKUP_NONE = 0;
|
||||
public const PICKUP_ANY = 1;
|
||||
|
@ -25,11 +25,11 @@ namespace pocketmine\entity\projectile;
|
||||
|
||||
use pocketmine\event\entity\ProjectileHitEvent;
|
||||
use pocketmine\item\VanillaItems;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityLegacyIds;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityIds;
|
||||
use pocketmine\world\particle\ItemBreakParticle;
|
||||
|
||||
class Egg extends Throwable{
|
||||
public static function getNetworkTypeId() : int{ return EntityLegacyIds::EGG; }
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::EGG; }
|
||||
|
||||
//TODO: spawn chickens on collision
|
||||
|
||||
|
@ -25,12 +25,12 @@ namespace pocketmine\entity\projectile;
|
||||
|
||||
use pocketmine\event\entity\EntityDamageEvent;
|
||||
use pocketmine\event\entity\ProjectileHitEvent;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityLegacyIds;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityIds;
|
||||
use pocketmine\world\particle\EndermanTeleportParticle;
|
||||
use pocketmine\world\sound\EndermanTeleportSound;
|
||||
|
||||
class EnderPearl extends Throwable{
|
||||
public static function getNetworkTypeId() : int{ return EntityLegacyIds::ENDER_PEARL; }
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::ENDER_PEARL; }
|
||||
|
||||
protected function onHit(ProjectileHitEvent $event) : void{
|
||||
$owner = $this->getOwningEntity();
|
||||
|
@ -24,13 +24,13 @@ declare(strict_types=1);
|
||||
namespace pocketmine\entity\projectile;
|
||||
|
||||
use pocketmine\event\entity\ProjectileHitEvent;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityLegacyIds;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityIds;
|
||||
use pocketmine\world\particle\PotionSplashParticle;
|
||||
use pocketmine\world\sound\PotionSplashSound;
|
||||
use function mt_rand;
|
||||
|
||||
class ExperienceBottle extends Throwable{
|
||||
public static function getNetworkTypeId() : int{ return EntityLegacyIds::XP_BOTTLE; }
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::XP_BOTTLE; }
|
||||
|
||||
protected $gravity = 0.07;
|
||||
|
||||
|
@ -24,11 +24,11 @@ declare(strict_types=1);
|
||||
namespace pocketmine\entity\projectile;
|
||||
|
||||
use pocketmine\event\entity\ProjectileHitEvent;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityLegacyIds;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityIds;
|
||||
use pocketmine\world\particle\SnowballPoofParticle;
|
||||
|
||||
class Snowball extends Throwable{
|
||||
public static function getNetworkTypeId() : int{ return EntityLegacyIds::SNOWBALL; }
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::SNOWBALL; }
|
||||
|
||||
protected function onHit(ProjectileHitEvent $event) : void{
|
||||
for($i = 0; $i < 6; ++$i){
|
||||
|
@ -34,7 +34,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\entity\EntityLegacyIds;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityIds;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataFlags;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties;
|
||||
@ -46,7 +46,7 @@ use function sqrt;
|
||||
|
||||
class SplashPotion extends Throwable{
|
||||
|
||||
public static function getNetworkTypeId() : int{ return EntityLegacyIds::SPLASH_POTION; }
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::SPLASH_POTION; }
|
||||
|
||||
protected $gravity = 0.05;
|
||||
protected $drag = 0.01;
|
||||
|
Reference in New Issue
Block a user