mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Entity: make networkProperties private
this reduces the temptation to use it in high-level code, as well as making syncNetworkData() more useful (now it can export to many data collections, which means we can start to think about having a property cache per network session, which is more flexible)
This commit is contained in:
@ -29,6 +29,7 @@ use pocketmine\event\entity\EntityDamageEvent;
|
||||
use pocketmine\event\entity\ExplosionPrimeEvent;
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityLegacyIds;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataFlags;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties;
|
||||
use pocketmine\world\Explosion;
|
||||
@ -108,10 +109,10 @@ class PrimedTNT extends Entity implements Explosive{
|
||||
}
|
||||
}
|
||||
|
||||
protected function syncNetworkData() : void{
|
||||
parent::syncNetworkData();
|
||||
protected function syncNetworkData(EntityMetadataCollection $properties) : void{
|
||||
parent::syncNetworkData($properties);
|
||||
|
||||
$this->networkProperties->setGenericFlag(EntityMetadataFlags::IGNITED, true);
|
||||
$this->networkProperties->setInt(EntityMetadataProperties::FUSE_LENGTH, $this->fuse);
|
||||
$properties->setGenericFlag(EntityMetadataFlags::IGNITED, true);
|
||||
$properties->setInt(EntityMetadataProperties::FUSE_LENGTH, $this->fuse);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user