From 54342ab0ce0b5cd9c72a521cdb6c031b4d7a39c8 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 12 Sep 2018 19:56:17 +0100 Subject: [PATCH] Remove ridiculous code in Ladder --- src/pocketmine/block/Ladder.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/pocketmine/block/Ladder.php b/src/pocketmine/block/Ladder.php index 49729cac2..f1b73cf80 100644 --- a/src/pocketmine/block/Ladder.php +++ b/src/pocketmine/block/Ladder.php @@ -26,6 +26,7 @@ namespace pocketmine\block; use pocketmine\entity\Entity; use pocketmine\item\Item; use pocketmine\math\AxisAlignedBB; +use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\Player; @@ -90,19 +91,11 @@ class Ladder extends Transparent{ public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ - if(!$blockClicked->isTransparent()){ - $faces = [ - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5 - ]; - if(isset($faces[$face])){ - $this->meta = $faces[$face]; - $this->getLevel()->setBlock($blockReplace, $this, true, true); + if(!$blockClicked->isTransparent() and Facing::axis($face) !== Facing::AXIS_Y){ + $this->meta = $face; + $this->getLevel()->setBlock($blockReplace, $this, true, true); - return true; - } + return true; } return false;