From e30586fff255f82402e77c619fd55b43e8a992d6 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Sat, 27 Apr 2024 00:06:11 +0300 Subject: [PATCH] fixed cactuses not getting dropped when the grow --- src/material/Block.php | 2 +- src/material/block/plant/CactusBlock.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/material/Block.php b/src/material/Block.php index 345d624b..32b32b8a 100755 --- a/src/material/Block.php +++ b/src/material/Block.php @@ -217,7 +217,7 @@ abstract class Block extends Position{ public static function onRandomTick(Level $level, $x, $y, $z){} public static function fallOn(Level $level, $x, $y, $z, Entity $entity, $fallDistance){} public static function getCollisionBoundingBoxes(Level $level, $x, $y, $z, Entity $entity){ - return [new AxisAlignedBB($x, $y, $z, $x, $y, $z)]; + return [static::getAABB($level, $x, $y, $z)]; } public static function onEntityCollidedWithBlock(Level $level, $x, $y, $z, Entity $entity){} diff --git a/src/material/block/plant/CactusBlock.php b/src/material/block/plant/CactusBlock.php index e2aa9a80..1249f288 100644 --- a/src/material/block/plant/CactusBlock.php +++ b/src/material/block/plant/CactusBlock.php @@ -22,7 +22,8 @@ class CactusBlock extends TransparentBlock{ for($yy = 1; $yy < 3; ++$yy){ $bID = $level->level->getBlockID($x, $y + $yy, $z); if($bID === AIR){ - $level->setBlock(new Position($x, $y + $yy, $z, $level), new CactusBlock(), true, false, true); + $level->fastSetBlockUpdate($x, $y + $yy, $z, CACTUS, 0); + $level->getBlockWithoutVector($x, $y + $yy, $z)->onUpdate(BLOCK_UPDATE_NORMAL); //TODO rewrite ticking break; } }