diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index 9ee9d3f60..032ca9679 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -239,6 +239,8 @@ class Block extends Position implements Metadatable{ const FENCE_GATE_DARK_OAK = 186; const FENCE_GATE_ACACIA = 187; + const GRASS_PATH = 198; + const PODZOL = 243; const BEETROOT_BLOCK = 244; const STONECUTTER = 245; @@ -706,6 +708,8 @@ class Block extends Position implements Metadatable{ self::$list[self::CARROT_BLOCK] = Carrot::class; self::$list[self::POTATO_BLOCK] = Potato::class; + self::$list[self::REDSTONE_BLOCK] = Redstone::class; + self::$list[self::QUARTZ_BLOCK] = Quartz::class; self::$list[self::QUARTZ_STAIRS] = QuartzStairs::class; self::$list[self::DOUBLE_WOOD_SLAB] = DoubleWoodSlab::class; @@ -730,6 +734,8 @@ class Block extends Position implements Metadatable{ self::$list[self::FENCE_GATE_DARK_OAK] = FenceGateDarkOak::class; self::$list[self::FENCE_GATE_ACACIA] = FenceGateAcacia::class; + self::$list[self::GRASS_PATH] = GrassPath::class; + self::$list[self::PODZOL] = Podzol::class; self::$list[self::BEETROOT_BLOCK] = Beetroot::class; self::$list[self::STONECUTTER] = Stonecutter::class; diff --git a/src/pocketmine/block/Grass.php b/src/pocketmine/block/Grass.php index 352d9d4e8..3234b1717 100644 --- a/src/pocketmine/block/Grass.php +++ b/src/pocketmine/block/Grass.php @@ -84,6 +84,11 @@ class Grass extends Solid{ $item->useOn($this); $this->getLevel()->setBlock($this, new Farmland()); + return true; + }elseif($item->isShovel() and $this->getSide(1)->getId() === Block::AIR){ + $item->useOn($this); + $this->getLevel()->setBlock($this, new GrassPath()); + return true; } diff --git a/src/pocketmine/block/GrassPath.php b/src/pocketmine/block/GrassPath.php new file mode 100644 index 000000000..705e518a4 --- /dev/null +++ b/src/pocketmine/block/GrassPath.php @@ -0,0 +1,66 @@ +x, + $this->y, + $this->z, + $this->x + 1, + $this->y + 0.9375, + $this->z + 1 + ); + } + + public function getHardness(){ + return 3; + } + + public function getDrops(Item $item){ + return [ + [Item::DIRT, 0, 1], + ]; + } +} \ No newline at end of file diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index 312cd059b..c5b37cd12 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -230,6 +230,8 @@ class Item{ const FENCE_GATE_DARK_OAK = 186; const FENCE_GATE_ACACIA = 187; + const GRASS_PATH = 198; + const PODZOL = 243; const BEETROOT_BLOCK = 244; const STONECUTTER = 245;