implemented Carved Pumpkin

This commit is contained in:
Dylan K. Taylor 2019-07-09 17:56:09 +01:00
parent b6efb33b91
commit 08e1f6405c
5 changed files with 14 additions and 11 deletions

View File

@ -229,7 +229,6 @@ class BlockFactory{
self::register(new LapisOre(new BID(Ids::LAPIS_ORE), "Lapis Lazuli Ore"));
self::register(new Lava(new BIDFlattened(Ids::FLOWING_LAVA, Ids::STILL_LAVA), "Lava"));
self::register(new Lever(new BID(Ids::LEVER), "Lever"));
self::register(new LitPumpkin(new BID(Ids::JACK_O_LANTERN), "Jack o'Lantern"));
self::register(new Magma(new BID(Ids::MAGMA), "Magma Block"));
self::register(new Melon(new BID(Ids::MELON_BLOCK), "Melon Block"));
self::register(new MelonStem(new BID(Ids::MELON_STEM, 0, ItemIds::MELON_SEEDS), "Melon Stem"));
@ -263,7 +262,14 @@ class BlockFactory{
self::register(new Solid(new BID(Ids::PRISMARINE, Meta::PRISMARINE_NORMAL), "Prismarine", $prismarineBreakInfo));
self::register(new Stair(new BID(Ids::PRISMARINE_STAIRS), "Prismarine Stairs", $prismarineBreakInfo));
self::register(new Pumpkin(new BID(Ids::PUMPKIN), "Pumpkin"));
$pumpkinBreakInfo = new BlockBreakInfo(1.0, BlockToolType::AXE);
self::register($pumpkin = new Solid(new BID(Ids::PUMPKIN), "Pumpkin", $pumpkinBreakInfo));
for($i = 1; $i <= 3; ++$i){
self::remap(Ids::PUMPKIN, $i, $pumpkin);
}
self::register(new CarvedPumpkin(new BID(Ids::CARVED_PUMPKIN), "Carved Pumpkin", $pumpkinBreakInfo));
self::register(new LitPumpkin(new BID(Ids::JACK_O_LANTERN), "Jack o'Lantern", $pumpkinBreakInfo));
self::register(new PumpkinStem(new BID(Ids::PUMPKIN_STEM, 0, ItemIds::PUMPKIN_SEEDS), "Pumpkin Stem"));
$purpurBreakInfo = new BlockBreakInfo(1.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0);
@ -569,7 +575,6 @@ class BlockFactory{
//TODO: minecraft:bubble_column
//TODO: minecraft:campfire
//TODO: minecraft:cartography_table
//TODO: minecraft:carved_pumpkin
//TODO: minecraft:cauldron
//TODO: minecraft:chain_command_block
//TODO: minecraft:chemical_heat

View File

@ -31,15 +31,11 @@ use pocketmine\math\Vector3;
use pocketmine\player\Player;
use pocketmine\world\BlockTransaction;
class Pumpkin extends Solid{
class CarvedPumpkin extends Solid{
/** @var int */
protected $facing = Facing::NORTH;
public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){
parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.0, BlockToolType::AXE));
}
public function readStateFromData(int $id, int $stateMeta) : void{
$this->facing = BlockDataValidator::readLegacyHorizontalFacing($stateMeta & 0x03);
}

View File

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\block;
class LitPumpkin extends Pumpkin{
class LitPumpkin extends CarvedPumpkin{
public function getLightLevel() : int{
return 15;

View File

@ -113,6 +113,7 @@ use function assert;
* @method static Cactus CACTUS()
* @method static Cake CAKE()
* @method static Carrot CARROTS()
* @method static CarvedPumpkin CARVED_PUMPKIN()
* @method static Chest CHEST()
* @method static Solid CHISELED_QUARTZ()
* @method static Solid CHISELED_RED_SANDSTONE()
@ -533,7 +534,7 @@ use function assert;
* @method static Slab PRISMARINE_SLAB()
* @method static Stair PRISMARINE_STAIRS()
* @method static Wall PRISMARINE_WALL()
* @method static Pumpkin PUMPKIN()
* @method static Solid PUMPKIN()
* @method static PumpkinStem PUMPKIN_STEM()
* @method static Carpet PURPLE_CARPET()
* @method static Concrete PURPLE_CONCRETE()
@ -777,6 +778,7 @@ final class VanillaBlocks{
self::register("cactus", BlockFactory::get(81));
self::register("cake", BlockFactory::get(92));
self::register("carrots", BlockFactory::get(141));
self::register("carved_pumpkin", BlockFactory::get(410));
self::register("chest", BlockFactory::get(54, 2));
self::register("chiseled_quartz", BlockFactory::get(155, 1));
self::register("chiseled_red_sandstone", BlockFactory::get(179, 1));

File diff suppressed because one or more lines are too long