From 8510be062c65a8d4ff002c45370298e251b2bf85 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 16 Aug 2017 14:17:14 +0100 Subject: [PATCH] Nether Reactor block is back This should never have been removed, it exists as an unobtainable block in vanilla which drops iron and diamond. --- src/pocketmine/block/Block.php | 2 +- src/pocketmine/block/NetherReactor.php | 64 ++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 src/pocketmine/block/NetherReactor.php diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index 561fbf837..20cadfd75 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -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 diff --git a/src/pocketmine/block/NetherReactor.php b/src/pocketmine/block/NetherReactor.php new file mode 100644 index 000000000..1303a856d --- /dev/null +++ b/src/pocketmine/block/NetherReactor.php @@ -0,0 +1,64 @@ +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 []; + } + +} \ No newline at end of file