GroundCover: don't replace liquid with can-be-flowed-into blocks

fixes snow layers generating underwater
This commit is contained in:
Dylan K. Taylor 2018-06-08 11:15:19 +01:00
parent 78ec3937bf
commit 8cd311bcb4

View File

@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\level\generator\populator; namespace pocketmine\level\generator\populator;
use pocketmine\block\BlockFactory; use pocketmine\block\BlockFactory;
use pocketmine\block\Liquid;
use pocketmine\level\biome\Biome; use pocketmine\level\biome\Biome;
use pocketmine\level\ChunkManager; use pocketmine\level\ChunkManager;
use pocketmine\utils\Random; use pocketmine\utils\Random;
@ -55,6 +56,9 @@ class GroundCover extends Populator{
if($column{$y} === "\x00" and $b->isSolid()){ if($column{$y} === "\x00" and $b->isSolid()){
break; break;
} }
if($b->canBeFlowedInto() and BlockFactory::get(ord($column{$y})) instanceof Liquid){
continue;
}
if($b->getDamage() === 0){ if($b->getDamage() === 0){
$chunk->setBlockId($x, $y, $z, $b->getId()); $chunk->setBlockId($x, $y, $z, $b->getId());
}else{ }else{