mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-27 05:13:46 +00:00
Added Hopper::setFacing() and Hopper::getFacing() (#4030)
This commit is contained in:
parent
e80c1a0ce9
commit
e061028b69
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user