diff --git a/src/block/BlockFactory.php b/src/block/BlockFactory.php index fd98293c5..2cda5bcdd 100644 --- a/src/block/BlockFactory.php +++ b/src/block/BlockFactory.php @@ -291,7 +291,7 @@ class BlockFactory{ $this->registerAllMeta(new Stair(new BID(Ids::PRISMARINE_STAIRS, 0), "Prismarine Stairs", $prismarineBreakInfo)); $pumpkinBreakInfo = new BlockBreakInfo(1.0, BlockToolType::AXE); - $this->registerAllMeta($pumpkin = new Opaque(new BID(Ids::PUMPKIN, 0), "Pumpkin", $pumpkinBreakInfo)); + $this->registerAllMeta(new Pumpkin(new BID(Ids::PUMPKIN, 0), "Pumpkin", $pumpkinBreakInfo)); $this->registerAllMeta(new CarvedPumpkin(new BID(Ids::CARVED_PUMPKIN, 0), "Carved Pumpkin", $pumpkinBreakInfo)); $this->registerAllMeta(new LitPumpkin(new BID(Ids::JACK_O_LANTERN, 0), "Jack o'Lantern", $pumpkinBreakInfo)); diff --git a/src/block/Pumpkin.php b/src/block/Pumpkin.php new file mode 100644 index 000000000..57d305806 --- /dev/null +++ b/src/block/Pumpkin.php @@ -0,0 +1,45 @@ +applyDamage(1); + $this->position->getWorld()->setBlock($this->position, VanillaBlocks::CARVED_PUMPKIN()->setFacing($face)); + $this->position->getWorld()->dropItem($this->position->add(0.5, 0.5, 0.5), VanillaItems::PUMPKIN_SEEDS()->setCount(1)); + return true; + } + return false; + } +} diff --git a/src/block/VanillaBlocks.php b/src/block/VanillaBlocks.php index 7d2d947c5..f9ec337a4 100644 --- a/src/block/VanillaBlocks.php +++ b/src/block/VanillaBlocks.php @@ -445,7 +445,7 @@ use pocketmine\utils\CloningRegistryTrait; * @method static Slab PRISMARINE_SLAB() * @method static Stair PRISMARINE_STAIRS() * @method static Wall PRISMARINE_WALL() - * @method static Opaque PUMPKIN() + * @method static Pumpkin PUMPKIN() * @method static PumpkinStem PUMPKIN_STEM() * @method static GlazedTerracotta PURPLE_GLAZED_TERRACOTTA() * @method static Torch PURPLE_TORCH()