mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Mixable Lava & Water
I Wanna Make Cobblestone Generator!
This commit is contained in:
parent
b822b314cb
commit
db289f9871
2 changed files with 47 additions and 0 deletions
|
|
@ -49,6 +49,26 @@ class LavaBlock extends LiquidBlock{
|
|||
return $count;
|
||||
}
|
||||
|
||||
public function checkWater()
|
||||
{
|
||||
for($side = 1; $side <= 5; ++$side)
|
||||
{
|
||||
$b = $this->getSide($side);
|
||||
if($b instanceof WaterBlock)
|
||||
{
|
||||
$level = $this->meta & 0x07;
|
||||
if($level == 0x00)
|
||||
{
|
||||
$this->level->setBlock($this, new ObsidianBlock(), false, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->level->setBlock($this, new CobblestoneBlock(), false, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getFrom()
|
||||
{
|
||||
for($side = 0; $side <= 5; ++$side)
|
||||
|
|
@ -75,6 +95,8 @@ class LavaBlock extends LiquidBlock{
|
|||
return false;
|
||||
}
|
||||
|
||||
if( $this->checkWater() ) { return; }
|
||||
|
||||
$falling = $this->meta >> 3;
|
||||
$down = $this->getSide(0);
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,29 @@ class WaterBlock extends LiquidBlock{
|
|||
return $count;
|
||||
}
|
||||
|
||||
public function checkLava()
|
||||
{
|
||||
for($side = 0; $side <= 5; ++$side)
|
||||
{
|
||||
if($side == 1) { continue; }
|
||||
$b = $this->getSide($side);
|
||||
if($b instanceof LavaBlock)
|
||||
{
|
||||
$level = $b->meta & 0x07;
|
||||
if($level == 0x00)
|
||||
{
|
||||
$this->level->setBlock($b, new ObsidianBlock(), false, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->level->setBlock($b, new CobblestoneBlock(), false, false, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getFrom()
|
||||
{
|
||||
for($side = 0; $side <= 5; ++$side)
|
||||
|
|
@ -75,6 +98,8 @@ class WaterBlock extends LiquidBlock{
|
|||
return false;
|
||||
}
|
||||
|
||||
$this->checkLava();
|
||||
|
||||
$falling = $this->meta >> 3;
|
||||
$down = $this->getSide(0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue