mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +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:
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\entity;
|
||||
|
||||
use pocketmine\event\entity\EntityDamageEvent;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataFlags;
|
||||
|
||||
abstract class WaterAnimal extends Living implements Ageable{
|
||||
@@ -43,8 +44,8 @@ abstract class WaterAnimal extends Living implements Ageable{
|
||||
$this->attack($ev);
|
||||
}
|
||||
|
||||
protected function syncNetworkData() : void{
|
||||
parent::syncNetworkData();
|
||||
$this->networkProperties->setGenericFlag(EntityMetadataFlags::BABY, $this->baby);
|
||||
protected function syncNetworkData(EntityMetadataCollection $properties) : void{
|
||||
parent::syncNetworkData($properties);
|
||||
$properties->setGenericFlag(EntityMetadataFlags::BABY, $this->baby);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user