mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
NetworkSession: do not mark shared attributes as synchronized, they don't necessarily belong to us
if we decided to start sending entity attribute changes to viewers too, this would have caused some unexpected behaviour.
This commit is contained in:
parent
f35b7bf80b
commit
f6f714c158
@ -686,9 +686,6 @@ class NetworkSession{
|
||||
$this->sendDataPacket(UpdateAttributesPacket::create($entity->getId(), array_map(function(Attribute $attr) : NetworkAttribute{
|
||||
return new NetworkAttribute($attr->getId(), $attr->getMinValue(), $attr->getMaxValue(), $attr->getValue(), $attr->getDefaultValue());
|
||||
}, $entries)));
|
||||
foreach($entries as $entry){
|
||||
$entry->markSynchronized();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1292,6 +1292,9 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
||||
|
||||
//TODO: move this to network session ticking (this is specifically related to net sync)
|
||||
$this->networkSession->syncAttributes($this);
|
||||
foreach($this->attributeMap->getAll() as $attribute){
|
||||
$attribute->markSynchronized();
|
||||
}
|
||||
|
||||
if(!$this->isAlive() and $this->spawned){
|
||||
$this->onDeathUpdate($tickDiff);
|
||||
|
Loading…
x
Reference in New Issue
Block a user