mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-14 22:01:59 +00:00
Lava: implement basalt generators
This commit is contained in:
parent
a005cd6e33
commit
e5b038ebcd
@ -54,31 +54,43 @@ class Lava extends Liquid{
|
|||||||
return 2; //TODO: this is 1 in the nether
|
return 2; //TODO: this is 1 in the nether
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function checkForHarden() : bool{
|
/**
|
||||||
if($this->falling){
|
* @phpstan-return \Generator<int, Block, void, void>
|
||||||
return false;
|
*/
|
||||||
}
|
private function getAdjacentBlocksExceptDown() : \Generator{
|
||||||
$colliding = null;
|
|
||||||
foreach(Facing::ALL as $side){
|
foreach(Facing::ALL as $side){
|
||||||
if($side === Facing::DOWN){
|
if($side === Facing::DOWN){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$blockSide = $this->getSide($side);
|
yield $this->getSide($side);
|
||||||
if($blockSide instanceof Water){
|
}
|
||||||
$colliding = $blockSide;
|
}
|
||||||
break;
|
|
||||||
|
protected function checkForHarden() : bool{
|
||||||
|
if($this->falling){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
foreach($this->getAdjacentBlocksExceptDown() as $colliding){
|
||||||
|
if($colliding instanceof Water){
|
||||||
|
if($this->decay === 0){
|
||||||
|
$this->liquidCollide($colliding, VanillaBlocks::OBSIDIAN());
|
||||||
|
return true;
|
||||||
|
}elseif($this->decay <= 4){
|
||||||
|
$this->liquidCollide($colliding, VanillaBlocks::COBBLESTONE());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($colliding !== null){
|
if($this->getSide(Facing::DOWN)->getTypeId() === BlockTypeIds::SOUL_SOIL){
|
||||||
if($this->decay === 0){
|
foreach($this->getAdjacentBlocksExceptDown() as $colliding){
|
||||||
$this->liquidCollide($colliding, VanillaBlocks::OBSIDIAN());
|
if($colliding->getTypeId() === BlockTypeIds::BLUE_ICE){
|
||||||
return true;
|
$this->liquidCollide($colliding, VanillaBlocks::BASALT());
|
||||||
}elseif($this->decay <= 4){
|
return true;
|
||||||
$this->liquidCollide($colliding, VanillaBlocks::COBBLESTONE());
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user