Wipe internal block AABB cache only for specific blocks that need it

the vast majority of blocks don't need this cache erasing, so it's costing performance for no good reason.
This commit is contained in:
Dylan K. Taylor
2023-10-23 17:38:04 +01:00
parent f655eda3b3
commit d637370b83
5 changed files with 11 additions and 6 deletions

View File

@ -51,6 +51,8 @@ class Door extends Transparent{
public function readStateFromWorld() : Block{
parent::readStateFromWorld();
$this->collisionBoxes = null;
//copy door properties from other half
$other = $this->getSide($this->top ? Facing::DOWN : Facing::UP);
if($other instanceof Door && $other->hasSameTypeId($this)){