Remove ridiculous code in Ladder

This commit is contained in:
Dylan K. Taylor 2018-09-12 19:56:17 +01:00
parent 778eb5fb33
commit 54342ab0ce

View File

@ -26,6 +26,7 @@ namespace pocketmine\block;
use pocketmine\entity\Entity; use pocketmine\entity\Entity;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\math\AxisAlignedBB; use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;
use pocketmine\math\Vector3; use pocketmine\math\Vector3;
use pocketmine\Player; 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{ public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
if(!$blockClicked->isTransparent()){ if(!$blockClicked->isTransparent() and Facing::axis($face) !== Facing::AXIS_Y){
$faces = [ $this->meta = $face;
2 => 2, $this->getLevel()->setBlock($blockReplace, $this, true, true);
3 => 3,
4 => 4,
5 => 5
];
if(isset($faces[$face])){
$this->meta = $faces[$face];
$this->getLevel()->setBlock($blockReplace, $this, true, true);
return true; return true;
}
} }
return false; return false;