mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
decreased block updates per chunk from 80 to 20, PMFLevel block methods should be a bit faster now, grass spread rework, leaf decay fix
This commit is contained in:
parent
3dd9e38a37
commit
4544b7bb63
9 changed files with 73 additions and 60 deletions
|
|
@ -49,6 +49,18 @@ class GrassBlock extends SolidBlock{
|
|||
public static function onRandomTick(Level $level, $x, $y, $z){
|
||||
if(!$level->getBlockWithoutVector($x, $y + 1, $z, false)->isTransparent && mt_rand(0, 2) == 1){
|
||||
$level->fastSetBlockUpdate($x, $y, $z, DIRT, 0);
|
||||
}else{
|
||||
for($cnt = 0; $cnt < 4; ++$cnt){
|
||||
$x = $x + mt_rand(0, 2) - 1;
|
||||
$y = $y + mt_rand(0, 4) - 3;
|
||||
$z = $z + mt_rand(0, 2) - 1;
|
||||
|
||||
$blockUp = $level->getBlockWithoutVector($x, $y + 1, $z, false);
|
||||
if($blockUp->isTransparent && !$blockUp->isLiquid && !($blockUp->getID() === 60) && $level->level->getBlockID($x, $y, $z) === DIRT){
|
||||
$level->fastSetBlockUpdate($x, $y, $z, GRASS, 0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue