diff --git a/src/pocketmine/entity/Animal.php b/src/pocketmine/entity/Animal.php index 09fd1c685..b3116653f 100644 --- a/src/pocketmine/entity/Animal.php +++ b/src/pocketmine/entity/Animal.php @@ -36,6 +36,6 @@ abstract class Animal extends Living implements Ageable{ protected function syncNetworkData() : void{ parent::syncNetworkData(); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::BABY, $this->baby); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::BABY, $this->baby); } } diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index c52f1cb59..77886ef45 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -93,7 +93,7 @@ abstract class Entity extends Location{ protected $id; /** @var EntityMetadataCollection */ - protected $propertyManager; + protected $networkProperties; /** @var Chunk|null */ public $chunk; @@ -261,7 +261,7 @@ abstract class Entity extends Location{ $this->resetLastMovements(); - $this->propertyManager = new EntityMetadataCollection(); + $this->networkProperties = new EntityMetadataCollection(); $this->attributeMap = new AttributeMap(); $this->addAttributes(); @@ -709,8 +709,8 @@ abstract class Entity extends Location{ return $this->attributeMap; } - public function getDataPropertyManager() : EntityMetadataCollection{ - return $this->propertyManager; + public function getNetworkProperties() : EntityMetadataCollection{ + return $this->networkProperties; } protected function entityBaseTick(int $tickDiff = 1) : bool{ @@ -721,7 +721,7 @@ abstract class Entity extends Location{ $changedProperties = $this->getSyncedNetworkData(true); if(!empty($changedProperties)){ $this->sendData($this->hasSpawned, $changedProperties); - $this->propertyManager->clearDirtyProperties(); + $this->networkProperties->clearDirtyProperties(); } $hasUpdate = false; @@ -1755,29 +1755,29 @@ abstract class Entity extends Location{ final protected function getSyncedNetworkData(bool $dirtyOnly) : array{ $this->syncNetworkData(); - return $dirtyOnly ? $this->propertyManager->getDirty() : $this->propertyManager->getAll(); + return $dirtyOnly ? $this->networkProperties->getDirty() : $this->networkProperties->getAll(); } protected function syncNetworkData() : void{ - $this->propertyManager->setByte(EntityMetadataProperties::ALWAYS_SHOW_NAMETAG, $this->alwaysShowNameTag ? 1 : 0); - $this->propertyManager->setFloat(EntityMetadataProperties::BOUNDING_BOX_HEIGHT, $this->height); - $this->propertyManager->setFloat(EntityMetadataProperties::BOUNDING_BOX_WIDTH, $this->width); - $this->propertyManager->setFloat(EntityMetadataProperties::SCALE, $this->scale); - $this->propertyManager->setLong(EntityMetadataProperties::LEAD_HOLDER_EID, -1); - $this->propertyManager->setLong(EntityMetadataProperties::OWNER_EID, $this->ownerId ?? -1); - $this->propertyManager->setLong(EntityMetadataProperties::TARGET_EID, $this->targetId ?? -1); - $this->propertyManager->setString(EntityMetadataProperties::NAMETAG, $this->nameTag); - $this->propertyManager->setString(EntityMetadataProperties::SCORE_TAG, $this->scoreTag); + $this->networkProperties->setByte(EntityMetadataProperties::ALWAYS_SHOW_NAMETAG, $this->alwaysShowNameTag ? 1 : 0); + $this->networkProperties->setFloat(EntityMetadataProperties::BOUNDING_BOX_HEIGHT, $this->height); + $this->networkProperties->setFloat(EntityMetadataProperties::BOUNDING_BOX_WIDTH, $this->width); + $this->networkProperties->setFloat(EntityMetadataProperties::SCALE, $this->scale); + $this->networkProperties->setLong(EntityMetadataProperties::LEAD_HOLDER_EID, -1); + $this->networkProperties->setLong(EntityMetadataProperties::OWNER_EID, $this->ownerId ?? -1); + $this->networkProperties->setLong(EntityMetadataProperties::TARGET_EID, $this->targetId ?? -1); + $this->networkProperties->setString(EntityMetadataProperties::NAMETAG, $this->nameTag); + $this->networkProperties->setString(EntityMetadataProperties::SCORE_TAG, $this->scoreTag); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::AFFECTED_BY_GRAVITY, true); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::CAN_CLIMB, $this->canClimb); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::CAN_SHOW_NAMETAG, $this->nameTagVisible); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::HAS_COLLISION, true); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::IMMOBILE, $this->immobile); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::INVISIBLE, $this->invisible); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::ONFIRE, $this->isOnFire()); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::SNEAKING, $this->sneaking); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::WALLCLIMBING, $this->canClimbWalls); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::AFFECTED_BY_GRAVITY, true); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::CAN_CLIMB, $this->canClimb); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::CAN_SHOW_NAMETAG, $this->nameTagVisible); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::HAS_COLLISION, true); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::IMMOBILE, $this->immobile); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::INVISIBLE, $this->invisible); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::ONFIRE, $this->isOnFire()); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::SNEAKING, $this->sneaking); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::WALLCLIMBING, $this->canClimbWalls); } public function broadcastEntityEvent(int $eventId, ?int $eventData = null, ?array $players = null) : void{ diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index 7a922b515..d7be4444e 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -770,12 +770,12 @@ abstract class Living extends Entity{ protected function syncNetworkData() : void{ parent::syncNetworkData(); - $this->propertyManager->setByte(EntityMetadataProperties::POTION_AMBIENT, $this->effectManager->hasOnlyAmbientEffects() ? 1 : 0); - $this->propertyManager->setInt(EntityMetadataProperties::POTION_COLOR, Binary::signInt($this->effectManager->getBubbleColor()->toARGB())); - $this->propertyManager->setShort(EntityMetadataProperties::AIR, $this->breathTicks); - $this->propertyManager->setShort(EntityMetadataProperties::MAX_AIR, $this->maxBreathTicks); + $this->networkProperties->setByte(EntityMetadataProperties::POTION_AMBIENT, $this->effectManager->hasOnlyAmbientEffects() ? 1 : 0); + $this->networkProperties->setInt(EntityMetadataProperties::POTION_COLOR, Binary::signInt($this->effectManager->getBubbleColor()->toARGB())); + $this->networkProperties->setShort(EntityMetadataProperties::AIR, $this->breathTicks); + $this->networkProperties->setShort(EntityMetadataProperties::MAX_AIR, $this->maxBreathTicks); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::BREATHING, $this->breathing); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::BREATHING, $this->breathing); } protected function onDispose() : void{ diff --git a/src/pocketmine/entity/Villager.php b/src/pocketmine/entity/Villager.php index 9172a9477..cfe07247d 100644 --- a/src/pocketmine/entity/Villager.php +++ b/src/pocketmine/entity/Villager.php @@ -88,8 +88,8 @@ class Villager extends Living implements Ageable{ protected function syncNetworkData() : void{ parent::syncNetworkData(); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::BABY, $this->baby); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::BABY, $this->baby); - $this->propertyManager->setInt(EntityMetadataProperties::VARIANT, $this->profession); + $this->networkProperties->setInt(EntityMetadataProperties::VARIANT, $this->profession); } } diff --git a/src/pocketmine/entity/WaterAnimal.php b/src/pocketmine/entity/WaterAnimal.php index a6aeb6a8f..921766711 100644 --- a/src/pocketmine/entity/WaterAnimal.php +++ b/src/pocketmine/entity/WaterAnimal.php @@ -45,6 +45,6 @@ abstract class WaterAnimal extends Living implements Ageable{ protected function syncNetworkData() : void{ parent::syncNetworkData(); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::BABY, $this->baby); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::BABY, $this->baby); } } diff --git a/src/pocketmine/entity/object/ExperienceOrb.php b/src/pocketmine/entity/object/ExperienceOrb.php index ce4baaded..391a3351f 100644 --- a/src/pocketmine/entity/object/ExperienceOrb.php +++ b/src/pocketmine/entity/object/ExperienceOrb.php @@ -232,6 +232,6 @@ class ExperienceOrb extends Entity{ protected function syncNetworkData() : void{ parent::syncNetworkData(); - $this->propertyManager->setInt(EntityMetadataProperties::EXPERIENCE_VALUE, $this->xpValue); + $this->networkProperties->setInt(EntityMetadataProperties::EXPERIENCE_VALUE, $this->xpValue); } } diff --git a/src/pocketmine/entity/object/FallingBlock.php b/src/pocketmine/entity/object/FallingBlock.php index 99e2b8ea8..1cc077030 100644 --- a/src/pocketmine/entity/object/FallingBlock.php +++ b/src/pocketmine/entity/object/FallingBlock.php @@ -140,6 +140,6 @@ class FallingBlock extends Entity{ protected function syncNetworkData() : void{ parent::syncNetworkData(); - $this->propertyManager->setInt(EntityMetadataProperties::VARIANT, $this->block->getRuntimeId()); + $this->networkProperties->setInt(EntityMetadataProperties::VARIANT, $this->block->getRuntimeId()); } } diff --git a/src/pocketmine/entity/object/PrimedTNT.php b/src/pocketmine/entity/object/PrimedTNT.php index 23f6deaea..6375dd3ba 100644 --- a/src/pocketmine/entity/object/PrimedTNT.php +++ b/src/pocketmine/entity/object/PrimedTNT.php @@ -111,7 +111,7 @@ class PrimedTNT extends Entity implements Explosive{ protected function syncNetworkData() : void{ parent::syncNetworkData(); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::IGNITED, true); - $this->propertyManager->setInt(EntityMetadataProperties::FUSE_LENGTH, $this->fuse); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::IGNITED, true); + $this->networkProperties->setInt(EntityMetadataProperties::FUSE_LENGTH, $this->fuse); } } diff --git a/src/pocketmine/entity/projectile/Arrow.php b/src/pocketmine/entity/projectile/Arrow.php index 91f4de3d1..496670382 100644 --- a/src/pocketmine/entity/projectile/Arrow.php +++ b/src/pocketmine/entity/projectile/Arrow.php @@ -206,6 +206,6 @@ class Arrow extends Projectile{ protected function syncNetworkData() : void{ parent::syncNetworkData(); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::CRITICAL, $this->critical); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::CRITICAL, $this->critical); } } diff --git a/src/pocketmine/entity/projectile/SplashPotion.php b/src/pocketmine/entity/projectile/SplashPotion.php index bed33146a..5c4aff1fd 100644 --- a/src/pocketmine/entity/projectile/SplashPotion.php +++ b/src/pocketmine/entity/projectile/SplashPotion.php @@ -181,7 +181,7 @@ class SplashPotion extends Throwable{ protected function syncNetworkData() : void{ parent::syncNetworkData(); - $this->propertyManager->setShort(EntityMetadataProperties::POTION_AUX_VALUE, $this->potionId); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::LINGER, $this->linger); + $this->networkProperties->setShort(EntityMetadataProperties::POTION_AUX_VALUE, $this->potionId); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::LINGER, $this->linger); } } diff --git a/src/pocketmine/player/Player.php b/src/pocketmine/player/Player.php index 8d231406c..61167c4c7 100644 --- a/src/pocketmine/player/Player.php +++ b/src/pocketmine/player/Player.php @@ -2364,10 +2364,10 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, protected function syncNetworkData() : void{ parent::syncNetworkData(); - $this->propertyManager->setGenericFlag(EntityMetadataFlags::ACTION, $this->startAction > -1); + $this->networkProperties->setGenericFlag(EntityMetadataFlags::ACTION, $this->startAction > -1); - $this->propertyManager->setPlayerFlag(PlayerMetadataFlags::SLEEP, $this->sleeping !== null); - $this->propertyManager->setBlockPos(EntityMetadataProperties::PLAYER_BED_POSITION, $this->sleeping ?? new Vector3(0, 0, 0)); + $this->networkProperties->setPlayerFlag(PlayerMetadataFlags::SLEEP, $this->sleeping !== null); + $this->networkProperties->setBlockPos(EntityMetadataProperties::PLAYER_BED_POSITION, $this->sleeping ?? new Vector3(0, 0, 0)); } public function broadcastEntityEvent(int $eventId, ?int $eventData = null, ?array $players = null) : void{