mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-13 21:35:21 +00:00
Added Chest & Furnace placement
This commit is contained in:
parent
a5651c0f43
commit
afe33202dc
@ -30,7 +30,19 @@ class BurningFurnaceBlock extends SolidBlock{
|
|||||||
parent::__construct(BURNING_FURNACE, $meta, "Burning Furnace");
|
parent::__construct(BURNING_FURNACE, $meta, "Burning Furnace");
|
||||||
$this->isActivable = true;
|
$this->isActivable = true;
|
||||||
}
|
}
|
||||||
|
public function place(BlockAPI $level, Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||||
|
if($block->inWorld === true){
|
||||||
|
$faces = array(
|
||||||
|
0 => 4,
|
||||||
|
1 => 2,
|
||||||
|
2 => 5,
|
||||||
|
3 => 3,
|
||||||
|
);
|
||||||
|
$level->setBlock($block, $this->id, $faces[$player->entity->getDirection()]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
if($item->isPickaxe() >= 1){
|
if($item->isPickaxe() >= 1){
|
||||||
return array(
|
return array(
|
||||||
|
@ -30,5 +30,22 @@ class ChestBlock extends SolidBlock{
|
|||||||
parent::__construct(CHEST, $meta, "Chest");
|
parent::__construct(CHEST, $meta, "Chest");
|
||||||
$this->isActivable = true;
|
$this->isActivable = true;
|
||||||
}
|
}
|
||||||
|
public function place(BlockAPI $level, Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||||
|
if($block->inWorld === true){
|
||||||
|
$faces = array(
|
||||||
|
0 => 4,
|
||||||
|
1 => 2,
|
||||||
|
2 => 5,
|
||||||
|
3 => 3,
|
||||||
|
);
|
||||||
|
$level->setBlock($block, $this->id, $faces[$player->entity->getDirection()]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public function getDrops(Item $item, Player $player){
|
||||||
|
return array(
|
||||||
|
array($this->id, 0, 1),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
@ -30,7 +30,19 @@ class FurnaceBlock extends SolidBlock{
|
|||||||
parent::__construct(FURNACE, $meta, "Furnace");
|
parent::__construct(FURNACE, $meta, "Furnace");
|
||||||
$this->isActivable = true;
|
$this->isActivable = true;
|
||||||
}
|
}
|
||||||
|
public function place(BlockAPI $level, Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||||
|
if($block->inWorld === true){
|
||||||
|
$faces = array(
|
||||||
|
0 => 4,
|
||||||
|
1 => 2,
|
||||||
|
2 => 5,
|
||||||
|
3 => 3,
|
||||||
|
);
|
||||||
|
$level->setBlock($block, $this->id, $faces[$player->entity->getDirection()]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
if($item->isPickaxe() >= 1){
|
if($item->isPickaxe() >= 1){
|
||||||
return array(
|
return array(
|
||||||
|
@ -30,5 +30,10 @@ class StonecutterBlock extends SolidBlock{
|
|||||||
parent::__construct(STONECUTTER, $meta, "Stonecutter");
|
parent::__construct(STONECUTTER, $meta, "Stonecutter");
|
||||||
$this->isActivable = true;
|
$this->isActivable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDrops(Item $item, Player $player){
|
||||||
|
return array(
|
||||||
|
array($this->id, 0, 1),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
@ -30,5 +30,10 @@ class WorkbenchBlock extends SolidBlock{
|
|||||||
parent::__construct(WORKBENCH, $meta, "Crafting Table");
|
parent::__construct(WORKBENCH, $meta, "Crafting Table");
|
||||||
$this->isActivable = true;
|
$this->isActivable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDrops(Item $item, Player $player){
|
||||||
|
return array(
|
||||||
|
array($this->id, 0, 1),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user