mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
lava flow fixed
This commit is contained in:
parent
094c420a26
commit
b52e050f8c
4 changed files with 5 additions and 11 deletions
|
|
@ -10,7 +10,6 @@ class LavaBlock extends LiquidBlockDynamic implements LightingBlock{
|
|||
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
$ret = $this->level->setBlock($this, $this, true, false, true);
|
||||
//TODO place ServerAPI::request()->api->block->scheduleBlockUpdate(clone $this, 40, BLOCK_UPDATE_NORMAL);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -177,10 +177,10 @@ class LiquidBlockDynamic extends LiquidBlock{
|
|||
}
|
||||
}
|
||||
|
||||
if(static::$blockID == LAVA && $depth < 8 && $j1 < 8 && $j1 > $depth && mt_rand(0, 4) != 0){
|
||||
$j1 = $depth;
|
||||
$flag = false;
|
||||
}
|
||||
//if(static::$blockID == LAVA && $depth < 8 && $j1 < 8 && $j1 > $depth && mt_rand(0, 4) != 0){ TODO fix later
|
||||
// $j1 = $depth;
|
||||
// $flag = false;
|
||||
//}
|
||||
|
||||
if($j1 != $depth){
|
||||
$depth = $j1;
|
||||
|
|
|
|||
|
|
@ -8,13 +8,9 @@ class LiquidBlockStatic extends LiquidBlock{
|
|||
//TODO: tick: try spread fire if lava
|
||||
|
||||
public static function setDynamic(Level $level, $x, $y, $z){
|
||||
//TODO set dynamic
|
||||
[$id, $meta] = $level->level->getBlock($x, $y, $z);
|
||||
$dynamicID = $id - 1; //very unsafe
|
||||
$level->fastSetBlockUpdate($x, $y, $z, $dynamicID, $meta);
|
||||
$delay = static::getTickDelay();
|
||||
ServerAPI::request()->api->block->scheduleBlockUpdateXYZ($level, $x, $y, $z, BLOCK_UPDATE_SCHEDULED, $delay);
|
||||
|
||||
$level->fastSetBlockUpdate($x, $y, $z, $dynamicID, $meta);
|
||||
}
|
||||
|
||||
public static function neighborChanged(Level $level, $x, $y, $z, $nX, $nY, $nZ, $oldID){
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ class WaterBlock extends LiquidBlockDynamic{
|
|||
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
$ret = $this->level->setBlock($this, $this, true, false, true);
|
||||
//TODO place ServerAPI::request()->api->block->scheduleBlockUpdate(clone $this, 5, BLOCK_UPDATE_NORMAL);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue