add some blocks introduced in 1.9

This commit is contained in:
Dylan K. Taylor 2019-02-18 20:01:50 +00:00
parent a95ecb3ff9
commit 6f4cec6465
4 changed files with 9 additions and 1 deletions

View File

@ -142,6 +142,8 @@ class BlockFactory{
self::registerBlock(new Flower(Block::RED_FLOWER, Flower::TYPE_POPPY, "Poppy")); self::registerBlock(new Flower(Block::RED_FLOWER, Flower::TYPE_POPPY, "Poppy"));
self::registerBlock(new Flower(Block::RED_FLOWER, Flower::TYPE_RED_TULIP, "Red Tulip")); self::registerBlock(new Flower(Block::RED_FLOWER, Flower::TYPE_RED_TULIP, "Red Tulip"));
self::registerBlock(new Flower(Block::RED_FLOWER, Flower::TYPE_WHITE_TULIP, "White Tulip")); self::registerBlock(new Flower(Block::RED_FLOWER, Flower::TYPE_WHITE_TULIP, "White Tulip"));
self::registerBlock(new Flower(Block::RED_FLOWER, Flower::TYPE_CORNFLOWER, "Cornflower"));
self::registerBlock(new Flower(Block::RED_FLOWER, Flower::TYPE_LILY_OF_THE_VALLEY, "Lily of the Valley"));
self::registerBlock(new FlowerPot()); self::registerBlock(new FlowerPot());
self::registerBlock(new Furnace()); self::registerBlock(new Furnace());
self::registerBlock((new Furnace())->setLit()); //flattening hack self::registerBlock((new Furnace())->setLit()); //flattening hack
@ -229,6 +231,7 @@ class BlockFactory{
self::registerBlock(new class(Block::QUARTZ_BLOCK, Quartz::PILLAR, "Quartz Pillar") extends Quartz{ self::registerBlock(new class(Block::QUARTZ_BLOCK, Quartz::PILLAR, "Quartz Pillar") extends Quartz{
use PillarRotationTrait; use PillarRotationTrait;
}); });
self::registerBlock(new Quartz(Block::QUARTZ_BLOCK, Quartz::SMOOTH, "Smooth Quartz Block")); //TODO: this has axis rotation in 1.9, unsure if a bug (https://bugs.mojang.com/browse/MCPE-39074)
self::registerBlock(new QuartzStairs()); self::registerBlock(new QuartzStairs());
self::registerBlock(new Rail()); self::registerBlock(new Rail());
self::registerBlock(new RedMushroom()); self::registerBlock(new RedMushroom());
@ -327,6 +330,7 @@ class BlockFactory{
static $sandstoneTypes = [ static $sandstoneTypes = [
Sandstone::NORMAL => "", Sandstone::NORMAL => "",
Sandstone::CHISELED => "Chiseled ", Sandstone::CHISELED => "Chiseled ",
Sandstone::CUT => "Cut ",
Sandstone::SMOOTH => "Smooth " Sandstone::SMOOTH => "Smooth "
]; ];
foreach($sandstoneTypes as $variant => $prefix){ foreach($sandstoneTypes as $variant => $prefix){

View File

@ -38,6 +38,8 @@ class Flower extends Flowable{
public const TYPE_WHITE_TULIP = 6; public const TYPE_WHITE_TULIP = 6;
public const TYPE_PINK_TULIP = 7; public const TYPE_PINK_TULIP = 7;
public const TYPE_OXEYE_DAISY = 8; public const TYPE_OXEYE_DAISY = 8;
public const TYPE_CORNFLOWER = 9;
public const TYPE_LILY_OF_THE_VALLEY = 10;
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN); $down = $this->getSide(Facing::DOWN);

View File

@ -30,6 +30,7 @@ class Quartz extends Solid{
public const NORMAL = 0; public const NORMAL = 0;
public const CHISELED = 1; public const CHISELED = 1;
public const PILLAR = 2; public const PILLAR = 2;
public const SMOOTH = 3;
public function getHardness() : float{ public function getHardness() : float{
return 0.8; return 0.8;

View File

@ -29,7 +29,8 @@ class Sandstone extends Solid{
public const NORMAL = 0; public const NORMAL = 0;
public const CHISELED = 1; public const CHISELED = 1;
public const SMOOTH = 2; public const CUT = 2;
public const SMOOTH = 3;
public function getHardness() : float{ public function getHardness() : float{
return 0.8; return 0.8;