Wall: use facing as value as well as key in connections

This commit is contained in:
Dylan K. Taylor 2020-09-26 17:41:00 +01:00
parent 9e3ff21aea
commit 12087c9850

View File

@ -29,7 +29,7 @@ use pocketmine\math\Facing;
class Wall extends Transparent{
/** @var bool[] facing => dummy */
/** @var int[] facing => facing */
protected $connections = [];
/** @var bool */
protected $up = false;
@ -44,7 +44,7 @@ class Wall extends Transparent{
foreach(Facing::HORIZONTAL as $facing){
$block = $this->getSide($facing);
if($block instanceof static or $block instanceof FenceGate or ($block->isSolid() and !$block->isTransparent())){
$this->connections[$facing] = true;
$this->connections[$facing] = $facing;
}else{
unset($this->connections[$facing]);
}