Added flowers compatible with MCPE 0.11.

Signed-off-by: Michael Yoo <michael@yoo.id.au>
This commit is contained in:
matcracker
2015-04-18 15:21:25 +02:00
committed by Michael Yoo
parent f64caf6c96
commit 388f5c2c91
3 changed files with 37 additions and 18 deletions

View File

@ -84,8 +84,7 @@ class Block extends Position implements Metadatable{
const DEAD_BUSH = 32;
const WOOL = 35;
const DANDELION = 37;
const ROSE = 38;
const POPPY = 38;
const RED_FLOWER = 38;
const BROWN_MUSHROOM = 39;
const RED_MUSHROOM = 40;
const GOLD_BLOCK = 41;
@ -334,7 +333,7 @@ class Block extends Position implements Metadatable{
self::$list[self::DEAD_BUSH] = DeadBush::class;
self::$list[self::WOOL] = Wool::class;
self::$list[self::DANDELION] = Dandelion::class;
self::$list[self::POPPY] = Poppy::class;
self::$list[self::RED_FLOWER] = Flower::class;
self::$list[self::BROWN_MUSHROOM] = BrownMushroom::class;
self::$list[self::RED_MUSHROOM] = RedMushroom::class;
self::$list[self::GOLD_BLOCK] = Gold::class;

View File

@ -25,16 +25,38 @@ use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class Poppy extends Flowable{
class Flower extends Flowable{
const POPPY = 0;
const BLUE_ORCHID = 1;
const ALLIUM = 2;
const AZURE_BLUET = 3;
const RED_TULIP = 4;
const ORANGE_TULIP = 5;
const WHITE_TULIP = 6;
const PINK_TULIP = 7;
const OXEYE_DAISY = 8;
protected $id = self::POPPY;
protected $id = self::RED_FLOWER;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getName(){
return "Poppy";
static $names = [
self::POPPY => "Poppy",
self::BLUE_ORCHID => "Blue Orchid",
self::ALLIUM => "Allium",
self::AZURE_BLUET => "Azure Bluet",
self::RED_TULIP => "Red Tulip",
self::ORANGE_TULIP => "Orange Tulip",
self::WHITE_TULIP => "White Tulip",
self::PINK_TULIP => "Pink Tulip",
self::OXEYE_DAISY => "Oxeye Daisy",
9 => "Unknown Flower",
];
return $names[$this->meta & 0x09];
}