mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +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;
|
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()
|
public function getFrom()
|
||||||
{
|
{
|
||||||
for($side = 0; $side <= 5; ++$side)
|
for($side = 0; $side <= 5; ++$side)
|
||||||
|
|
@ -75,6 +95,8 @@ class LavaBlock extends LiquidBlock{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( $this->checkWater() ) { return; }
|
||||||
|
|
||||||
$falling = $this->meta >> 3;
|
$falling = $this->meta >> 3;
|
||||||
$down = $this->getSide(0);
|
$down = $this->getSide(0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,29 @@ class WaterBlock extends LiquidBlock{
|
||||||
return $count;
|
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()
|
public function getFrom()
|
||||||
{
|
{
|
||||||
for($side = 0; $side <= 5; ++$side)
|
for($side = 0; $side <= 5; ++$side)
|
||||||
|
|
@ -75,6 +98,8 @@ class WaterBlock extends LiquidBlock{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->checkLava();
|
||||||
|
|
||||||
$falling = $this->meta >> 3;
|
$falling = $this->meta >> 3;
|
||||||
$down = $this->getSide(0);
|
$down = $this->getSide(0);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue