diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index 3918f71b2..33c55a6c9 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -258,6 +258,24 @@ class Block extends Position implements BlockIds, Metadatable{ self::registerBlock(new GrassPath()); self::registerBlock(new ItemFrame()); + self::registerBlock(new GlazedTerracotta(Block::PURPLE_GLAZED_TERRACOTTA, 0, "Purple Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::WHITE_GLAZED_TERRACOTTA, 0, "White Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::ORANGE_GLAZED_TERRACOTTA, 0, "Orange Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::MAGENTA_GLAZED_TERRACOTTA, 0, "Magenta Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::LIGHT_BLUE_GLAZED_TERRACOTTA, 0, "Light Blue Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::YELLOW_GLAZED_TERRACOTTA, 0, "Yellow Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::LIME_GLAZED_TERRACOTTA, 0, "Lime Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::PINK_GLAZED_TERRACOTTA, 0, "Pink Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::GRAY_GLAZED_TERRACOTTA, 0, "Grey Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::SILVER_GLAZED_TERRACOTTA, 0, "Light Grey Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::CYAN_GLAZED_TERRACOTTA, 0, "Cyan Glazed Terracotta")); + + self::registerBlock(new GlazedTerracotta(Block::BLUE_GLAZED_TERRACOTTA, 0, "Blue Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::BROWN_GLAZED_TERRACOTTA, 0, "Brown Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::GREEN_GLAZED_TERRACOTTA, 0, "Green Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::RED_GLAZED_TERRACOTTA, 0, "Red Glazed Terracotta")); + self::registerBlock(new GlazedTerracotta(Block::BLACK_GLAZED_TERRACOTTA, 0, "Black Glazed Terracotta")); + self::registerBlock(new Podzol()); self::registerBlock(new Beetroot()); self::registerBlock(new Stonecutter()); diff --git a/src/pocketmine/block/GlazedTerracotta.php b/src/pocketmine/block/GlazedTerracotta.php new file mode 100644 index 000000000..e69047c00 --- /dev/null +++ b/src/pocketmine/block/GlazedTerracotta.php @@ -0,0 +1,61 @@ + 4, + 1 => 3, + 2 => 5, + 3 => 2 + ]; + $this->meta = $faces[(~($player->getDirection() - 1)) & 0x03]; + } + + return $this->getLevel()->setBlock($block, $this, true, true); + } + + public function getDrops(Item $item){ + if($item->isPickaxe() >= Tool::TIER_WOODEN){ + return [ + [$this->getId(), 0, 1], + ]; + }else{ + return []; + } + } +} \ No newline at end of file