Liquid: add getMinAdjacentSourcesToFormSource(), remove circular dependency between Liquid and Water

this unpleasantly-named method allows controlling the source-forming behaviour of liquids by changing the required number of adjacent sources that must be present in order for a new source to form. This allows stuff like non-infinite water.
This commit is contained in:
Dylan K. Taylor
2021-09-19 15:59:16 +01:00
parent 971cbe3929
commit 1ce388ca0b
2 changed files with 15 additions and 2 deletions

View File

@ -46,6 +46,10 @@ class Water extends Liquid{
return 5;
}
public function getMinAdjacentSourcesToFormSource() : ?int{
return 2;
}
public function onEntityInside(Entity $entity) : bool{
$entity->resetFallDistance();
if($entity->isOnFire()){