Remove useless Dandelion class

this class is line-for-line identical to the Flower class.
This commit is contained in:
Dylan K. Taylor 2019-05-12 18:42:49 +01:00
parent 10831821be
commit fd413b512e
3 changed files with 1 additions and 61 deletions

View File

@ -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"));

View File

@ -1,59 +0,0 @@
<?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\math\Facing;
use pocketmine\math\Vector3;
use pocketmine\Player;
class Dandelion extends Flowable{
public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){
parent::__construct($idInfo, $name, $breakInfo ?? BlockBreakInfo::instant());
}
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->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;
}
}

View File

@ -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