mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
Mixable Lava & Water
I Wanna Make Cobblestone Generator!
This commit is contained in:
parent
b822b314cb
commit
db289f9871
@ -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…
x
Reference in New Issue
Block a user