diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index a7aad0f82..e8b4ca587 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -221,7 +221,8 @@ class Block extends Position implements BlockIds, Metadatable{ self::$list[self::WOOD2] = Wood2::class; self::$list[self::ACACIA_WOOD_STAIRS] = AcaciaWoodStairs::class; self::$list[self::DARK_OAK_WOOD_STAIRS] = DarkOakWoodStairs::class; - + self::$list[self::PRISMARINE] = Prismarine::class; + self::$list[self::SEA_LANTERN] = SeaLantern::class; self::$list[self::IRON_TRAPDOOR] = IronTrapdoor::class; self::$list[self::HAY_BALE] = HayBale::class; self::$list[self::CARPET] = Carpet::class; diff --git a/src/pocketmine/block/BlockIds.php b/src/pocketmine/block/BlockIds.php index 415cddf5f..7e3810d93 100644 --- a/src/pocketmine/block/BlockIds.php +++ b/src/pocketmine/block/BlockIds.php @@ -161,6 +161,7 @@ interface BlockIds{ const BIRCH_WOOD_STAIRS = 135, BIRCH_WOODEN_STAIRS = 135; const JUNGLE_WOOD_STAIRS = 136, JUNGLE_WOODEN_STAIRS = 136; + const BEACON = 138; const COBBLESTONE_WALL = 139, COBBLE_WALL = 139, STONE_WALL = 139; const FLOWER_POT_BLOCK = 140; const CARROT_BLOCK = 141; @@ -190,7 +191,8 @@ interface BlockIds{ const SLIME_BLOCK = 165; const IRON_TRAPDOOR = 167; - + const PRISMARINE = 168; + const SEA_LANTERN = 169; const HAY_BALE = 170; const CARPET = 171; const HARDENED_CLAY = 172; diff --git a/src/pocketmine/block/Prismarine.php b/src/pocketmine/block/Prismarine.php new file mode 100644 index 000000000..164655b5a --- /dev/null +++ b/src/pocketmine/block/Prismarine.php @@ -0,0 +1,65 @@ +meta = $meta; + } + + public function getHardness(){ + return 1.5; + } + + public function getName(){ + static $names = [ + self::NORMAL => "Prismarine", + self::DARK => "Dark Prismarine", + self::BRICKS => "Prismarine Bricks", + ]; + return $names[$this->meta & 0x0f]; + } + + public function getToolType(){ + return Tool::TYPE_PICKAXE; + } + + public function getDrops(Item $item){ + if($item->isPickaxe() >= Tool::TIER_WOODEN){ + return [ + [$this->id, $this->meta & 0x0f, 1], + ]; + }else{ + return []; + } + } +} \ No newline at end of file diff --git a/src/pocketmine/block/SeaLantern.php b/src/pocketmine/block/SeaLantern.php new file mode 100644 index 000000000..9abcba1b6 --- /dev/null +++ b/src/pocketmine/block/SeaLantern.php @@ -0,0 +1,53 @@ +meta = $meta; + } + + public function getName(){ + return "Sea Lantern"; + } + + public function getHardness(){ + return 0.3; + } + + public function getLightLevel(){ + return 15; + } + + public function getDrops(Item $item){ + return [ + [Item::PRISMARINE_CRYSTALS, 0, 3], + ]; + } + +} \ No newline at end of file diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index 2c326e3da..e9f55799b 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -212,6 +212,9 @@ class Item implements ItemIds, \JsonSerializable{ self::$list[self::BEETROOT] = Beetroot::class; self::$list[self::BEETROOT_SEEDS] = BeetrootSeeds::class; self::$list[self::BEETROOT_SOUP] = BeetrootSoup::class; + self::$list[self::PRISMARINE_CRYSTALS] = PrismarineCrystals::class; + self::$list[self::PRISMARINE_SHARD] = PrismarineShard::class; + self::$list[self::NETHER_STAR] = NetherStar::class; for($i = 0; $i < 256; ++$i){ if(Block::$list[$i] !== null){ @@ -799,7 +802,7 @@ class Item implements ItemIds, \JsonSerializable{ $tag->tag = clone $this->getNamedTag(); $tag->tag->setName("tag"); } - + if($slot !== -1){ $tag->Slot = new ByteTag("Slot", $slot); } diff --git a/src/pocketmine/item/ItemIds.php b/src/pocketmine/item/ItemIds.php index bf8460096..4ecf60d32 100644 --- a/src/pocketmine/item/ItemIds.php +++ b/src/pocketmine/item/ItemIds.php @@ -167,7 +167,7 @@ interface ItemIds extends BlockIds{ const GOLDEN_CARROT = 396; const MOB_HEAD = 397, SKULL = 397; const CARROT_ON_A_STICK = 398; - + const NETHER_STAR = 399; const PUMPKIN_PIE = 400; const ENCHANTED_BOOK = 403; @@ -176,7 +176,9 @@ interface ItemIds extends BlockIds{ const QUARTZ = 406; const NETHER_QUARTZ = 406; const MINECART_WITH_TNT = 407; - const MINECART_WITH_HOPPER = 408, HOPPER = 410; + const MINECART_WITH_HOPPER = 408; + const PRISMARINE_SHARD = 409; + const HOPPER = 410; const RAW_RABBIT = 411; const COOKED_RABBIT = 412; const RABBIT_STEW = 413; @@ -188,7 +190,7 @@ interface ItemIds extends BlockIds{ const DIAMOND_HORSE_ARMOR = 419; const LEAD = 420, LEASH = 420; const NAMETAG = 421; - + const PRISMARINE_CRYSTALS = 422; const RAW_MUTTON = 423; const COOKED_MUTTON = 424; diff --git a/src/pocketmine/item/NetherStar.php b/src/pocketmine/item/NetherStar.php new file mode 100644 index 000000000..26dddb73f --- /dev/null +++ b/src/pocketmine/item/NetherStar.php @@ -0,0 +1,29 @@ +