From 7d200247f88a849d471138cb339955d196beb36e Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 13 Oct 2023 12:45:11 +0100 Subject: [PATCH] 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. --- src/block/Cactus.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/block/Cactus.php b/src/block/Cactus.php index 0176d17bd..bb8a7cd40 100644 --- a/src/block/Cactus.php +++ b/src/block/Cactus.php @@ -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); } } }