mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
Cactus: do not update if only age changed
I'd prefer a smarter solution for this that automatically disables updates depending on which type of property was changed, but for now, this will significantly improve the performance of cactus farms. The newly placed cactus block at the top cannot have updates disabled, though, since it needs to check its surroundings in case it grew into a space with a solid block next to it. Thanks @KingOfTurkey38 for bringing this to light.
This commit is contained in:
parent
2d697c5f04
commit
7d200247f8
@ -117,10 +117,10 @@ class Cactus extends Transparent{
|
||||
}
|
||||
}
|
||||
$this->age = 0;
|
||||
$world->setBlock($this->position, $this);
|
||||
$world->setBlock($this->position, $this, update: false);
|
||||
}else{
|
||||
++$this->age;
|
||||
$world->setBlock($this->position, $this);
|
||||
$world->setBlock($this->position, $this, update: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user