Vine: don't break when a supported vine is above, closes #2452

This commit is contained in:
Dylan K. Taylor 2018-10-12 18:38:52 +01:00
parent c96203b528
commit d151a89037

View File

@ -163,8 +163,13 @@ class Vine extends Flowable{
public function onNearbyBlockChange() : void{
$changed = false;
$up = $this->getSide(Facing::UP);
//check which faces have corresponding vines in the block above
$supportedFaces = $up instanceof Vine ? array_intersect_key($this->faces, $up->faces) : [];
foreach($this->faces as $face => $bool){
if(!$this->getSide($face)->isSolid()){
if(!isset($supportedFaces[$face]) and !$this->getSide($face)->isSolid()){
unset($this->faces[$face]);
$changed = true;
}