mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
more stuff uses StaticBlock class now
This commit is contained in:
parent
9cb7fbafaa
commit
e70c501df8
12 changed files with 49 additions and 86 deletions
|
|
@ -18,17 +18,17 @@ class FarmlandBlock extends TransparentBlock{
|
|||
|
||||
public static function onRandomTick(Level $level, $x, $y, $z){
|
||||
$meta = $level->level->getBlockDamage($x, $y, $z);
|
||||
$b = $level->getBlockWithoutVector($x, $y + 1, $z, $level, false);
|
||||
$b = $level->level->getBlockID($x, $y + 1, $z);
|
||||
if($meta === 0 && mt_rand(0, 5) === 0){
|
||||
$water = self::checkWaterStatic($level, $x, $y, $z);
|
||||
if($water){
|
||||
$level->setBlock(new Position($x, $y, $z, $level), BlockAPI::get(FARMLAND, 1), true, false, true);
|
||||
}elseif(!(($b instanceof Block) && $b->isTransparent && $b->id != 0)){
|
||||
}elseif($b != 0 && StaticBlock::getIsTransparent($b)){
|
||||
$level->setBlock(new Position($x, $y, $z, $level), BlockAPI::get(DIRT, 0), true, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
if($b instanceof Block && !$b->isFlowable){
|
||||
if(!StaticBlock::getIsFlowable($b)){
|
||||
$level->setBlock(new Position($x, $y, $z, $level), BlockAPI::get(DIRT, 0), true, false, true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue