mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 13:09:44 +00:00
grass will try spreading only once per tick
This commit is contained in:
parent
659aea440d
commit
992b6143cd
1 changed files with 10 additions and 10 deletions
|
|
@ -47,17 +47,17 @@ class GrassBlock extends SolidBlock{
|
||||||
if(!StaticBlock::getIsTransparent($level->level->getBlockID($x, $y + 1, $z)) && mt_rand(0, 2) == 1){
|
if(!StaticBlock::getIsTransparent($level->level->getBlockID($x, $y + 1, $z)) && mt_rand(0, 2) == 1){
|
||||||
$level->fastSetBlockUpdate($x, $y, $z, DIRT, 0);
|
$level->fastSetBlockUpdate($x, $y, $z, DIRT, 0);
|
||||||
}else{
|
}else{
|
||||||
for($cnt = 0; $cnt < 4; ++$cnt){
|
//for($cnt = 0; $cnt < 4; ++$cnt){
|
||||||
$x = $x + mt_rand(0, 2) - 1;
|
$x = $x + mt_rand(0, 2) - 1;
|
||||||
$y = $y + mt_rand(0, 4) - 3;
|
$y = $y + mt_rand(0, 4) - 3;
|
||||||
$z = $z + mt_rand(0, 2) - 1;
|
$z = $z + mt_rand(0, 2) - 1;
|
||||||
|
|
||||||
$blockUp = $level->level->getBlockID($x, $y + 1, $z);
|
$blockUp = $level->level->getBlockID($x, $y + 1, $z);
|
||||||
if(StaticBlock::getIsTransparent($blockUp) && !StaticBlock::getIsLiquid($blockUp) && !($blockUp === 60) && $level->level->getBlockID($x, $y, $z) === DIRT){
|
if(StaticBlock::getIsTransparent($blockUp) && !StaticBlock::getIsLiquid($blockUp) && !($blockUp == FARMLAND) && $level->level->getBlockID($x, $y, $z) === DIRT){
|
||||||
$level->fastSetBlockUpdate($x, $y, $z, GRASS, 0);
|
$level->fastSetBlockUpdate($x, $y, $z, GRASS, 0);
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue