diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index fb2ca7285..346e4cf03 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -395,16 +395,6 @@ class BlockAPI{ } } break; - case 54: - case 61: - $faces = array( - 0 => 4, - 1 => 2, - 2 => 5, - 3 => 3, - ); - $data["meta"] = $faces[$direction]; - break; case 26: //bed $face = array( 0 => 3, diff --git a/src/classes/material/block/solid/Ladder.php b/src/classes/material/block/attachable/Ladder.php similarity index 59% rename from src/classes/material/block/solid/Ladder.php rename to src/classes/material/block/attachable/Ladder.php index 5f8ef84bb..a89ce2f88 100644 --- a/src/classes/material/block/solid/Ladder.php +++ b/src/classes/material/block/attachable/Ladder.php @@ -29,5 +29,24 @@ class LadderBlock extends TransparentBlock{ public function __construct($meta = 0){ parent::__construct(LADDER, $meta, "Ladder"); } - + public function place(BlockAPI $level, Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ + if($block->inWorld === true){ + if($block->isTransparent === false){ + $faces = array( + 2 => 2, + 3 => 3, + 4 => 4, + 5 => 5, + ); + $level->setBlock($block, $this->id, $faces[$face]); + return true; + } + } + return false; + } + public function getDrops(Item $item, Player $player){ + return array( + array($this->id, 0, 1), + ); + } } \ No newline at end of file