mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 04:17:48 +00:00
Furnace Simplification
This commit is contained in:
parent
55cb79fdf6
commit
f4ce715efc
@ -25,32 +25,16 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class BurningFurnaceBlock extends SolidBlock{
|
/***REM_START***/
|
||||||
|
require_once("Furnace.php");
|
||||||
|
/***REM_END***/
|
||||||
|
|
||||||
|
class BurningFurnaceBlock extends FurnaceBlock{
|
||||||
public function __construct($meta = 0){
|
public function __construct($meta = 0){
|
||||||
parent::__construct(BURNING_FURNACE, $meta, "Burning Furnace");
|
parent::__construct($meta);
|
||||||
|
$this->id = BURNING_FURNACE;
|
||||||
|
$this->name = "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){
|
|
||||||
if($item->isPickaxe() >= 1){
|
|
||||||
return array(
|
|
||||||
array(FURNACE, 0, 1),
|
|
||||||
);
|
|
||||||
}else{
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -25,11 +25,13 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class FurnaceBlock extends SolidBlock{
|
class FurnaceBlock extends SolidBlock{
|
||||||
public function __construct($meta = 0){
|
public function __construct($meta = 0){
|
||||||
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){
|
public function place(BlockAPI $level, Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||||
if($block->inWorld === true){
|
if($block->inWorld === true){
|
||||||
$faces = array(
|
$faces = array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user