From fd413b512e3572edfd83805e78f42cf747ac6874 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 12 May 2019 18:42:49 +0100 Subject: [PATCH] Remove useless Dandelion class this class is line-for-line identical to the Flower class. --- src/pocketmine/block/BlockFactory.php | 2 +- src/pocketmine/block/Dandelion.php | 59 --------------------------- src/pocketmine/block/FlowerPot.php | 1 - 3 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 src/pocketmine/block/Dandelion.php diff --git a/src/pocketmine/block/BlockFactory.php b/src/pocketmine/block/BlockFactory.php index 8f922b553..0fb38adfc 100644 --- a/src/pocketmine/block/BlockFactory.php +++ b/src/pocketmine/block/BlockFactory.php @@ -95,7 +95,6 @@ class BlockFactory{ self::register(new Cobweb(new BID(BlockLegacyIds::COBWEB), "Cobweb")); self::register(new CocoaBlock(new BID(BlockLegacyIds::COCOA), "Cocoa Block")); self::register(new CraftingTable(new BID(BlockLegacyIds::CRAFTING_TABLE), "Crafting Table")); - self::register(new Dandelion(new BID(BlockLegacyIds::DANDELION), "Dandelion")); self::register(new DaylightSensor(new BlockIdentifierFlattened(BlockLegacyIds::DAYLIGHT_DETECTOR, BlockLegacyIds::DAYLIGHT_DETECTOR_INVERTED), "Daylight Sensor")); self::register(new DeadBush(new BID(BlockLegacyIds::DEADBUSH), "Dead Bush")); self::register(new DetectorRail(new BID(BlockLegacyIds::DETECTOR_RAIL), "Detector Rail")); @@ -119,6 +118,7 @@ class BlockFactory{ self::register(new EnderChest(new BID(BlockLegacyIds::ENDER_CHEST, 0, null, \pocketmine\tile\EnderChest::class), "Ender Chest")); self::register(new Farmland(new BID(BlockLegacyIds::FARMLAND), "Farmland")); self::register(new Fire(new BID(BlockLegacyIds::FIRE), "Fire Block")); + self::register(new Flower(new BID(BlockLegacyIds::DANDELION), "Dandelion")); self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_ALLIUM), "Allium")); self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_AZURE_BLUET), "Azure Bluet")); self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_BLUE_ORCHID), "Blue Orchid")); diff --git a/src/pocketmine/block/Dandelion.php b/src/pocketmine/block/Dandelion.php deleted file mode 100644 index d562afbd8..000000000 --- a/src/pocketmine/block/Dandelion.php +++ /dev/null @@ -1,59 +0,0 @@ -getSide(Facing::DOWN); - if($down->getId() === BlockLegacyIds::GRASS or $down->getId() === BlockLegacyIds::DIRT or $down->getId() === BlockLegacyIds::FARMLAND){ - return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player); - } - - return false; - } - - public function onNearbyBlockChange() : void{ - if($this->getSide(Facing::DOWN)->isTransparent()){ - $this->getWorld()->useBreakOn($this); - } - } - - public function getFlameEncouragement() : int{ - return 60; - } - - public function getFlammability() : int{ - return 100; - } -} diff --git a/src/pocketmine/block/FlowerPot.php b/src/pocketmine/block/FlowerPot.php index 2cd993830..50b44214a 100644 --- a/src/pocketmine/block/FlowerPot.php +++ b/src/pocketmine/block/FlowerPot.php @@ -102,7 +102,6 @@ class FlowerPot extends Flowable{ return $block instanceof Cactus or - $block instanceof Dandelion or $block instanceof DeadBush or $block instanceof Flower or $block instanceof RedMushroom or