Ladder placement

This commit is contained in:
Shoghi Cervantes Pueyo 2013-02-03 22:53:22 +01:00
parent afe33202dc
commit 3578b90a39
2 changed files with 20 additions and 11 deletions

View File

@ -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,

View File

@ -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),
);
}
}