mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
Added Torches placement
This commit is contained in:
parent
3ecbe7dbf7
commit
399050fc4e
6 changed files with 163 additions and 129 deletions
|
|
@ -30,4 +30,26 @@ class TorchBlock extends FlowableBlock{
|
|||
parent::__construct(TORCH, $meta, "Torch");
|
||||
}
|
||||
|
||||
public function place(BlockAPI $level, Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
if($block->inWorld === true){
|
||||
$down = $level->getBlockFace($block, 0);
|
||||
if($down->isTransparent === false and $face !== 0){
|
||||
$faces = array(
|
||||
1 => 5,
|
||||
2 => 4,
|
||||
3 => 3,
|
||||
4 => 2,
|
||||
5 => 1,
|
||||
);
|
||||
$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…
Add table
Add a link
Reference in a new issue