fixed sapling growth & sugarcane

This commit is contained in:
GameHerobrine 2023-06-28 22:43:34 +03:00
parent 6d1d7cb8a5
commit 83dad024b1
4 changed files with 16 additions and 17 deletions

View file

@ -64,11 +64,12 @@ class SugarcaneBlock extends FlowableBlock{
$id = $b[0];
$meta = $b[1];
if($underID !== SUGARCANE_BLOCK){
if($meta == 0x0F){
if($meta === 0x0F){
for($yy = 1; $yy < 3; ++$yy){
$bID = $level->level->getBlockID($x, $y + $yy, $z);
if($bID === AIR){
$level->setBlock(new Position($x, $y, $z, $level), new SugarcaneBlock(), true, false, true);
//$level->setBlock(new Position($x, $y, $z, $level), new SugarcaneBlock(), true, false, true);
$level->fastSetBlockUpdate($x, $y + $yy, $z, SUGARCANE_BLOCK, 0);
}
}
$meta = 0;
@ -76,7 +77,6 @@ class SugarcaneBlock extends FlowableBlock{
}else{
$level->fastSetBlockUpdate($x, $y, $z, $id, $meta + 1);
}
return BLOCK_UPDATE_RANDOM;
}
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){