mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Implemented modifiers for crop growth speed
closes #6070 there are some unresolved questions about the growth speed of beetroots, pitcher plants and torchflower crops, but that's a topic for another commit. this change also doesn't account for the light levels.
This commit is contained in:
@ -25,6 +25,7 @@ namespace pocketmine\block;
|
||||
|
||||
use pocketmine\block\utils\AgeableTrait;
|
||||
use pocketmine\block\utils\BlockEventHelper;
|
||||
use pocketmine\block\utils\CropGrowthHelper;
|
||||
use pocketmine\block\utils\StaticSupportTrait;
|
||||
use pocketmine\item\Fertilizer;
|
||||
use pocketmine\item\Item;
|
||||
@ -66,7 +67,7 @@ abstract class Crops extends Flowable{
|
||||
}
|
||||
|
||||
public function onRandomTick() : void{
|
||||
if($this->age < self::MAX_AGE && mt_rand(0, 2) === 1){
|
||||
if($this->age < self::MAX_AGE && CropGrowthHelper::canGrow($this)){
|
||||
$block = clone $this;
|
||||
++$block->age;
|
||||
BlockEventHelper::grow($this, $block, null);
|
||||
|
Reference in New Issue
Block a user