Nether Reactor block is back

This should never have been removed, it exists as an unobtainable block in vanilla which drops iron and diamond.
This commit is contained in:
Dylan K. Taylor 2017-08-16 14:17:14 +01:00
parent 7b142d4742
commit 8510be062c
2 changed files with 65 additions and 1 deletions

View File

@ -316,7 +316,7 @@ class Block extends Position implements BlockIds, Metadatable{
self::registerBlock(new Beetroot());
self::registerBlock(new Stonecutter());
self::registerBlock(new GlowingObsidian());
//TODO: NETHERREACTOR
self::registerBlock(new NetherReactor());
//TODO: INFO_UPDATE
//TODO: INFO_UPDATE2
//TODO: MOVINGBLOCK

View File

@ -0,0 +1,64 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\item\Tool;
class NetherReactor extends Solid{
protected $id = Block::NETHER_REACTOR;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getName(){
static $prefixes = [
"",
"Active ",
"Used "
];
return ($prefixes[$this->meta] ?? "") . "Nether Reactor Core";
}
public function getToolType(){
return Tool::TYPE_PICKAXE;
}
public function getHardness(){
return 3;
}
public function getDrops(Item $item){
if($item->isPickaxe() >= Tool::TIER_WOODEN){
return [
[Item::IRON_INGOT, 0, 6],
[Item::DIAMOND, 0, 3]
];
}
return [];
}
}