From e061028b696c972e66df3537c9694c94fa1c8972 Mon Sep 17 00:00:00 2001 From: Govdim <50422762+Govdim@users.noreply.github.com> Date: Tue, 9 Feb 2021 19:04:05 +0300 Subject: [PATCH] Added Hopper::setFacing() and Hopper::getFacing() (#4030) --- src/block/Hopper.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/block/Hopper.php b/src/block/Hopper.php index e07f800dd..f05d82a17 100644 --- a/src/block/Hopper.php +++ b/src/block/Hopper.php @@ -57,6 +57,17 @@ class Hopper extends Transparent{ return 0b1111; } + public function getFacing() : int{ return $this->facing; } + + /** @return $this */ + public function setFacing(int $facing) : self{ + if($facing === Facing::UP){ + throw new \InvalidArgumentException("Hopper may not face upward"); + } + $this->facing = $facing; + return $this; + } + protected function recalculateCollisionBoxes() : array{ $result = [ AxisAlignedBB::one()->trim(Facing::UP, 6 / 16) //the empty area around the bottom is currently considered solid