mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 23:59:53 +00:00
Ladder placement
This commit is contained in:
parent
afe33202dc
commit
3578b90a39
@ -395,16 +395,6 @@ class BlockAPI{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 54:
|
|
||||||
case 61:
|
|
||||||
$faces = array(
|
|
||||||
0 => 4,
|
|
||||||
1 => 2,
|
|
||||||
2 => 5,
|
|
||||||
3 => 3,
|
|
||||||
);
|
|
||||||
$data["meta"] = $faces[$direction];
|
|
||||||
break;
|
|
||||||
case 26: //bed
|
case 26: //bed
|
||||||
$face = array(
|
$face = array(
|
||||||
0 => 3,
|
0 => 3,
|
||||||
|
@ -29,5 +29,24 @@ class LadderBlock extends TransparentBlock{
|
|||||||
public function __construct($meta = 0){
|
public function __construct($meta = 0){
|
||||||
parent::__construct(LADDER, $meta, "Ladder");
|
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),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user