Rename BlockIds -> BlockLegacyIds

This commit is contained in:
Dylan K. Taylor 2019-03-23 19:46:31 +00:00
parent 79ef8e0803
commit 2a3e6dcf00
83 changed files with 541 additions and 541 deletions

View File

@ -26,7 +26,7 @@ namespace pocketmine;
use pocketmine\block\Bed;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\UnknownBlock;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
@ -2083,8 +2083,8 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
}
$block = $target->getSide($face);
if($block->getId() === BlockIds::FIRE){
$this->level->setBlock($block, BlockFactory::get(BlockIds::AIR));
if($block->getId() === BlockLegacyIds::FIRE){
$this->level->setBlock($block, BlockFactory::get(BlockLegacyIds::AIR));
return true;
}

View File

@ -163,7 +163,7 @@ class Banner extends Transparent{
}
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::opposite($this->facing))->getId() === BlockIds::AIR){
if($this->getSide(Facing::opposite($this->facing))->getId() === BlockLegacyIds::AIR){
$this->getLevel()->useBreakOn($this);
}
}

View File

@ -48,7 +48,7 @@ use function dechex;
use function get_class;
use const PHP_INT_MAX;
class Block extends Position implements BlockIds, Metadatable{
class Block extends Position implements BlockLegacyIds, Metadatable{
/**
* Returns a new Block instance with the specified ID, meta and position.
@ -314,7 +314,7 @@ class Block extends Position implements BlockIds, Metadatable{
if(($t = $this->level->getTile($this)) !== null){
$t->onBlockDestroyed();
}
return $this->getLevel()->setBlock($this, BlockFactory::get(BlockIds::AIR));
return $this->getLevel()->setBlock($this, BlockFactory::get(BlockLegacyIds::AIR));
}
@ -655,7 +655,7 @@ class Block extends Position implements BlockIds, Metadatable{
return $this->getLevel()->getBlock(Vector3::getSide($side, $step));
}
return BlockFactory::get(BlockIds::AIR, 0, Position::fromObject(Vector3::getSide($side, $step)));
return BlockFactory::get(BlockLegacyIds::AIR, 0, Position::fromObject(Vector3::getSide($side, $step)));
}
/**

View File

@ -75,328 +75,328 @@ class BlockFactory{
self::$diffusesSkyLight = \SplFixedArray::fromArray(array_fill(0, 8192, false));
self::$blastResistance = \SplFixedArray::fromArray(array_fill(0, 8192, 0));
self::register(new ActivatorRail(new BID(BlockIds::ACTIVATOR_RAIL, BaseRail::STRAIGHT_NORTH_SOUTH), "Activator Rail"));
self::register(new Air(new BID(BlockIds::AIR), "Air"));
self::register(new Anvil(new BID(BlockIds::ANVIL, Anvil::TYPE_NORMAL), "Anvil"));
self::register(new Anvil(new BID(BlockIds::ANVIL, Anvil::TYPE_SLIGHTLY_DAMAGED), "Slightly Damaged Anvil"));
self::register(new Anvil(new BID(BlockIds::ANVIL, Anvil::TYPE_VERY_DAMAGED), "Very Damaged Anvil"));
self::register(new Banner(new BlockIdentifierFlattened(BlockIds::STANDING_BANNER, BlockIds::WALL_BANNER, 0, ItemIds::BANNER, \pocketmine\tile\Banner::class), "Banner"));
self::register(new Barrier(new BID(BlockIds::BARRIER), "Barrier"));
self::register(new Bed(new BID(BlockIds::BED_BLOCK, 0, ItemIds::BED, \pocketmine\tile\Bed::class), "Bed Block"));
self::register(new Bedrock(new BID(BlockIds::BEDROCK), "Bedrock"));
self::register(new Beetroot(new BID(BlockIds::BEETROOT_BLOCK), "Beetroot Block"));
self::register(new BlueIce(new BID(BlockIds::BLUE_ICE), "Blue Ice"));
self::register(new BoneBlock(new BID(BlockIds::BONE_BLOCK), "Bone Block"));
self::register(new Bookshelf(new BID(BlockIds::BOOKSHELF), "Bookshelf"));
self::register(new BrewingStand(new BID(BlockIds::BREWING_STAND_BLOCK, 0, ItemIds::BREWING_STAND), "Brewing Stand"));
self::register(new BrickStairs(new BID(BlockIds::BRICK_STAIRS), "Brick Stairs"));
self::register(new Bricks(new BID(BlockIds::BRICK_BLOCK), "Bricks"));
self::register(new BrownMushroom(new BID(BlockIds::BROWN_MUSHROOM), "Brown Mushroom"));
self::register(new BrownMushroomBlock(new BID(BlockIds::BROWN_MUSHROOM_BLOCK), "Brown Mushroom Block"));
self::register(new Cactus(new BID(BlockIds::CACTUS), "Cactus"));
self::register(new Cake(new BID(BlockIds::CAKE_BLOCK, 0, ItemIds::CAKE), "Cake"));
self::register(new Carrot(new BID(BlockIds::CARROTS), "Carrot Block"));
self::register(new Chest(new BID(BlockIds::CHEST, 0, null, \pocketmine\tile\Chest::class), "Chest"));
self::register(new Clay(new BID(BlockIds::CLAY_BLOCK), "Clay Block"));
self::register(new Coal(new BID(BlockIds::COAL_BLOCK), "Coal Block"));
self::register(new CoalOre(new BID(BlockIds::COAL_ORE), "Coal Ore"));
self::register(new CoarseDirt(new BID(BlockIds::DIRT, Dirt::COARSE), "Coarse Dirt"));
self::register(new Cobblestone(new BID(BlockIds::COBBLESTONE), "Cobblestone"));
self::register(new Cobblestone(new BID(BlockIds::MOSSY_COBBLESTONE), "Moss Stone"));
self::register(new CobblestoneStairs(new BID(BlockIds::COBBLESTONE_STAIRS), "Cobblestone Stairs"));
self::register(new Cobweb(new BID(BlockIds::COBWEB), "Cobweb"));
self::register(new CocoaBlock(new BID(BlockIds::COCOA), "Cocoa Block"));
self::register(new CraftingTable(new BID(BlockIds::CRAFTING_TABLE), "Crafting Table"));
self::register(new Dandelion(new BID(BlockIds::DANDELION), "Dandelion"));
self::register(new DaylightSensor(new BlockIdentifierFlattened(BlockIds::DAYLIGHT_DETECTOR, BlockIds::DAYLIGHT_DETECTOR_INVERTED), "Daylight Sensor"));
self::register(new DeadBush(new BID(BlockIds::DEADBUSH), "Dead Bush"));
self::register(new DetectorRail(new BID(BlockIds::DETECTOR_RAIL), "Detector Rail"));
self::register(new Diamond(new BID(BlockIds::DIAMOND_BLOCK), "Diamond Block"));
self::register(new DiamondOre(new BID(BlockIds::DIAMOND_ORE), "Diamond Ore"));
self::register(new Dirt(new BID(BlockIds::DIRT, Dirt::NORMAL), "Dirt"));
self::register(new DoublePlant(new BID(BlockIds::DOUBLE_PLANT, 0), "Sunflower"));
self::register(new DoublePlant(new BID(BlockIds::DOUBLE_PLANT, 1), "Lilac"));
self::register(new DoublePlant(new BID(BlockIds::DOUBLE_PLANT, 4), "Rose Bush"));
self::register(new DoublePlant(new BID(BlockIds::DOUBLE_PLANT, 5), "Peony"));
self::register(new DoubleTallGrass(new BID(BlockIds::DOUBLE_PLANT, 2), "Double Tallgrass"));
self::register(new DoubleTallGrass(new BID(BlockIds::DOUBLE_PLANT, 3), "Large Fern"));
self::register(new DragonEgg(new BID(BlockIds::DRAGON_EGG), "Dragon Egg"));
self::register(new Emerald(new BID(BlockIds::EMERALD_BLOCK), "Emerald Block"));
self::register(new EmeraldOre(new BID(BlockIds::EMERALD_ORE), "Emerald Ore"));
self::register(new EnchantingTable(new BID(BlockIds::ENCHANTING_TABLE, 0, null, \pocketmine\tile\EnchantTable::class), "Enchanting Table"));
self::register(new EndPortalFrame(new BID(BlockIds::END_PORTAL_FRAME), "End Portal Frame"));
self::register(new EndRod(new BID(BlockIds::END_ROD), "End Rod"));
self::register(new EndStone(new BID(BlockIds::END_STONE), "End Stone"));
self::register(new EndStoneBricks(new BID(BlockIds::END_BRICKS), "End Stone Bricks"));
self::register(new EnderChest(new BID(BlockIds::ENDER_CHEST, 0, null, \pocketmine\tile\EnderChest::class), "Ender Chest"));
self::register(new Farmland(new BID(BlockIds::FARMLAND), "Farmland"));
self::register(new Fire(new BID(BlockIds::FIRE), "Fire Block"));
self::register(new Flower(new BID(BlockIds::RED_FLOWER, Flower::TYPE_ALLIUM), "Allium"));
self::register(new Flower(new BID(BlockIds::RED_FLOWER, Flower::TYPE_AZURE_BLUET), "Azure Bluet"));
self::register(new Flower(new BID(BlockIds::RED_FLOWER, Flower::TYPE_BLUE_ORCHID), "Blue Orchid"));
self::register(new Flower(new BID(BlockIds::RED_FLOWER, Flower::TYPE_CORNFLOWER), "Cornflower"));
self::register(new Flower(new BID(BlockIds::RED_FLOWER, Flower::TYPE_LILY_OF_THE_VALLEY), "Lily of the Valley"));
self::register(new Flower(new BID(BlockIds::RED_FLOWER, Flower::TYPE_ORANGE_TULIP), "Orange Tulip"));
self::register(new Flower(new BID(BlockIds::RED_FLOWER, Flower::TYPE_OXEYE_DAISY), "Oxeye Daisy"));
self::register(new Flower(new BID(BlockIds::RED_FLOWER, Flower::TYPE_PINK_TULIP), "Pink Tulip"));
self::register(new Flower(new BID(BlockIds::RED_FLOWER, Flower::TYPE_POPPY), "Poppy"));
self::register(new Flower(new BID(BlockIds::RED_FLOWER, Flower::TYPE_RED_TULIP), "Red Tulip"));
self::register(new Flower(new BID(BlockIds::RED_FLOWER, Flower::TYPE_WHITE_TULIP), "White Tulip"));
self::register(new FlowerPot(new BID(BlockIds::FLOWER_POT_BLOCK, 0, ItemIds::FLOWER_POT, \pocketmine\tile\FlowerPot::class), "Flower Pot"));
self::register(new FrostedIce(new BID(BlockIds::FROSTED_ICE), "Frosted Ice"));
self::register(new Furnace(new BlockIdentifierFlattened(BlockIds::FURNACE, BlockIds::LIT_FURNACE, 0, null, \pocketmine\tile\Furnace::class), "Furnace"));
self::register(new Glass(new BID(BlockIds::GLASS), "Glass"));
self::register(new GlassPane(new BID(BlockIds::GLASS_PANE), "Glass Pane"));
self::register(new GlowingObsidian(new BID(BlockIds::GLOWINGOBSIDIAN), "Glowing Obsidian"));
self::register(new Glowstone(new BID(BlockIds::GLOWSTONE), "Glowstone"));
self::register(new Gold(new BID(BlockIds::GOLD_BLOCK), "Gold Block"));
self::register(new GoldOre(new BID(BlockIds::GOLD_ORE), "Gold Ore"));
self::register(new Grass(new BID(BlockIds::GRASS), "Grass"));
self::register(new GrassPath(new BID(BlockIds::GRASS_PATH), "Grass Path"));
self::register(new Gravel(new BID(BlockIds::GRAVEL), "Gravel"));
self::register(new HardenedClay(new BID(BlockIds::HARDENED_CLAY), "Hardened Clay"));
self::register(new HardenedGlass(new BID(BlockIds::HARD_GLASS), "Hardened Glass"));
self::register(new HardenedGlassPane(new BID(BlockIds::HARD_GLASS_PANE), "Hardened Glass Pane"));
self::register(new HayBale(new BID(BlockIds::HAY_BALE), "Hay Bale"));
self::register(new Ice(new BID(BlockIds::ICE), "Ice"));
self::register(new class(new BID(BlockIds::MONSTER_EGG), "Infested Stone") extends InfestedStone{
self::register(new ActivatorRail(new BID(BlockLegacyIds::ACTIVATOR_RAIL, BaseRail::STRAIGHT_NORTH_SOUTH), "Activator Rail"));
self::register(new Air(new BID(BlockLegacyIds::AIR), "Air"));
self::register(new Anvil(new BID(BlockLegacyIds::ANVIL, Anvil::TYPE_NORMAL), "Anvil"));
self::register(new Anvil(new BID(BlockLegacyIds::ANVIL, Anvil::TYPE_SLIGHTLY_DAMAGED), "Slightly Damaged Anvil"));
self::register(new Anvil(new BID(BlockLegacyIds::ANVIL, Anvil::TYPE_VERY_DAMAGED), "Very Damaged Anvil"));
self::register(new Banner(new BlockIdentifierFlattened(BlockLegacyIds::STANDING_BANNER, BlockLegacyIds::WALL_BANNER, 0, ItemIds::BANNER, \pocketmine\tile\Banner::class), "Banner"));
self::register(new Barrier(new BID(BlockLegacyIds::BARRIER), "Barrier"));
self::register(new Bed(new BID(BlockLegacyIds::BED_BLOCK, 0, ItemIds::BED, \pocketmine\tile\Bed::class), "Bed Block"));
self::register(new Bedrock(new BID(BlockLegacyIds::BEDROCK), "Bedrock"));
self::register(new Beetroot(new BID(BlockLegacyIds::BEETROOT_BLOCK), "Beetroot Block"));
self::register(new BlueIce(new BID(BlockLegacyIds::BLUE_ICE), "Blue Ice"));
self::register(new BoneBlock(new BID(BlockLegacyIds::BONE_BLOCK), "Bone Block"));
self::register(new Bookshelf(new BID(BlockLegacyIds::BOOKSHELF), "Bookshelf"));
self::register(new BrewingStand(new BID(BlockLegacyIds::BREWING_STAND_BLOCK, 0, ItemIds::BREWING_STAND), "Brewing Stand"));
self::register(new BrickStairs(new BID(BlockLegacyIds::BRICK_STAIRS), "Brick Stairs"));
self::register(new Bricks(new BID(BlockLegacyIds::BRICK_BLOCK), "Bricks"));
self::register(new BrownMushroom(new BID(BlockLegacyIds::BROWN_MUSHROOM), "Brown Mushroom"));
self::register(new BrownMushroomBlock(new BID(BlockLegacyIds::BROWN_MUSHROOM_BLOCK), "Brown Mushroom Block"));
self::register(new Cactus(new BID(BlockLegacyIds::CACTUS), "Cactus"));
self::register(new Cake(new BID(BlockLegacyIds::CAKE_BLOCK, 0, ItemIds::CAKE), "Cake"));
self::register(new Carrot(new BID(BlockLegacyIds::CARROTS), "Carrot Block"));
self::register(new Chest(new BID(BlockLegacyIds::CHEST, 0, null, \pocketmine\tile\Chest::class), "Chest"));
self::register(new Clay(new BID(BlockLegacyIds::CLAY_BLOCK), "Clay Block"));
self::register(new Coal(new BID(BlockLegacyIds::COAL_BLOCK), "Coal Block"));
self::register(new CoalOre(new BID(BlockLegacyIds::COAL_ORE), "Coal Ore"));
self::register(new CoarseDirt(new BID(BlockLegacyIds::DIRT, Dirt::COARSE), "Coarse Dirt"));
self::register(new Cobblestone(new BID(BlockLegacyIds::COBBLESTONE), "Cobblestone"));
self::register(new Cobblestone(new BID(BlockLegacyIds::MOSSY_COBBLESTONE), "Moss Stone"));
self::register(new CobblestoneStairs(new BID(BlockLegacyIds::COBBLESTONE_STAIRS), "Cobblestone Stairs"));
self::register(new Cobweb(new BID(BlockLegacyIds::COBWEB), "Cobweb"));
self::register(new CocoaBlock(new BID(BlockLegacyIds::COCOA), "Cocoa Block"));
self::register(new CraftingTable(new BID(BlockLegacyIds::CRAFTING_TABLE), "Crafting Table"));
self::register(new Dandelion(new BID(BlockLegacyIds::DANDELION), "Dandelion"));
self::register(new DaylightSensor(new BlockIdentifierFlattened(BlockLegacyIds::DAYLIGHT_DETECTOR, BlockLegacyIds::DAYLIGHT_DETECTOR_INVERTED), "Daylight Sensor"));
self::register(new DeadBush(new BID(BlockLegacyIds::DEADBUSH), "Dead Bush"));
self::register(new DetectorRail(new BID(BlockLegacyIds::DETECTOR_RAIL), "Detector Rail"));
self::register(new Diamond(new BID(BlockLegacyIds::DIAMOND_BLOCK), "Diamond Block"));
self::register(new DiamondOre(new BID(BlockLegacyIds::DIAMOND_ORE), "Diamond Ore"));
self::register(new Dirt(new BID(BlockLegacyIds::DIRT, Dirt::NORMAL), "Dirt"));
self::register(new DoublePlant(new BID(BlockLegacyIds::DOUBLE_PLANT, 0), "Sunflower"));
self::register(new DoublePlant(new BID(BlockLegacyIds::DOUBLE_PLANT, 1), "Lilac"));
self::register(new DoublePlant(new BID(BlockLegacyIds::DOUBLE_PLANT, 4), "Rose Bush"));
self::register(new DoublePlant(new BID(BlockLegacyIds::DOUBLE_PLANT, 5), "Peony"));
self::register(new DoubleTallGrass(new BID(BlockLegacyIds::DOUBLE_PLANT, 2), "Double Tallgrass"));
self::register(new DoubleTallGrass(new BID(BlockLegacyIds::DOUBLE_PLANT, 3), "Large Fern"));
self::register(new DragonEgg(new BID(BlockLegacyIds::DRAGON_EGG), "Dragon Egg"));
self::register(new Emerald(new BID(BlockLegacyIds::EMERALD_BLOCK), "Emerald Block"));
self::register(new EmeraldOre(new BID(BlockLegacyIds::EMERALD_ORE), "Emerald Ore"));
self::register(new EnchantingTable(new BID(BlockLegacyIds::ENCHANTING_TABLE, 0, null, \pocketmine\tile\EnchantTable::class), "Enchanting Table"));
self::register(new EndPortalFrame(new BID(BlockLegacyIds::END_PORTAL_FRAME), "End Portal Frame"));
self::register(new EndRod(new BID(BlockLegacyIds::END_ROD), "End Rod"));
self::register(new EndStone(new BID(BlockLegacyIds::END_STONE), "End Stone"));
self::register(new EndStoneBricks(new BID(BlockLegacyIds::END_BRICKS), "End Stone Bricks"));
self::register(new EnderChest(new BID(BlockLegacyIds::ENDER_CHEST, 0, null, \pocketmine\tile\EnderChest::class), "Ender Chest"));
self::register(new Farmland(new BID(BlockLegacyIds::FARMLAND), "Farmland"));
self::register(new Fire(new BID(BlockLegacyIds::FIRE), "Fire Block"));
self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_ALLIUM), "Allium"));
self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_AZURE_BLUET), "Azure Bluet"));
self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_BLUE_ORCHID), "Blue Orchid"));
self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_CORNFLOWER), "Cornflower"));
self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_LILY_OF_THE_VALLEY), "Lily of the Valley"));
self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_ORANGE_TULIP), "Orange Tulip"));
self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_OXEYE_DAISY), "Oxeye Daisy"));
self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_PINK_TULIP), "Pink Tulip"));
self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_POPPY), "Poppy"));
self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_RED_TULIP), "Red Tulip"));
self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, Flower::TYPE_WHITE_TULIP), "White Tulip"));
self::register(new FlowerPot(new BID(BlockLegacyIds::FLOWER_POT_BLOCK, 0, ItemIds::FLOWER_POT, \pocketmine\tile\FlowerPot::class), "Flower Pot"));
self::register(new FrostedIce(new BID(BlockLegacyIds::FROSTED_ICE), "Frosted Ice"));
self::register(new Furnace(new BlockIdentifierFlattened(BlockLegacyIds::FURNACE, BlockLegacyIds::LIT_FURNACE, 0, null, \pocketmine\tile\Furnace::class), "Furnace"));
self::register(new Glass(new BID(BlockLegacyIds::GLASS), "Glass"));
self::register(new GlassPane(new BID(BlockLegacyIds::GLASS_PANE), "Glass Pane"));
self::register(new GlowingObsidian(new BID(BlockLegacyIds::GLOWINGOBSIDIAN), "Glowing Obsidian"));
self::register(new Glowstone(new BID(BlockLegacyIds::GLOWSTONE), "Glowstone"));
self::register(new Gold(new BID(BlockLegacyIds::GOLD_BLOCK), "Gold Block"));
self::register(new GoldOre(new BID(BlockLegacyIds::GOLD_ORE), "Gold Ore"));
self::register(new Grass(new BID(BlockLegacyIds::GRASS), "Grass"));
self::register(new GrassPath(new BID(BlockLegacyIds::GRASS_PATH), "Grass Path"));
self::register(new Gravel(new BID(BlockLegacyIds::GRAVEL), "Gravel"));
self::register(new HardenedClay(new BID(BlockLegacyIds::HARDENED_CLAY), "Hardened Clay"));
self::register(new HardenedGlass(new BID(BlockLegacyIds::HARD_GLASS), "Hardened Glass"));
self::register(new HardenedGlassPane(new BID(BlockLegacyIds::HARD_GLASS_PANE), "Hardened Glass Pane"));
self::register(new HayBale(new BID(BlockLegacyIds::HAY_BALE), "Hay Bale"));
self::register(new Ice(new BID(BlockLegacyIds::ICE), "Ice"));
self::register(new class(new BID(BlockLegacyIds::MONSTER_EGG), "Infested Stone") extends InfestedStone{
public function getSilkTouchDrops(Item $item) : array{
return [ItemFactory::get(ItemIds::STONE)];
}
});
self::register(new class(new BID(BlockIds::MONSTER_EGG, 1), "Infested Cobblestone") extends InfestedStone{
self::register(new class(new BID(BlockLegacyIds::MONSTER_EGG, 1), "Infested Cobblestone") extends InfestedStone{
public function getSilkTouchDrops(Item $item) : array{
return [ItemFactory::get(ItemIds::COBBLESTONE)];
}
});
self::register(new class(new BID(BlockIds::MONSTER_EGG, 2), "Infested Stone Brick") extends InfestedStone{
self::register(new class(new BID(BlockLegacyIds::MONSTER_EGG, 2), "Infested Stone Brick") extends InfestedStone{
public function getSilkTouchDrops(Item $item) : array{
return [ItemFactory::get(ItemIds::STONE_BRICK)];
}
});
self::register(new class(new BID(BlockIds::MONSTER_EGG, 3), "Infested Mossy Stone Brick") extends InfestedStone{
self::register(new class(new BID(BlockLegacyIds::MONSTER_EGG, 3), "Infested Mossy Stone Brick") extends InfestedStone{
public function getSilkTouchDrops(Item $item) : array{
return [ItemFactory::get(ItemIds::STONE_BRICK, StoneBricks::MOSSY)];
}
});
self::register(new class(new BID(BlockIds::MONSTER_EGG, 4), "Infested Cracked Stone Brick") extends InfestedStone{
self::register(new class(new BID(BlockLegacyIds::MONSTER_EGG, 4), "Infested Cracked Stone Brick") extends InfestedStone{
public function getSilkTouchDrops(Item $item) : array{
return [ItemFactory::get(ItemIds::STONE_BRICK, StoneBricks::CRACKED)];
}
});
self::register(new class(new BID(BlockIds::MONSTER_EGG, 5), "Infested Chiseled Stone Brick") extends InfestedStone{
self::register(new class(new BID(BlockLegacyIds::MONSTER_EGG, 5), "Infested Chiseled Stone Brick") extends InfestedStone{
public function getSilkTouchDrops(Item $item) : array{
return [ItemFactory::get(ItemIds::STONE_BRICK, StoneBricks::CHISELED)];
}
});
self::register(new InfoUpdate(new BID(BlockIds::INFO_UPDATE), "update!"));
self::register(new InfoUpdate(new BID(BlockIds::INFO_UPDATE2), "ate!upd"));
self::register(new InvisibleBedrock(new BID(BlockIds::INVISIBLEBEDROCK), "Invisible Bedrock"));
self::register(new Iron(new BID(BlockIds::IRON_BLOCK), "Iron Block"));
self::register(new IronBars(new BID(BlockIds::IRON_BARS), "Iron Bars"));
self::register(new IronDoor(new BID(BlockIds::IRON_DOOR_BLOCK, 0, ItemIds::IRON_DOOR), "Iron Door"));
self::register(new IronOre(new BID(BlockIds::IRON_ORE), "Iron Ore"));
self::register(new IronTrapdoor(new BID(BlockIds::IRON_TRAPDOOR), "Iron Trapdoor"));
self::register(new ItemFrame(new BID(BlockIds::FRAME_BLOCK, 0, ItemIds::FRAME, \pocketmine\tile\ItemFrame::class), "Item Frame"));
self::register(new Ladder(new BID(BlockIds::LADDER), "Ladder"));
self::register(new Lapis(new BID(BlockIds::LAPIS_BLOCK), "Lapis Lazuli Block"));
self::register(new LapisOre(new BID(BlockIds::LAPIS_ORE), "Lapis Lazuli Ore"));
self::register(new Lava(new BlockIdentifierFlattened(BlockIds::FLOWING_LAVA, BlockIds::STILL_LAVA), "Lava"));
self::register(new Lever(new BID(BlockIds::LEVER), "Lever"));
self::register(new LitPumpkin(new BID(BlockIds::JACK_O_LANTERN), "Jack o'Lantern"));
self::register(new Magma(new BID(BlockIds::MAGMA), "Magma Block"));
self::register(new Melon(new BID(BlockIds::MELON_BLOCK), "Melon Block"));
self::register(new MelonStem(new BID(BlockIds::MELON_STEM, 0, ItemIds::MELON_SEEDS), "Melon Stem"));
self::register(new MonsterSpawner(new BID(BlockIds::MOB_SPAWNER), "Monster Spawner"));
self::register(new Mycelium(new BID(BlockIds::MYCELIUM), "Mycelium"));
self::register(new NetherBrick(new BID(BlockIds::NETHER_BRICK_BLOCK), "Nether Bricks"));
self::register(new NetherBrick(new BID(BlockIds::RED_NETHER_BRICK), "Red Nether Bricks"));
self::register(new NetherBrickFence(new BID(BlockIds::NETHER_BRICK_FENCE), "Nether Brick Fence"));
self::register(new NetherBrickStairs(new BID(BlockIds::NETHER_BRICK_STAIRS), "Nether Brick Stairs"));
self::register(new NetherPortal(new BID(BlockIds::PORTAL), "Nether Portal"));
self::register(new NetherQuartzOre(new BID(BlockIds::NETHER_QUARTZ_ORE), "Nether Quartz Ore"));
self::register(new NetherReactor(new BID(BlockIds::NETHERREACTOR), "Nether Reactor Core"));
self::register(new NetherWartBlock(new BID(BlockIds::NETHER_WART_BLOCK), "Nether Wart Block"));
self::register(new NetherWartPlant(new BID(BlockIds::NETHER_WART_PLANT, 0, ItemIds::NETHER_WART), "Nether Wart"));
self::register(new Netherrack(new BID(BlockIds::NETHERRACK), "Netherrack"));
self::register(new NoteBlock(new BID(BlockIds::NOTEBLOCK), "Note Block"));
self::register(new Obsidian(new BID(BlockIds::OBSIDIAN), "Obsidian"));
self::register(new PackedIce(new BID(BlockIds::PACKED_ICE), "Packed Ice"));
self::register(new Podzol(new BID(BlockIds::PODZOL), "Podzol"));
self::register(new Potato(new BID(BlockIds::POTATOES), "Potato Block"));
self::register(new PoweredRail(new BID(BlockIds::GOLDEN_RAIL, BaseRail::STRAIGHT_NORTH_SOUTH), "Powered Rail"));
self::register(new Prismarine(new BID(BlockIds::PRISMARINE, Prismarine::BRICKS), "Prismarine Bricks"));
self::register(new Prismarine(new BID(BlockIds::PRISMARINE, Prismarine::DARK), "Dark Prismarine"));
self::register(new Prismarine(new BID(BlockIds::PRISMARINE, Prismarine::NORMAL), "Prismarine"));
self::register(new Pumpkin(new BID(BlockIds::PUMPKIN), "Pumpkin"));
self::register(new PumpkinStem(new BID(BlockIds::PUMPKIN_STEM, 0, ItemIds::PUMPKIN_SEEDS), "Pumpkin Stem"));
self::register(new Purpur(new BID(BlockIds::PURPUR_BLOCK), "Purpur Block"));
self::register(new class(new BID(BlockIds::PURPUR_BLOCK, 2), "Purpur Pillar") extends Purpur{
self::register(new InfoUpdate(new BID(BlockLegacyIds::INFO_UPDATE), "update!"));
self::register(new InfoUpdate(new BID(BlockLegacyIds::INFO_UPDATE2), "ate!upd"));
self::register(new InvisibleBedrock(new BID(BlockLegacyIds::INVISIBLEBEDROCK), "Invisible Bedrock"));
self::register(new Iron(new BID(BlockLegacyIds::IRON_BLOCK), "Iron Block"));
self::register(new IronBars(new BID(BlockLegacyIds::IRON_BARS), "Iron Bars"));
self::register(new IronDoor(new BID(BlockLegacyIds::IRON_DOOR_BLOCK, 0, ItemIds::IRON_DOOR), "Iron Door"));
self::register(new IronOre(new BID(BlockLegacyIds::IRON_ORE), "Iron Ore"));
self::register(new IronTrapdoor(new BID(BlockLegacyIds::IRON_TRAPDOOR), "Iron Trapdoor"));
self::register(new ItemFrame(new BID(BlockLegacyIds::FRAME_BLOCK, 0, ItemIds::FRAME, \pocketmine\tile\ItemFrame::class), "Item Frame"));
self::register(new Ladder(new BID(BlockLegacyIds::LADDER), "Ladder"));
self::register(new Lapis(new BID(BlockLegacyIds::LAPIS_BLOCK), "Lapis Lazuli Block"));
self::register(new LapisOre(new BID(BlockLegacyIds::LAPIS_ORE), "Lapis Lazuli Ore"));
self::register(new Lava(new BlockIdentifierFlattened(BlockLegacyIds::FLOWING_LAVA, BlockLegacyIds::STILL_LAVA), "Lava"));
self::register(new Lever(new BID(BlockLegacyIds::LEVER), "Lever"));
self::register(new LitPumpkin(new BID(BlockLegacyIds::JACK_O_LANTERN), "Jack o'Lantern"));
self::register(new Magma(new BID(BlockLegacyIds::MAGMA), "Magma Block"));
self::register(new Melon(new BID(BlockLegacyIds::MELON_BLOCK), "Melon Block"));
self::register(new MelonStem(new BID(BlockLegacyIds::MELON_STEM, 0, ItemIds::MELON_SEEDS), "Melon Stem"));
self::register(new MonsterSpawner(new BID(BlockLegacyIds::MOB_SPAWNER), "Monster Spawner"));
self::register(new Mycelium(new BID(BlockLegacyIds::MYCELIUM), "Mycelium"));
self::register(new NetherBrick(new BID(BlockLegacyIds::NETHER_BRICK_BLOCK), "Nether Bricks"));
self::register(new NetherBrick(new BID(BlockLegacyIds::RED_NETHER_BRICK), "Red Nether Bricks"));
self::register(new NetherBrickFence(new BID(BlockLegacyIds::NETHER_BRICK_FENCE), "Nether Brick Fence"));
self::register(new NetherBrickStairs(new BID(BlockLegacyIds::NETHER_BRICK_STAIRS), "Nether Brick Stairs"));
self::register(new NetherPortal(new BID(BlockLegacyIds::PORTAL), "Nether Portal"));
self::register(new NetherQuartzOre(new BID(BlockLegacyIds::NETHER_QUARTZ_ORE), "Nether Quartz Ore"));
self::register(new NetherReactor(new BID(BlockLegacyIds::NETHERREACTOR), "Nether Reactor Core"));
self::register(new NetherWartBlock(new BID(BlockLegacyIds::NETHER_WART_BLOCK), "Nether Wart Block"));
self::register(new NetherWartPlant(new BID(BlockLegacyIds::NETHER_WART_PLANT, 0, ItemIds::NETHER_WART), "Nether Wart"));
self::register(new Netherrack(new BID(BlockLegacyIds::NETHERRACK), "Netherrack"));
self::register(new NoteBlock(new BID(BlockLegacyIds::NOTEBLOCK), "Note Block"));
self::register(new Obsidian(new BID(BlockLegacyIds::OBSIDIAN), "Obsidian"));
self::register(new PackedIce(new BID(BlockLegacyIds::PACKED_ICE), "Packed Ice"));
self::register(new Podzol(new BID(BlockLegacyIds::PODZOL), "Podzol"));
self::register(new Potato(new BID(BlockLegacyIds::POTATOES), "Potato Block"));
self::register(new PoweredRail(new BID(BlockLegacyIds::GOLDEN_RAIL, BaseRail::STRAIGHT_NORTH_SOUTH), "Powered Rail"));
self::register(new Prismarine(new BID(BlockLegacyIds::PRISMARINE, Prismarine::BRICKS), "Prismarine Bricks"));
self::register(new Prismarine(new BID(BlockLegacyIds::PRISMARINE, Prismarine::DARK), "Dark Prismarine"));
self::register(new Prismarine(new BID(BlockLegacyIds::PRISMARINE, Prismarine::NORMAL), "Prismarine"));
self::register(new Pumpkin(new BID(BlockLegacyIds::PUMPKIN), "Pumpkin"));
self::register(new PumpkinStem(new BID(BlockLegacyIds::PUMPKIN_STEM, 0, ItemIds::PUMPKIN_SEEDS), "Pumpkin Stem"));
self::register(new Purpur(new BID(BlockLegacyIds::PURPUR_BLOCK), "Purpur Block"));
self::register(new class(new BID(BlockLegacyIds::PURPUR_BLOCK, 2), "Purpur Pillar") extends Purpur{
use PillarRotationTrait;
});
self::register(new PurpurStairs(new BID(BlockIds::PURPUR_STAIRS), "Purpur Stairs"));
self::register(new Quartz(new BID(BlockIds::QUARTZ_BLOCK, Quartz::NORMAL), "Quartz Block"));
self::register(new class(new BID(BlockIds::QUARTZ_BLOCK, Quartz::CHISELED), "Chiseled Quartz Block") extends Quartz{
self::register(new PurpurStairs(new BID(BlockLegacyIds::PURPUR_STAIRS), "Purpur Stairs"));
self::register(new Quartz(new BID(BlockLegacyIds::QUARTZ_BLOCK, Quartz::NORMAL), "Quartz Block"));
self::register(new class(new BID(BlockLegacyIds::QUARTZ_BLOCK, Quartz::CHISELED), "Chiseled Quartz Block") extends Quartz{
use PillarRotationTrait;
});
self::register(new class(new BID(BlockIds::QUARTZ_BLOCK, Quartz::PILLAR), "Quartz Pillar") extends Quartz{
self::register(new class(new BID(BlockLegacyIds::QUARTZ_BLOCK, Quartz::PILLAR), "Quartz Pillar") extends Quartz{
use PillarRotationTrait;
});
self::register(new Quartz(new BID(BlockIds::QUARTZ_BLOCK, Quartz::SMOOTH), "Smooth Quartz Block")); //TODO: this has axis rotation in 1.9, unsure if a bug (https://bugs.mojang.com/browse/MCPE-39074)
self::register(new QuartzStairs(new BID(BlockIds::QUARTZ_STAIRS), "Quartz Stairs"));
self::register(new Rail(new BID(BlockIds::RAIL), "Rail"));
self::register(new RedMushroom(new BID(BlockIds::RED_MUSHROOM), "Red Mushroom"));
self::register(new RedMushroomBlock(new BID(BlockIds::RED_MUSHROOM_BLOCK), "Red Mushroom Block"));
self::register(new Redstone(new BID(BlockIds::REDSTONE_BLOCK), "Redstone Block"));
self::register(new RedstoneComparator(new BlockIdentifierFlattened(BlockIds::UNPOWERED_COMPARATOR, BlockIds::POWERED_COMPARATOR, 0, ItemIds::COMPARATOR, Comparator::class), "Redstone Comparator"));
self::register(new RedstoneLamp(new BlockIdentifierFlattened(BlockIds::REDSTONE_LAMP, BlockIds::LIT_REDSTONE_LAMP), "Redstone Lamp"));
self::register(new RedstoneOre(new BlockIdentifierFlattened(BlockIds::REDSTONE_ORE, BlockIds::LIT_REDSTONE_ORE), "Redstone Ore"));
self::register(new RedstoneRepeater(new BlockIdentifierFlattened(BlockIds::UNPOWERED_REPEATER, BlockIds::POWERED_REPEATER, 0, ItemIds::REPEATER), "Redstone Repeater"));
self::register(new RedstoneTorch(new BlockIdentifierFlattened(BlockIds::REDSTONE_TORCH, BlockIds::UNLIT_REDSTONE_TORCH), "Redstone Torch"));
self::register(new RedstoneWire(new BID(BlockIds::REDSTONE_WIRE, 0, ItemIds::REDSTONE), "Redstone"));
self::register(new Reserved6(new BID(BlockIds::RESERVED6), "reserved6"));
self::register(new Sand(new BID(BlockIds::SAND), "Sand"));
self::register(new Sand(new BID(BlockIds::SAND, 1), "Red Sand"));
self::register(new SandstoneStairs(new BID(BlockIds::RED_SANDSTONE_STAIRS), "Red Sandstone Stairs"));
self::register(new SandstoneStairs(new BID(BlockIds::SANDSTONE_STAIRS), "Sandstone Stairs"));
self::register(new SeaLantern(new BID(BlockIds::SEALANTERN), "Sea Lantern"));
self::register(new SeaPickle(new BID(BlockIds::SEA_PICKLE), "Sea Pickle"));
self::register(new Skull(new BID(BlockIds::MOB_HEAD_BLOCK, 0, null, \pocketmine\tile\Skull::class), "Mob Head"));
self::register(new SmoothStone(new BID(BlockIds::STONE, Stone::NORMAL), "Stone"));
self::register(new Snow(new BID(BlockIds::SNOW), "Snow Block"));
self::register(new SnowLayer(new BID(BlockIds::SNOW_LAYER), "Snow Layer"));
self::register(new SoulSand(new BID(BlockIds::SOUL_SAND), "Soul Sand"));
self::register(new Sponge(new BID(BlockIds::SPONGE), "Sponge"));
self::register(new Stone(new BID(BlockIds::STONE, Stone::ANDESITE), "Andesite"));
self::register(new Stone(new BID(BlockIds::STONE, Stone::DIORITE), "Diorite"));
self::register(new Stone(new BID(BlockIds::STONE, Stone::GRANITE), "Granite"));
self::register(new Stone(new BID(BlockIds::STONE, Stone::POLISHED_ANDESITE), "Polished Andesite"));
self::register(new Stone(new BID(BlockIds::STONE, Stone::POLISHED_DIORITE), "Polished Diorite"));
self::register(new Stone(new BID(BlockIds::STONE, Stone::POLISHED_GRANITE), "Polished Granite"));
self::register(new StoneBrickStairs(new BID(BlockIds::STONE_BRICK_STAIRS), "Stone Brick Stairs"));
self::register(new StoneBricks(new BID(BlockIds::STONEBRICK, StoneBricks::CHISELED), "Chiseled Stone Bricks"));
self::register(new StoneBricks(new BID(BlockIds::STONEBRICK, StoneBricks::CRACKED), "Cracked Stone Bricks"));
self::register(new StoneBricks(new BID(BlockIds::STONEBRICK, StoneBricks::MOSSY), "Mossy Stone Bricks"));
self::register(new StoneBricks(new BID(BlockIds::STONEBRICK, StoneBricks::NORMAL), "Stone Bricks"));
self::register(new StoneButton(new BID(BlockIds::STONE_BUTTON), "Stone Button"));
self::register(new StonePressurePlate(new BID(BlockIds::STONE_PRESSURE_PLATE), "Stone Pressure Plate"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB, BlockIds::DOUBLE_STONE_SLAB, 0), "Stone"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB, BlockIds::DOUBLE_STONE_SLAB, 1), "Sandstone"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB, BlockIds::DOUBLE_STONE_SLAB, 2), "Fake Wooden"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB, BlockIds::DOUBLE_STONE_SLAB, 3), "Cobblestone"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB, BlockIds::DOUBLE_STONE_SLAB, 4), "Brick"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB, BlockIds::DOUBLE_STONE_SLAB, 5), "Stone Brick"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB, BlockIds::DOUBLE_STONE_SLAB, 6), "Quartz"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB, BlockIds::DOUBLE_STONE_SLAB, 7), "Nether Brick"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB2, BlockIds::DOUBLE_STONE_SLAB2, 0), "Red Sandstone"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB2, BlockIds::DOUBLE_STONE_SLAB2, 1), "Purpur"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB2, BlockIds::DOUBLE_STONE_SLAB2, 2), "Prismarine"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB2, BlockIds::DOUBLE_STONE_SLAB2, 3), "Dark Prismarine"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB2, BlockIds::DOUBLE_STONE_SLAB2, 4), "Prismarine Bricks"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB2, BlockIds::DOUBLE_STONE_SLAB2, 5), "Mossy Cobblestone"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB2, BlockIds::DOUBLE_STONE_SLAB2, 6), "Smooth Sandstone"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockIds::STONE_SLAB2, BlockIds::DOUBLE_STONE_SLAB2, 7), "Red Nether Brick"));
self::register(new Stonecutter(new BID(BlockIds::STONECUTTER), "Stonecutter"));
self::register(new Sugarcane(new BID(BlockIds::REEDS_BLOCK, 0, ItemIds::REEDS), "Sugarcane"));
self::register(new TNT(new BID(BlockIds::TNT), "TNT"));
self::register(new TallGrass(new BID(BlockIds::TALLGRASS), "Fern"));
self::register(new TallGrass(new BID(BlockIds::TALLGRASS, 1), "Tall Grass"));
self::register(new TallGrass(new BID(BlockIds::TALLGRASS, 2), "Fern"));
self::register(new TallGrass(new BID(BlockIds::TALLGRASS, 3), "Fern"));
self::register(new Torch(new BID(BlockIds::COLORED_TORCH_BP), "Blue Torch"));
self::register(new Torch(new BID(BlockIds::COLORED_TORCH_BP, 8), "Purple Torch"));
self::register(new Torch(new BID(BlockIds::COLORED_TORCH_RG), "Red Torch"));
self::register(new Torch(new BID(BlockIds::COLORED_TORCH_RG, 8), "Green Torch"));
self::register(new Torch(new BID(BlockIds::TORCH), "Torch"));
self::register(new TrappedChest(new BID(BlockIds::TRAPPED_CHEST, 0, null, \pocketmine\tile\Chest::class), "Trapped Chest"));
self::register(new Tripwire(new BID(BlockIds::TRIPWIRE, 0, ItemIds::STRING), "Tripwire"));
self::register(new TripwireHook(new BID(BlockIds::TRIPWIRE_HOOK), "Tripwire Hook"));
self::register(new UnderwaterTorch(new BID(BlockIds::UNDERWATER_TORCH), "Underwater Torch"));
self::register(new Vine(new BID(BlockIds::VINE), "Vines"));
self::register(new Water(new BlockIdentifierFlattened(BlockIds::FLOWING_WATER, BlockIds::STILL_WATER), "Water"));
self::register(new WaterLily(new BID(BlockIds::LILY_PAD), "Lily Pad"));
self::register(new WeightedPressurePlateHeavy(new BID(BlockIds::HEAVY_WEIGHTED_PRESSURE_PLATE), "Weighted Pressure Plate Heavy"));
self::register(new WeightedPressurePlateLight(new BID(BlockIds::LIGHT_WEIGHTED_PRESSURE_PLATE), "Weighted Pressure Plate Light"));
self::register(new Wheat(new BID(BlockIds::WHEAT_BLOCK), "Wheat Block"));
self::register(new Quartz(new BID(BlockLegacyIds::QUARTZ_BLOCK, Quartz::SMOOTH), "Smooth Quartz Block")); //TODO: this has axis rotation in 1.9, unsure if a bug (https://bugs.mojang.com/browse/MCPE-39074)
self::register(new QuartzStairs(new BID(BlockLegacyIds::QUARTZ_STAIRS), "Quartz Stairs"));
self::register(new Rail(new BID(BlockLegacyIds::RAIL), "Rail"));
self::register(new RedMushroom(new BID(BlockLegacyIds::RED_MUSHROOM), "Red Mushroom"));
self::register(new RedMushroomBlock(new BID(BlockLegacyIds::RED_MUSHROOM_BLOCK), "Red Mushroom Block"));
self::register(new Redstone(new BID(BlockLegacyIds::REDSTONE_BLOCK), "Redstone Block"));
self::register(new RedstoneComparator(new BlockIdentifierFlattened(BlockLegacyIds::UNPOWERED_COMPARATOR, BlockLegacyIds::POWERED_COMPARATOR, 0, ItemIds::COMPARATOR, Comparator::class), "Redstone Comparator"));
self::register(new RedstoneLamp(new BlockIdentifierFlattened(BlockLegacyIds::REDSTONE_LAMP, BlockLegacyIds::LIT_REDSTONE_LAMP), "Redstone Lamp"));
self::register(new RedstoneOre(new BlockIdentifierFlattened(BlockLegacyIds::REDSTONE_ORE, BlockLegacyIds::LIT_REDSTONE_ORE), "Redstone Ore"));
self::register(new RedstoneRepeater(new BlockIdentifierFlattened(BlockLegacyIds::UNPOWERED_REPEATER, BlockLegacyIds::POWERED_REPEATER, 0, ItemIds::REPEATER), "Redstone Repeater"));
self::register(new RedstoneTorch(new BlockIdentifierFlattened(BlockLegacyIds::REDSTONE_TORCH, BlockLegacyIds::UNLIT_REDSTONE_TORCH), "Redstone Torch"));
self::register(new RedstoneWire(new BID(BlockLegacyIds::REDSTONE_WIRE, 0, ItemIds::REDSTONE), "Redstone"));
self::register(new Reserved6(new BID(BlockLegacyIds::RESERVED6), "reserved6"));
self::register(new Sand(new BID(BlockLegacyIds::SAND), "Sand"));
self::register(new Sand(new BID(BlockLegacyIds::SAND, 1), "Red Sand"));
self::register(new SandstoneStairs(new BID(BlockLegacyIds::RED_SANDSTONE_STAIRS), "Red Sandstone Stairs"));
self::register(new SandstoneStairs(new BID(BlockLegacyIds::SANDSTONE_STAIRS), "Sandstone Stairs"));
self::register(new SeaLantern(new BID(BlockLegacyIds::SEALANTERN), "Sea Lantern"));
self::register(new SeaPickle(new BID(BlockLegacyIds::SEA_PICKLE), "Sea Pickle"));
self::register(new Skull(new BID(BlockLegacyIds::MOB_HEAD_BLOCK, 0, null, \pocketmine\tile\Skull::class), "Mob Head"));
self::register(new SmoothStone(new BID(BlockLegacyIds::STONE, Stone::NORMAL), "Stone"));
self::register(new Snow(new BID(BlockLegacyIds::SNOW), "Snow Block"));
self::register(new SnowLayer(new BID(BlockLegacyIds::SNOW_LAYER), "Snow Layer"));
self::register(new SoulSand(new BID(BlockLegacyIds::SOUL_SAND), "Soul Sand"));
self::register(new Sponge(new BID(BlockLegacyIds::SPONGE), "Sponge"));
self::register(new Stone(new BID(BlockLegacyIds::STONE, Stone::ANDESITE), "Andesite"));
self::register(new Stone(new BID(BlockLegacyIds::STONE, Stone::DIORITE), "Diorite"));
self::register(new Stone(new BID(BlockLegacyIds::STONE, Stone::GRANITE), "Granite"));
self::register(new Stone(new BID(BlockLegacyIds::STONE, Stone::POLISHED_ANDESITE), "Polished Andesite"));
self::register(new Stone(new BID(BlockLegacyIds::STONE, Stone::POLISHED_DIORITE), "Polished Diorite"));
self::register(new Stone(new BID(BlockLegacyIds::STONE, Stone::POLISHED_GRANITE), "Polished Granite"));
self::register(new StoneBrickStairs(new BID(BlockLegacyIds::STONE_BRICK_STAIRS), "Stone Brick Stairs"));
self::register(new StoneBricks(new BID(BlockLegacyIds::STONEBRICK, StoneBricks::CHISELED), "Chiseled Stone Bricks"));
self::register(new StoneBricks(new BID(BlockLegacyIds::STONEBRICK, StoneBricks::CRACKED), "Cracked Stone Bricks"));
self::register(new StoneBricks(new BID(BlockLegacyIds::STONEBRICK, StoneBricks::MOSSY), "Mossy Stone Bricks"));
self::register(new StoneBricks(new BID(BlockLegacyIds::STONEBRICK, StoneBricks::NORMAL), "Stone Bricks"));
self::register(new StoneButton(new BID(BlockLegacyIds::STONE_BUTTON), "Stone Button"));
self::register(new StonePressurePlate(new BID(BlockLegacyIds::STONE_PRESSURE_PLATE), "Stone Pressure Plate"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB, BlockLegacyIds::DOUBLE_STONE_SLAB, 0), "Stone"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB, BlockLegacyIds::DOUBLE_STONE_SLAB, 1), "Sandstone"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB, BlockLegacyIds::DOUBLE_STONE_SLAB, 2), "Fake Wooden"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB, BlockLegacyIds::DOUBLE_STONE_SLAB, 3), "Cobblestone"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB, BlockLegacyIds::DOUBLE_STONE_SLAB, 4), "Brick"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB, BlockLegacyIds::DOUBLE_STONE_SLAB, 5), "Stone Brick"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB, BlockLegacyIds::DOUBLE_STONE_SLAB, 6), "Quartz"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB, BlockLegacyIds::DOUBLE_STONE_SLAB, 7), "Nether Brick"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB2, BlockLegacyIds::DOUBLE_STONE_SLAB2, 0), "Red Sandstone"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB2, BlockLegacyIds::DOUBLE_STONE_SLAB2, 1), "Purpur"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB2, BlockLegacyIds::DOUBLE_STONE_SLAB2, 2), "Prismarine"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB2, BlockLegacyIds::DOUBLE_STONE_SLAB2, 3), "Dark Prismarine"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB2, BlockLegacyIds::DOUBLE_STONE_SLAB2, 4), "Prismarine Bricks"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB2, BlockLegacyIds::DOUBLE_STONE_SLAB2, 5), "Mossy Cobblestone"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB2, BlockLegacyIds::DOUBLE_STONE_SLAB2, 6), "Smooth Sandstone"));
self::register(new StoneSlab(new BlockIdentifierFlattened(BlockLegacyIds::STONE_SLAB2, BlockLegacyIds::DOUBLE_STONE_SLAB2, 7), "Red Nether Brick"));
self::register(new Stonecutter(new BID(BlockLegacyIds::STONECUTTER), "Stonecutter"));
self::register(new Sugarcane(new BID(BlockLegacyIds::REEDS_BLOCK, 0, ItemIds::REEDS), "Sugarcane"));
self::register(new TNT(new BID(BlockLegacyIds::TNT), "TNT"));
self::register(new TallGrass(new BID(BlockLegacyIds::TALLGRASS), "Fern"));
self::register(new TallGrass(new BID(BlockLegacyIds::TALLGRASS, 1), "Tall Grass"));
self::register(new TallGrass(new BID(BlockLegacyIds::TALLGRASS, 2), "Fern"));
self::register(new TallGrass(new BID(BlockLegacyIds::TALLGRASS, 3), "Fern"));
self::register(new Torch(new BID(BlockLegacyIds::COLORED_TORCH_BP), "Blue Torch"));
self::register(new Torch(new BID(BlockLegacyIds::COLORED_TORCH_BP, 8), "Purple Torch"));
self::register(new Torch(new BID(BlockLegacyIds::COLORED_TORCH_RG), "Red Torch"));
self::register(new Torch(new BID(BlockLegacyIds::COLORED_TORCH_RG, 8), "Green Torch"));
self::register(new Torch(new BID(BlockLegacyIds::TORCH), "Torch"));
self::register(new TrappedChest(new BID(BlockLegacyIds::TRAPPED_CHEST, 0, null, \pocketmine\tile\Chest::class), "Trapped Chest"));
self::register(new Tripwire(new BID(BlockLegacyIds::TRIPWIRE, 0, ItemIds::STRING), "Tripwire"));
self::register(new TripwireHook(new BID(BlockLegacyIds::TRIPWIRE_HOOK), "Tripwire Hook"));
self::register(new UnderwaterTorch(new BID(BlockLegacyIds::UNDERWATER_TORCH), "Underwater Torch"));
self::register(new Vine(new BID(BlockLegacyIds::VINE), "Vines"));
self::register(new Water(new BlockIdentifierFlattened(BlockLegacyIds::FLOWING_WATER, BlockLegacyIds::STILL_WATER), "Water"));
self::register(new WaterLily(new BID(BlockLegacyIds::LILY_PAD), "Lily Pad"));
self::register(new WeightedPressurePlateHeavy(new BID(BlockLegacyIds::HEAVY_WEIGHTED_PRESSURE_PLATE), "Weighted Pressure Plate Heavy"));
self::register(new WeightedPressurePlateLight(new BID(BlockLegacyIds::LIGHT_WEIGHTED_PRESSURE_PLATE), "Weighted Pressure Plate Light"));
self::register(new Wheat(new BID(BlockLegacyIds::WHEAT_BLOCK), "Wheat Block"));
/** @var int[]|\SplObjectStorage $woodenStairIds */
$woodenStairIds = new \SplObjectStorage();
$woodenStairIds[TreeType::OAK()] = BlockIds::OAK_STAIRS;
$woodenStairIds[TreeType::SPRUCE()] = BlockIds::SPRUCE_STAIRS;
$woodenStairIds[TreeType::BIRCH()] = BlockIds::BIRCH_STAIRS;
$woodenStairIds[TreeType::JUNGLE()] = BlockIds::JUNGLE_STAIRS;
$woodenStairIds[TreeType::ACACIA()] = BlockIds::ACACIA_STAIRS;
$woodenStairIds[TreeType::DARK_OAK()] = BlockIds::DARK_OAK_STAIRS;
$woodenStairIds[TreeType::OAK()] = BlockLegacyIds::OAK_STAIRS;
$woodenStairIds[TreeType::SPRUCE()] = BlockLegacyIds::SPRUCE_STAIRS;
$woodenStairIds[TreeType::BIRCH()] = BlockLegacyIds::BIRCH_STAIRS;
$woodenStairIds[TreeType::JUNGLE()] = BlockLegacyIds::JUNGLE_STAIRS;
$woodenStairIds[TreeType::ACACIA()] = BlockLegacyIds::ACACIA_STAIRS;
$woodenStairIds[TreeType::DARK_OAK()] = BlockLegacyIds::DARK_OAK_STAIRS;
/** @var int[]|\SplObjectStorage $fenceGateIds */
$fenceGateIds = new \SplObjectStorage();
$fenceGateIds[TreeType::OAK()] = BlockIds::OAK_FENCE_GATE;
$fenceGateIds[TreeType::SPRUCE()] = BlockIds::SPRUCE_FENCE_GATE;
$fenceGateIds[TreeType::BIRCH()] = BlockIds::BIRCH_FENCE_GATE;
$fenceGateIds[TreeType::JUNGLE()] = BlockIds::JUNGLE_FENCE_GATE;
$fenceGateIds[TreeType::ACACIA()] = BlockIds::ACACIA_FENCE_GATE;
$fenceGateIds[TreeType::DARK_OAK()] = BlockIds::DARK_OAK_FENCE_GATE;
$fenceGateIds[TreeType::OAK()] = BlockLegacyIds::OAK_FENCE_GATE;
$fenceGateIds[TreeType::SPRUCE()] = BlockLegacyIds::SPRUCE_FENCE_GATE;
$fenceGateIds[TreeType::BIRCH()] = BlockLegacyIds::BIRCH_FENCE_GATE;
$fenceGateIds[TreeType::JUNGLE()] = BlockLegacyIds::JUNGLE_FENCE_GATE;
$fenceGateIds[TreeType::ACACIA()] = BlockLegacyIds::ACACIA_FENCE_GATE;
$fenceGateIds[TreeType::DARK_OAK()] = BlockLegacyIds::DARK_OAK_FENCE_GATE;
/** @var BID[]|\SplObjectStorage $woodenDoorIds */
$woodenDoorIds = new \SplObjectStorage();
$woodenDoorIds[TreeType::OAK()] = new BID(BlockIds::OAK_DOOR_BLOCK, 0, ItemIds::OAK_DOOR);
$woodenDoorIds[TreeType::SPRUCE()] = new BID(BlockIds::SPRUCE_DOOR_BLOCK, 0, ItemIds::SPRUCE_DOOR);
$woodenDoorIds[TreeType::BIRCH()] = new BID(BlockIds::BIRCH_DOOR_BLOCK, 0, ItemIds::BIRCH_DOOR);
$woodenDoorIds[TreeType::JUNGLE()] = new BID(BlockIds::JUNGLE_DOOR_BLOCK, 0, ItemIds::JUNGLE_DOOR);
$woodenDoorIds[TreeType::ACACIA()] = new BID(BlockIds::ACACIA_DOOR_BLOCK, 0, ItemIds::ACACIA_DOOR);
$woodenDoorIds[TreeType::DARK_OAK()] = new BID(BlockIds::DARK_OAK_DOOR_BLOCK, 0, ItemIds::DARK_OAK_DOOR);
$woodenDoorIds[TreeType::OAK()] = new BID(BlockLegacyIds::OAK_DOOR_BLOCK, 0, ItemIds::OAK_DOOR);
$woodenDoorIds[TreeType::SPRUCE()] = new BID(BlockLegacyIds::SPRUCE_DOOR_BLOCK, 0, ItemIds::SPRUCE_DOOR);
$woodenDoorIds[TreeType::BIRCH()] = new BID(BlockLegacyIds::BIRCH_DOOR_BLOCK, 0, ItemIds::BIRCH_DOOR);
$woodenDoorIds[TreeType::JUNGLE()] = new BID(BlockLegacyIds::JUNGLE_DOOR_BLOCK, 0, ItemIds::JUNGLE_DOOR);
$woodenDoorIds[TreeType::ACACIA()] = new BID(BlockLegacyIds::ACACIA_DOOR_BLOCK, 0, ItemIds::ACACIA_DOOR);
$woodenDoorIds[TreeType::DARK_OAK()] = new BID(BlockLegacyIds::DARK_OAK_DOOR_BLOCK, 0, ItemIds::DARK_OAK_DOOR);
/** @var int[]|\SplObjectStorage $woodenPressurePlateIds */
$woodenPressurePlateIds = new \SplObjectStorage();
$woodenPressurePlateIds[TreeType::OAK()] = BlockIds::WOODEN_PRESSURE_PLATE;
$woodenPressurePlateIds[TreeType::SPRUCE()] = BlockIds::SPRUCE_PRESSURE_PLATE;
$woodenPressurePlateIds[TreeType::BIRCH()] = BlockIds::BIRCH_PRESSURE_PLATE;
$woodenPressurePlateIds[TreeType::JUNGLE()] = BlockIds::JUNGLE_PRESSURE_PLATE;
$woodenPressurePlateIds[TreeType::ACACIA()] = BlockIds::ACACIA_PRESSURE_PLATE;
$woodenPressurePlateIds[TreeType::DARK_OAK()] = BlockIds::DARK_OAK_PRESSURE_PLATE;
$woodenPressurePlateIds[TreeType::OAK()] = BlockLegacyIds::WOODEN_PRESSURE_PLATE;
$woodenPressurePlateIds[TreeType::SPRUCE()] = BlockLegacyIds::SPRUCE_PRESSURE_PLATE;
$woodenPressurePlateIds[TreeType::BIRCH()] = BlockLegacyIds::BIRCH_PRESSURE_PLATE;
$woodenPressurePlateIds[TreeType::JUNGLE()] = BlockLegacyIds::JUNGLE_PRESSURE_PLATE;
$woodenPressurePlateIds[TreeType::ACACIA()] = BlockLegacyIds::ACACIA_PRESSURE_PLATE;
$woodenPressurePlateIds[TreeType::DARK_OAK()] = BlockLegacyIds::DARK_OAK_PRESSURE_PLATE;
/** @var int[]|\SplObjectStorage $woodenButtonIds */
$woodenButtonIds = new \SplObjectStorage();
$woodenButtonIds[TreeType::OAK()] = BlockIds::WOODEN_BUTTON;
$woodenButtonIds[TreeType::SPRUCE()] = BlockIds::SPRUCE_BUTTON;
$woodenButtonIds[TreeType::BIRCH()] = BlockIds::BIRCH_BUTTON;
$woodenButtonIds[TreeType::JUNGLE()] = BlockIds::JUNGLE_BUTTON;
$woodenButtonIds[TreeType::ACACIA()] = BlockIds::ACACIA_BUTTON;
$woodenButtonIds[TreeType::DARK_OAK()] = BlockIds::DARK_OAK_BUTTON;
$woodenButtonIds[TreeType::OAK()] = BlockLegacyIds::WOODEN_BUTTON;
$woodenButtonIds[TreeType::SPRUCE()] = BlockLegacyIds::SPRUCE_BUTTON;
$woodenButtonIds[TreeType::BIRCH()] = BlockLegacyIds::BIRCH_BUTTON;
$woodenButtonIds[TreeType::JUNGLE()] = BlockLegacyIds::JUNGLE_BUTTON;
$woodenButtonIds[TreeType::ACACIA()] = BlockLegacyIds::ACACIA_BUTTON;
$woodenButtonIds[TreeType::DARK_OAK()] = BlockLegacyIds::DARK_OAK_BUTTON;
/** @var int[]|\SplObjectStorage $woodenTrapdoorIds */
$woodenTrapdoorIds = new \SplObjectStorage();
$woodenTrapdoorIds[TreeType::OAK()] = BlockIds::WOODEN_TRAPDOOR;
$woodenTrapdoorIds[TreeType::SPRUCE()] = BlockIds::SPRUCE_TRAPDOOR;
$woodenTrapdoorIds[TreeType::BIRCH()] = BlockIds::BIRCH_TRAPDOOR;
$woodenTrapdoorIds[TreeType::JUNGLE()] = BlockIds::JUNGLE_TRAPDOOR;
$woodenTrapdoorIds[TreeType::ACACIA()] = BlockIds::ACACIA_TRAPDOOR;
$woodenTrapdoorIds[TreeType::DARK_OAK()] = BlockIds::DARK_OAK_TRAPDOOR;
$woodenTrapdoorIds[TreeType::OAK()] = BlockLegacyIds::WOODEN_TRAPDOOR;
$woodenTrapdoorIds[TreeType::SPRUCE()] = BlockLegacyIds::SPRUCE_TRAPDOOR;
$woodenTrapdoorIds[TreeType::BIRCH()] = BlockLegacyIds::BIRCH_TRAPDOOR;
$woodenTrapdoorIds[TreeType::JUNGLE()] = BlockLegacyIds::JUNGLE_TRAPDOOR;
$woodenTrapdoorIds[TreeType::ACACIA()] = BlockLegacyIds::ACACIA_TRAPDOOR;
$woodenTrapdoorIds[TreeType::DARK_OAK()] = BlockLegacyIds::DARK_OAK_TRAPDOOR;
/** @var BlockIdentifierFlattened[]|\SplObjectStorage $woodenSignIds */
$woodenSignIds = new \SplObjectStorage();
$woodenSignIds[TreeType::OAK()] = new BlockIdentifierFlattened(BlockIds::SIGN_POST, BlockIds::WALL_SIGN, 0, ItemIds::SIGN, \pocketmine\tile\Sign::class);
$woodenSignIds[TreeType::SPRUCE()] = new BlockIdentifierFlattened(BlockIds::SPRUCE_STANDING_SIGN, BlockIds::SPRUCE_WALL_SIGN, 0, ItemIds::SPRUCE_SIGN, \pocketmine\tile\Sign::class);
$woodenSignIds[TreeType::BIRCH()] = new BlockIdentifierFlattened(BlockIds::BIRCH_STANDING_SIGN, BlockIds::BIRCH_WALL_SIGN, 0, ItemIds::BIRCH_SIGN, \pocketmine\tile\Sign::class);
$woodenSignIds[TreeType::JUNGLE()] = new BlockIdentifierFlattened(BlockIds::JUNGLE_STANDING_SIGN, BlockIds::JUNGLE_WALL_SIGN, 0, ItemIds::JUNGLE_SIGN, \pocketmine\tile\Sign::class);
$woodenSignIds[TreeType::ACACIA()] = new BlockIdentifierFlattened(BlockIds::ACACIA_STANDING_SIGN, BlockIds::ACACIA_WALL_SIGN, 0, ItemIds::ACACIA_SIGN, \pocketmine\tile\Sign::class);
$woodenSignIds[TreeType::DARK_OAK()] = new BlockIdentifierFlattened(BlockIds::DARKOAK_STANDING_SIGN, BlockIds::DARKOAK_WALL_SIGN, 0, ItemIds::DARKOAK_SIGN, \pocketmine\tile\Sign::class);
$woodenSignIds[TreeType::OAK()] = new BlockIdentifierFlattened(BlockLegacyIds::SIGN_POST, BlockLegacyIds::WALL_SIGN, 0, ItemIds::SIGN, \pocketmine\tile\Sign::class);
$woodenSignIds[TreeType::SPRUCE()] = new BlockIdentifierFlattened(BlockLegacyIds::SPRUCE_STANDING_SIGN, BlockLegacyIds::SPRUCE_WALL_SIGN, 0, ItemIds::SPRUCE_SIGN, \pocketmine\tile\Sign::class);
$woodenSignIds[TreeType::BIRCH()] = new BlockIdentifierFlattened(BlockLegacyIds::BIRCH_STANDING_SIGN, BlockLegacyIds::BIRCH_WALL_SIGN, 0, ItemIds::BIRCH_SIGN, \pocketmine\tile\Sign::class);
$woodenSignIds[TreeType::JUNGLE()] = new BlockIdentifierFlattened(BlockLegacyIds::JUNGLE_STANDING_SIGN, BlockLegacyIds::JUNGLE_WALL_SIGN, 0, ItemIds::JUNGLE_SIGN, \pocketmine\tile\Sign::class);
$woodenSignIds[TreeType::ACACIA()] = new BlockIdentifierFlattened(BlockLegacyIds::ACACIA_STANDING_SIGN, BlockLegacyIds::ACACIA_WALL_SIGN, 0, ItemIds::ACACIA_SIGN, \pocketmine\tile\Sign::class);
$woodenSignIds[TreeType::DARK_OAK()] = new BlockIdentifierFlattened(BlockLegacyIds::DARKOAK_STANDING_SIGN, BlockLegacyIds::DARKOAK_WALL_SIGN, 0, ItemIds::DARKOAK_SIGN, \pocketmine\tile\Sign::class);
foreach(TreeType::getAll() as $treeType){
$magicNumber = $treeType->getMagicNumber();
$name = $treeType->getDisplayName();
self::register(new Planks(new BID(BlockIds::PLANKS, $magicNumber), $name . " Planks"));
self::register(new Sapling(new BID(BlockIds::SAPLING, $magicNumber), $name . " Sapling", $treeType));
self::register(new WoodenFence(new BID(BlockIds::FENCE, $magicNumber), $name . " Fence"));
self::register(new WoodenSlab(new BlockIdentifierFlattened(BlockIds::WOODEN_SLAB, BlockIds::DOUBLE_WOODEN_SLAB, $treeType->getMagicNumber()), $treeType->getDisplayName()));
self::register(new Planks(new BID(BlockLegacyIds::PLANKS, $magicNumber), $name . " Planks"));
self::register(new Sapling(new BID(BlockLegacyIds::SAPLING, $magicNumber), $name . " Sapling", $treeType));
self::register(new WoodenFence(new BID(BlockLegacyIds::FENCE, $magicNumber), $name . " Fence"));
self::register(new WoodenSlab(new BlockIdentifierFlattened(BlockLegacyIds::WOODEN_SLAB, BlockLegacyIds::DOUBLE_WOODEN_SLAB, $treeType->getMagicNumber()), $treeType->getDisplayName()));
//TODO: find a better way to deal with this split
self::register(new Leaves(new BID($magicNumber >= 4 ? BlockIds::LEAVES2 : BlockIds::LEAVES, $magicNumber & 0x03), $name . " Leaves", $treeType));
self::register(new Log(new BID($magicNumber >= 4 ? BlockIds::LOG2 : BlockIds::LOG, $magicNumber & 0x03), $name . " Log", $treeType));
self::register(new Leaves(new BID($magicNumber >= 4 ? BlockLegacyIds::LEAVES2 : BlockLegacyIds::LEAVES, $magicNumber & 0x03), $name . " Leaves", $treeType));
self::register(new Log(new BID($magicNumber >= 4 ? BlockLegacyIds::LOG2 : BlockLegacyIds::LOG, $magicNumber & 0x03), $name . " Log", $treeType));
//TODO: the old bug-block needs to be remapped to the new dedicated block
self::register(new Wood(new BID($magicNumber >= 4 ? BlockIds::LOG2 : BlockIds::LOG, ($magicNumber & 0x03) | 0b1100), $name . " Wood", $treeType));
self::register(new Wood(new BID(BlockIds::WOOD, $magicNumber), $name . " Wood", $treeType));
self::register(new Wood(new BID($magicNumber >= 4 ? BlockLegacyIds::LOG2 : BlockLegacyIds::LOG, ($magicNumber & 0x03) | 0b1100), $name . " Wood", $treeType));
self::register(new Wood(new BID(BlockLegacyIds::WOOD, $magicNumber), $name . " Wood", $treeType));
self::register(new FenceGate(new BID($fenceGateIds[$treeType]), $treeType->getDisplayName() . " Fence Gate"));
self::register(new WoodenStairs(new BID($woodenStairIds[$treeType]), $treeType->getDisplayName() . " Stairs"));
@ -416,40 +416,40 @@ class BlockFactory{
Sandstone::SMOOTH => "Smooth "
];
foreach($sandstoneTypes as $variant => $prefix){
self::register(new Sandstone(new BID(BlockIds::SANDSTONE, $variant), $prefix . "Sandstone"));
self::register(new Sandstone(new BID(BlockIds::RED_SANDSTONE, $variant), $prefix . "Red Sandstone"));
self::register(new Sandstone(new BID(BlockLegacyIds::SANDSTONE, $variant), $prefix . "Sandstone"));
self::register(new Sandstone(new BID(BlockLegacyIds::RED_SANDSTONE, $variant), $prefix . "Red Sandstone"));
}
/** @var int[]|\SplObjectStorage $glazedTerracottaIds */
$glazedTerracottaIds = new \SplObjectStorage();
$glazedTerracottaIds[DyeColor::WHITE()] = BlockIds::WHITE_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::ORANGE()] = BlockIds::ORANGE_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::MAGENTA()] = BlockIds::MAGENTA_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::LIGHT_BLUE()] = BlockIds::LIGHT_BLUE_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::YELLOW()] = BlockIds::YELLOW_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::LIME()] = BlockIds::LIME_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::PINK()] = BlockIds::PINK_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::GRAY()] = BlockIds::GRAY_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::LIGHT_GRAY()] = BlockIds::SILVER_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::CYAN()] = BlockIds::CYAN_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::PURPLE()] = BlockIds::PURPLE_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::BLUE()] = BlockIds::BLUE_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::BROWN()] = BlockIds::BROWN_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::GREEN()] = BlockIds::GREEN_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::RED()] = BlockIds::RED_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::BLACK()] = BlockIds::BLACK_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::WHITE()] = BlockLegacyIds::WHITE_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::ORANGE()] = BlockLegacyIds::ORANGE_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::MAGENTA()] = BlockLegacyIds::MAGENTA_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::LIGHT_BLUE()] = BlockLegacyIds::LIGHT_BLUE_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::YELLOW()] = BlockLegacyIds::YELLOW_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::LIME()] = BlockLegacyIds::LIME_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::PINK()] = BlockLegacyIds::PINK_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::GRAY()] = BlockLegacyIds::GRAY_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::LIGHT_GRAY()] = BlockLegacyIds::SILVER_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::CYAN()] = BlockLegacyIds::CYAN_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::PURPLE()] = BlockLegacyIds::PURPLE_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::BLUE()] = BlockLegacyIds::BLUE_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::BROWN()] = BlockLegacyIds::BROWN_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::GREEN()] = BlockLegacyIds::GREEN_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::RED()] = BlockLegacyIds::RED_GLAZED_TERRACOTTA;
$glazedTerracottaIds[DyeColor::BLACK()] = BlockLegacyIds::BLACK_GLAZED_TERRACOTTA;
foreach(DyeColor::getAll() as $color){
self::register(new Carpet(new BID(BlockIds::CARPET, $color->getMagicNumber()), $color->getDisplayName() . " Carpet"));
self::register(new Concrete(new BID(BlockIds::CONCRETE, $color->getMagicNumber()), $color->getDisplayName() . " Concrete"));
self::register(new ConcretePowder(new BID(BlockIds::CONCRETE_POWDER, $color->getMagicNumber()), $color->getDisplayName() . " Concrete Powder"));
self::register(new Glass(new BID(BlockIds::STAINED_GLASS, $color->getMagicNumber()), $color->getDisplayName() . " Stained Glass"));
self::register(new GlassPane(new BID(BlockIds::STAINED_GLASS_PANE, $color->getMagicNumber()), $color->getDisplayName() . " Stained Glass Pane"));
self::register(new Carpet(new BID(BlockLegacyIds::CARPET, $color->getMagicNumber()), $color->getDisplayName() . " Carpet"));
self::register(new Concrete(new BID(BlockLegacyIds::CONCRETE, $color->getMagicNumber()), $color->getDisplayName() . " Concrete"));
self::register(new ConcretePowder(new BID(BlockLegacyIds::CONCRETE_POWDER, $color->getMagicNumber()), $color->getDisplayName() . " Concrete Powder"));
self::register(new Glass(new BID(BlockLegacyIds::STAINED_GLASS, $color->getMagicNumber()), $color->getDisplayName() . " Stained Glass"));
self::register(new GlassPane(new BID(BlockLegacyIds::STAINED_GLASS_PANE, $color->getMagicNumber()), $color->getDisplayName() . " Stained Glass Pane"));
self::register(new GlazedTerracotta(new BID($glazedTerracottaIds[$color]), $color->getDisplayName() . " Glazed Terracotta"));
self::register(new HardenedClay(new BID(BlockIds::STAINED_CLAY, $color->getMagicNumber()), $color->getDisplayName() . " Stained Clay"));
self::register(new HardenedGlass(new BID(BlockIds::HARD_STAINED_GLASS, $color->getMagicNumber()), "Hardened " . $color->getDisplayName() . " Stained Glass"));
self::register(new HardenedGlassPane(new BID(BlockIds::HARD_STAINED_GLASS_PANE, $color->getMagicNumber()), "Hardened " . $color->getDisplayName() . " Stained Glass Pane"));
self::register(new Wool(new BID(BlockIds::WOOL, $color->getMagicNumber()), $color->getDisplayName() . " Wool"));
self::register(new HardenedClay(new BID(BlockLegacyIds::STAINED_CLAY, $color->getMagicNumber()), $color->getDisplayName() . " Stained Clay"));
self::register(new HardenedGlass(new BID(BlockLegacyIds::HARD_STAINED_GLASS, $color->getMagicNumber()), "Hardened " . $color->getDisplayName() . " Stained Glass"));
self::register(new HardenedGlassPane(new BID(BlockLegacyIds::HARD_STAINED_GLASS_PANE, $color->getMagicNumber()), "Hardened " . $color->getDisplayName() . " Stained Glass Pane"));
self::register(new Wool(new BID(BlockLegacyIds::WOOL, $color->getMagicNumber()), $color->getDisplayName() . " Wool"));
}
static $wallTypes = [
@ -469,7 +469,7 @@ class BlockFactory{
CobblestoneWall::STONE_BRICK_WALL => "Stone Brick"
];
foreach($wallTypes as $magicNumber => $prefix){
self::register(new CobblestoneWall(new BID(BlockIds::COBBLESTONE_WALL, $magicNumber), $prefix . " Wall"));
self::register(new CobblestoneWall(new BID(BlockLegacyIds::COBBLESTONE_WALL, $magicNumber), $prefix . " Wall"));
}
//TODO: minecraft:andesite_stairs
@ -707,7 +707,7 @@ class BlockFactory{
* if not found, try id+0 (strip meta)
* if still not found, return update! block
*/
return self::$staticRuntimeIdMap[($id << 4) | $meta] ?? self::$staticRuntimeIdMap[$id << 4] ?? self::$staticRuntimeIdMap[BlockIds::INFO_UPDATE << 4];
return self::$staticRuntimeIdMap[($id << 4) | $meta] ?? self::$staticRuntimeIdMap[$id << 4] ?? self::$staticRuntimeIdMap[BlockLegacyIds::INFO_UPDATE << 4];
}
/**

View File

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\block;
interface BlockIds{
interface BlockLegacyIds{
public const AIR = 0;
public const STONE = 1;

View File

@ -71,7 +71,7 @@ class Cactus extends Transparent{
public function onNearbyBlockChange() : void{
$down = $this->getSide(Facing::DOWN);
if($down->getId() !== BlockIds::SAND and $down->getId() !== BlockIds::CACTUS){
if($down->getId() !== BlockLegacyIds::SAND and $down->getId() !== BlockLegacyIds::CACTUS){
$this->getLevel()->useBreakOn($this);
}else{
foreach(Facing::HORIZONTAL as $side){
@ -89,12 +89,12 @@ class Cactus extends Transparent{
}
public function onRandomTick() : void{
if($this->getSide(Facing::DOWN)->getId() !== BlockIds::CACTUS){
if($this->getSide(Facing::DOWN)->getId() !== BlockLegacyIds::CACTUS){
if($this->age === 15){
for($y = 1; $y < 3; ++$y){
$b = $this->getLevel()->getBlockAt($this->x, $this->y + $y, $this->z);
if($b->getId() === BlockIds::AIR){
$ev = new BlockGrowEvent($b, BlockFactory::get(BlockIds::CACTUS));
if($b->getId() === BlockLegacyIds::AIR){
$ev = new BlockGrowEvent($b, BlockFactory::get(BlockLegacyIds::CACTUS));
$ev->call();
if($ev->isCancelled()){
break;
@ -115,7 +115,7 @@ class Cactus extends Transparent{
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN);
if($down->getId() === BlockIds::SAND or $down->getId() === BlockIds::CACTUS){
if($down->getId() === BlockLegacyIds::SAND or $down->getId() === BlockLegacyIds::CACTUS){
foreach(Facing::HORIZONTAL as $side){
if($this->getSide($side)->isSolid()){
return false;

View File

@ -63,7 +63,7 @@ class Cake extends Transparent implements FoodSource{
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN);
if($down->getId() !== BlockIds::AIR){
if($down->getId() !== BlockLegacyIds::AIR){
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}
@ -71,8 +71,8 @@ class Cake extends Transparent implements FoodSource{
}
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::DOWN)->getId() === BlockIds::AIR){ //Replace with common break method
$this->getLevel()->setBlock($this, BlockFactory::get(BlockIds::AIR));
if($this->getSide(Facing::DOWN)->getId() === BlockLegacyIds::AIR){ //Replace with common break method
$this->getLevel()->setBlock($this, BlockFactory::get(BlockLegacyIds::AIR));
}
}
@ -112,7 +112,7 @@ class Cake extends Transparent implements FoodSource{
$clone = clone $this;
$clone->bites++;
if($clone->bites > 6){
$clone = BlockFactory::get(BlockIds::AIR);
$clone = BlockFactory::get(BlockLegacyIds::AIR);
}
return $clone;
}

View File

@ -45,7 +45,7 @@ class Carpet extends Flowable{
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN);
if($down->getId() !== BlockIds::AIR){
if($down->getId() !== BlockLegacyIds::AIR){
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}
@ -53,7 +53,7 @@ class Carpet extends Flowable{
}
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::DOWN)->getId() === BlockIds::AIR){
if($this->getSide(Facing::DOWN)->getId() === BlockLegacyIds::AIR){
$this->getLevel()->useBreakOn($this);
}
}

View File

@ -34,7 +34,7 @@ class CoarseDirt extends Dirt{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($face === Facing::UP and $item instanceof Hoe){
$item->applyDamage(1);
$this->getLevel()->setBlock($this, BlockFactory::get(BlockIds::DIRT));
$this->getLevel()->setBlock($this, BlockFactory::get(BlockLegacyIds::DIRT));
return true;
}

View File

@ -72,7 +72,7 @@ class CobblestoneWall extends Transparent{
}
}
$this->up = $this->getSide(Facing::UP)->getId() !== BlockIds::AIR;
$this->up = $this->getSide(Facing::UP)->getId() !== BlockLegacyIds::AIR;
}
protected function recalculateBoundingBox() : ?AxisAlignedBB{

View File

@ -64,7 +64,7 @@ class ConcretePowder extends Solid implements Fallable{
continue;
}
if($this->getSide($i) instanceof Water){
return BlockFactory::get(BlockIds::CONCRETE, $this->idInfo->getVariant());
return BlockFactory::get(BlockLegacyIds::CONCRETE, $this->idInfo->getVariant());
}
}

View File

@ -49,7 +49,7 @@ abstract class Crops extends Flowable{
}
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($blockReplace->getSide(Facing::DOWN)->getId() === BlockIds::FARMLAND){
if($blockReplace->getSide(Facing::DOWN)->getId() === BlockLegacyIds::FARMLAND){
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}
@ -80,7 +80,7 @@ abstract class Crops extends Flowable{
}
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::DOWN)->getId() !== BlockIds::FARMLAND){
if($this->getSide(Facing::DOWN)->getId() !== BlockLegacyIds::FARMLAND){
$this->getLevel()->useBreakOn($this);
}
}

View File

@ -33,7 +33,7 @@ class Dandelion extends Flowable{
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN);
if($down->getId() === BlockIds::GRASS or $down->getId() === BlockIds::DIRT or $down->getId() === BlockIds::FARMLAND){
if($down->getId() === BlockLegacyIds::GRASS or $down->getId() === BlockLegacyIds::DIRT or $down->getId() === BlockLegacyIds::FARMLAND){
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}

View File

@ -44,7 +44,7 @@ class Dirt extends Solid{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($face === Facing::UP and $item instanceof Hoe){
$item->applyDamage(1);
$this->getLevel()->setBlock($this, BlockFactory::get(BlockIds::FARMLAND));
$this->getLevel()->setBlock($this, BlockFactory::get(BlockLegacyIds::FARMLAND));
return true;
}

View File

@ -98,7 +98,7 @@ abstract class Door extends Transparent{
}
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::DOWN)->getId() === BlockIds::AIR){ //Replace with common break method
if($this->getSide(Facing::DOWN)->getId() === BlockLegacyIds::AIR){ //Replace with common break method
$this->getLevel()->useBreakOn($this); //this will delete both halves if they exist
}
}

View File

@ -49,7 +49,7 @@ class DoublePlant extends Flowable{
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$id = $blockReplace->getSide(Facing::DOWN)->getId();
if(($id === BlockIds::GRASS or $id === BlockIds::DIRT) and $blockReplace->getSide(Facing::UP)->canBeReplaced()){
if(($id === BlockLegacyIds::GRASS or $id === BlockLegacyIds::DIRT) and $blockReplace->getSide(Facing::UP)->canBeReplaced()){
$top = clone $this;
$top->top = true;

View File

@ -78,7 +78,7 @@ class DragonEgg extends Transparent implements Fallable{
if($block instanceof Air){
$this->level->addParticle($this, new DragonEggTeleportParticle($this->x - $block->x, $this->y - $block->y, $this->z - $block->z));
//TODO: add events
$this->level->setBlock($this, BlockFactory::get(BlockIds::AIR));
$this->level->setBlock($this, BlockFactory::get(BlockLegacyIds::AIR));
$this->level->setBlock($block, $this);
break;
}

View File

@ -60,7 +60,7 @@ class Farmland extends Transparent{
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::UP)->isSolid()){
$this->level->setBlock($this, BlockFactory::get(BlockIds::DIRT));
$this->level->setBlock($this, BlockFactory::get(BlockLegacyIds::DIRT));
}
}
@ -74,7 +74,7 @@ class Farmland extends Transparent{
$this->wetness--;
$this->level->setBlock($this, $this, false);
}else{
$this->level->setBlock($this, BlockFactory::get(BlockIds::DIRT));
$this->level->setBlock($this, BlockFactory::get(BlockLegacyIds::DIRT));
}
}elseif($this->wetness < 7){
$this->wetness = 7;

View File

@ -88,7 +88,7 @@ class Fire extends Flowable{
public function onNearbyBlockChange() : void{
if(!$this->getSide(Facing::DOWN)->isSolid() and !$this->hasAdjacentFlammableBlocks()){
$this->getLevel()->setBlock($this, BlockFactory::get(BlockIds::AIR));
$this->getLevel()->setBlock($this, BlockFactory::get(BlockLegacyIds::AIR));
}else{
$this->level->scheduleDelayedBlockUpdate($this, mt_rand(30, 40));
}
@ -113,12 +113,12 @@ class Fire extends Flowable{
if($this->age === 15){
if(!$down->isFlammable() and mt_rand(0, 3) === 3){ //1/4 chance to extinguish
$canSpread = false;
$result = BlockFactory::get(BlockIds::AIR);
$result = BlockFactory::get(BlockLegacyIds::AIR);
}
}elseif(!$this->hasAdjacentFlammableBlocks()){
$canSpread = false;
if(!$down->isSolid() or $this->age > 3){
$result = BlockFactory::get(BlockIds::AIR);
$result = BlockFactory::get(BlockLegacyIds::AIR);
}
}
}
@ -170,7 +170,7 @@ class Fire extends Flowable{
$fire->age = min(15, $fire->age + (mt_rand(0, 4) >> 2));
$this->level->setBlock($block, $fire);
}else{
$this->level->setBlock($block, BlockFactory::get(BlockIds::AIR));
$this->level->setBlock($block, BlockFactory::get(BlockLegacyIds::AIR));
}
}
}

View File

@ -43,7 +43,7 @@ class Flower extends Flowable{
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN);
if($down->getId() === BlockIds::GRASS or $down->getId() === BlockIds::DIRT or $down->getId() === BlockIds::FARMLAND){
if($down->getId() === BlockLegacyIds::GRASS or $down->getId() === BlockLegacyIds::DIRT or $down->getId() === BlockLegacyIds::FARMLAND){
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}

View File

@ -60,7 +60,7 @@ class Grass extends Solid{
$lightAbove = $this->level->getFullLightAt($this->x, $this->y + 1, $this->z);
if($lightAbove < 4 and $this->level->getBlockAt($this->x, $this->y + 1, $this->z)->getLightFilter() >= 2){
//grass dies
$ev = new BlockSpreadEvent($this, $this, BlockFactory::get(BlockIds::DIRT));
$ev = new BlockSpreadEvent($this, $this, BlockFactory::get(BlockLegacyIds::DIRT));
$ev->call();
if(!$ev->isCancelled()){
$this->level->setBlock($this, $ev->getNewState(), false);
@ -82,7 +82,7 @@ class Grass extends Solid{
continue;
}
$ev = new BlockSpreadEvent($b, $this, BlockFactory::get(BlockIds::GRASS));
$ev = new BlockSpreadEvent($b, $this, BlockFactory::get(BlockLegacyIds::GRASS));
$ev->call();
if(!$ev->isCancelled()){
$this->level->setBlock($b, $ev->getNewState(), false);
@ -102,12 +102,12 @@ class Grass extends Solid{
return true;
}elseif($item instanceof Hoe){
$item->applyDamage(1);
$this->getLevel()->setBlock($this, BlockFactory::get(BlockIds::FARMLAND));
$this->getLevel()->setBlock($this, BlockFactory::get(BlockLegacyIds::FARMLAND));
return true;
}elseif($item instanceof Shovel and $this->getSide(Facing::UP)->getId() === BlockIds::AIR){
}elseif($item instanceof Shovel and $this->getSide(Facing::UP)->getId() === BlockLegacyIds::AIR){
$item->applyDamage(1);
$this->getLevel()->setBlock($this, BlockFactory::get(BlockIds::GRASS_PATH));
$this->getLevel()->setBlock($this, BlockFactory::get(BlockLegacyIds::GRASS_PATH));
return true;
}

View File

@ -44,7 +44,7 @@ class GrassPath extends Transparent{
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::UP)->isSolid()){
$this->level->setBlock($this, BlockFactory::get(BlockIds::DIRT));
$this->level->setBlock($this, BlockFactory::get(BlockLegacyIds::DIRT));
}
}

View File

@ -47,7 +47,7 @@ class Ice extends Transparent{
public function onBreak(Item $item, ?Player $player = null) : bool{
if(($player === null or $player->isSurvival()) and !$item->hasEnchantment(Enchantment::SILK_TOUCH())){
return $this->getLevel()->setBlock($this, BlockFactory::get(BlockIds::WATER));
return $this->getLevel()->setBlock($this, BlockFactory::get(BlockLegacyIds::WATER));
}
return parent::onBreak($item, $player);
}

View File

@ -67,16 +67,16 @@ class Lava extends Liquid{
if($colliding !== null){
if($this->decay === 0){
$this->liquidCollide($colliding, BlockFactory::get(BlockIds::OBSIDIAN));
$this->liquidCollide($colliding, BlockFactory::get(BlockLegacyIds::OBSIDIAN));
}elseif($this->decay <= 4){
$this->liquidCollide($colliding, BlockFactory::get(BlockIds::COBBLESTONE));
$this->liquidCollide($colliding, BlockFactory::get(BlockLegacyIds::COBBLESTONE));
}
}
}
protected function flowIntoBlock(Block $block, int $newFlowDecay, bool $falling) : void{
if($block instanceof Water){
$block->liquidCollide($this, BlockFactory::get(BlockIds::STONE));
$block->liquidCollide($this, BlockFactory::get(BlockLegacyIds::STONE));
}else{
parent::flowIntoBlock($block, $newFlowDecay, $falling);
}

View File

@ -289,7 +289,7 @@ abstract class Liquid extends Transparent{
if($falling !== $this->falling or (!$falling and $newDecay !== $this->decay)){
if(!$falling and $newDecay < 0){
$this->level->setBlock($this, BlockFactory::get(BlockIds::AIR));
$this->level->setBlock($this, BlockFactory::get(BlockLegacyIds::AIR));
return;
}

View File

@ -26,6 +26,6 @@ namespace pocketmine\block;
class MelonStem extends Stem{
protected function getPlant() : Block{
return BlockFactory::get(BlockIds::MELON_BLOCK);
return BlockFactory::get(BlockLegacyIds::MELON_BLOCK);
}
}

View File

@ -55,9 +55,9 @@ class Mycelium extends Solid{
$y = mt_rand($this->y - 2, $this->y + 2);
$z = mt_rand($this->z - 1, $this->z + 1);
$block = $this->getLevel()->getBlockAt($x, $y, $z);
if($block->getId() === BlockIds::DIRT){
if($block->getId() === BlockLegacyIds::DIRT){
if($block->getSide(Facing::UP) instanceof Transparent){
$ev = new BlockSpreadEvent($block, $this, BlockFactory::get(BlockIds::MYCELIUM));
$ev = new BlockSpreadEvent($block, $this, BlockFactory::get(BlockLegacyIds::MYCELIUM));
$ev->call();
if(!$ev->isCancelled()){
$this->getLevel()->setBlock($block, $ev->getNewState());

View File

@ -51,7 +51,7 @@ class NetherWartPlant extends Flowable{
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN);
if($down->getId() === BlockIds::SOUL_SAND){
if($down->getId() === BlockLegacyIds::SOUL_SAND){
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}
@ -59,7 +59,7 @@ class NetherWartPlant extends Flowable{
}
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::DOWN)->getId() !== BlockIds::SOUL_SAND){
if($this->getSide(Facing::DOWN)->getId() !== BlockLegacyIds::SOUL_SAND){
$this->getLevel()->useBreakOn($this);
}
}

View File

@ -26,6 +26,6 @@ namespace pocketmine\block;
class PumpkinStem extends Stem{
protected function getPlant() : Block{
return BlockFactory::get(BlockIds::PUMPKIN);
return BlockFactory::get(BlockLegacyIds::PUMPKIN);
}
}

View File

@ -59,7 +59,7 @@ class Sapling extends Flowable{
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN);
if($down->getId() === BlockIds::GRASS or $down->getId() === BlockIds::DIRT or $down->getId() === BlockIds::FARMLAND){
if($down->getId() === BlockLegacyIds::GRASS or $down->getId() === BlockLegacyIds::DIRT or $down->getId() === BlockLegacyIds::FARMLAND){
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}

View File

@ -126,7 +126,7 @@ class Sign extends Transparent{
}
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::opposite($this->facing))->getId() === BlockIds::AIR){
if($this->getSide(Facing::opposite($this->facing))->getId() === BlockLegacyIds::AIR){
$this->getLevel()->useBreakOn($this);
}
}

View File

@ -96,7 +96,7 @@ class SnowLayer extends Flowable implements Fallable{
public function onRandomTick() : void{
if($this->level->getBlockLightAt($this->x, $this->y, $this->z) >= 12){
$this->getLevel()->setBlock($this, BlockFactory::get(BlockIds::AIR), false);
$this->getLevel()->setBlock($this, BlockFactory::get(BlockLegacyIds::AIR), false);
}
}

View File

@ -53,7 +53,7 @@ abstract class Stem extends Crops{
$side = $this->getSide(Facing::HORIZONTAL[array_rand(Facing::HORIZONTAL)]);
$d = $side->getSide(Facing::DOWN);
if($side->getId() === BlockIds::AIR and ($d->getId() === BlockIds::FARMLAND or $d->getId() === BlockIds::GRASS or $d->getId() === BlockIds::DIRT)){
if($side->getId() === BlockLegacyIds::AIR and ($d->getId() === BlockLegacyIds::FARMLAND or $d->getId() === BlockLegacyIds::GRASS or $d->getId() === BlockLegacyIds::DIRT)){
$ev = new BlockGrowEvent($side, $grow);
$ev->call();
if(!$ev->isCancelled()){

View File

@ -50,11 +50,11 @@ class Sugarcane extends Flowable{
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($item instanceof Fertilizer){
if($this->getSide(Facing::DOWN)->getId() !== BlockIds::SUGARCANE_BLOCK){
if($this->getSide(Facing::DOWN)->getId() !== BlockLegacyIds::SUGARCANE_BLOCK){
for($y = 1; $y < 3; ++$y){
$b = $this->getLevel()->getBlockAt($this->x, $this->y + $y, $this->z);
if($b->getId() === BlockIds::AIR){
$ev = new BlockGrowEvent($b, BlockFactory::get(BlockIds::SUGARCANE_BLOCK));
if($b->getId() === BlockLegacyIds::AIR){
$ev = new BlockGrowEvent($b, BlockFactory::get(BlockLegacyIds::SUGARCANE_BLOCK));
$ev->call();
if($ev->isCancelled()){
break;
@ -78,7 +78,7 @@ class Sugarcane extends Flowable{
public function onNearbyBlockChange() : void{
$down = $this->getSide(Facing::DOWN);
if($down->isTransparent() and $down->getId() !== BlockIds::SUGARCANE_BLOCK){
if($down->isTransparent() and $down->getId() !== BlockLegacyIds::SUGARCANE_BLOCK){
$this->getLevel()->useBreakOn($this);
}
}
@ -88,12 +88,12 @@ class Sugarcane extends Flowable{
}
public function onRandomTick() : void{
if($this->getSide(Facing::DOWN)->getId() !== BlockIds::SUGARCANE_BLOCK){
if($this->getSide(Facing::DOWN)->getId() !== BlockLegacyIds::SUGARCANE_BLOCK){
if($this->age === 15){
for($y = 1; $y < 3; ++$y){
$b = $this->getLevel()->getBlockAt($this->x, $this->y + $y, $this->z);
if($b->getId() === BlockIds::AIR){
$this->getLevel()->setBlock($b, BlockFactory::get(BlockIds::SUGARCANE_BLOCK));
if($b->getId() === BlockLegacyIds::AIR){
$this->getLevel()->setBlock($b, BlockFactory::get(BlockLegacyIds::SUGARCANE_BLOCK));
break;
}
}
@ -108,9 +108,9 @@ class Sugarcane extends Flowable{
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN);
if($down->getId() === BlockIds::SUGARCANE_BLOCK){
if($down->getId() === BlockLegacyIds::SUGARCANE_BLOCK){
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}elseif($down->getId() === BlockIds::GRASS or $down->getId() === BlockIds::DIRT or $down->getId() === BlockIds::SAND){
}elseif($down->getId() === BlockLegacyIds::GRASS or $down->getId() === BlockLegacyIds::DIRT or $down->getId() === BlockLegacyIds::SAND){
foreach(Facing::HORIZONTAL as $side){
if($down->getSide($side) instanceof Water){
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);

View File

@ -90,7 +90,7 @@ class TNT extends Solid{
}
public function ignite(int $fuse = 80) : void{
$this->getLevel()->setBlock($this, BlockFactory::get(BlockIds::AIR));
$this->getLevel()->setBlock($this, BlockFactory::get(BlockLegacyIds::AIR));
$mot = (new Random())->nextSignedFloat() * M_PI * 2;
$nbt = EntityFactory::createBaseNBT($this->add(0.5, 0, 0.5), new Vector3(-sin($mot) * 0.02, 0.2, -cos($mot) * 0.02));

View File

@ -38,7 +38,7 @@ class TallGrass extends Flowable{
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN)->getId();
if($down === BlockIds::GRASS or $down === BlockIds::DIRT){
if($down === BlockLegacyIds::GRASS or $down === BlockLegacyIds::DIRT){
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}
@ -47,7 +47,7 @@ class TallGrass extends Flowable{
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::DOWN)->isTransparent()){ //Replace with common break method
$this->getLevel()->setBlock($this, BlockFactory::get(BlockIds::AIR));
$this->getLevel()->setBlock($this, BlockFactory::get(BlockLegacyIds::AIR));
}
}

View File

@ -54,7 +54,7 @@ class Torch extends Flowable{
$below = $this->getSide(Facing::DOWN);
$face = Facing::opposite($this->facing);
if($this->getSide($face)->isTransparent() and !($face === Facing::DOWN and ($below->getId() === BlockIds::FENCE or $below->getId() === BlockIds::COBBLESTONE_WALL))){
if($this->getSide($face)->isTransparent() and !($face === Facing::DOWN and ($below->getId() === BlockLegacyIds::FENCE or $below->getId() === BlockLegacyIds::COBBLESTONE_WALL))){
$this->getLevel()->useBreakOn($this);
}
}
@ -63,7 +63,7 @@ class Torch extends Flowable{
if($blockClicked->canBeReplaced() and !$blockClicked->getSide(Facing::DOWN)->isTransparent()){
$this->facing = Facing::UP;
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}elseif($face !== Facing::DOWN and (!$blockClicked->isTransparent() or ($face === Facing::UP and ($blockClicked->getId() === BlockIds::FENCE or $blockClicked->getId() === BlockIds::COBBLESTONE_WALL)))){
}elseif($face !== Facing::DOWN and (!$blockClicked->isTransparent() or ($face === Facing::UP and ($blockClicked->getId() === BlockLegacyIds::FENCE or $blockClicked->getId() === BlockLegacyIds::COBBLESTONE_WALL)))){
$this->facing = $face;
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}else{

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\block\utils;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\Fire;
use pocketmine\block\Liquid;
use pocketmine\entity\EntityFactory;
@ -48,8 +48,8 @@ trait FallableTrait{
public function onNearbyBlockChange() : void{
$pos = $this->asPosition();
$down = $pos->level->getBlock($pos->getSide(Facing::DOWN));
if($down->getId() === BlockIds::AIR or $down instanceof Liquid or $down instanceof Fire){
$pos->level->setBlock($pos, BlockFactory::get(BlockIds::AIR));
if($down->getId() === BlockLegacyIds::AIR or $down instanceof Liquid or $down instanceof Fire){
$pos->level->setBlock($pos, BlockFactory::get(BlockLegacyIds::AIR));
$nbt = EntityFactory::createBaseNBT($pos->add(0.5, 0, 0.5));
$nbt->setInt("TileID", $this->getId());

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\entity\object;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\entity\Entity;
use pocketmine\event\entity\EntityDamageByEntityEvent;
use pocketmine\item\Item;
@ -109,7 +109,7 @@ class Painting extends Entity{
//non-living entities don't have a way to create drops generically yet
$this->level->dropItem($this, ItemFactory::get(Item::PAINTING));
}
$this->level->addParticle($this->add(0.5, 0.5, 0.5), new DestroyBlockParticle(BlockFactory::get(BlockIds::PLANKS)));
$this->level->addParticle($this->add(0.5, 0.5, 0.5), new DestroyBlockParticle(BlockFactory::get(BlockLegacyIds::PLANKS)));
}
protected function recalculateBoundingBox() : void{

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\entity\projectile;
use pocketmine\block\Block;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\event\entity\ProjectileHitEvent;
use pocketmine\level\sound\EndermanTeleportSound;
@ -37,7 +37,7 @@ class EnderPearl extends Throwable{
public const NETWORK_ID = self::ENDER_PEARL;
protected function calculateInterceptWithBlock(Block $block, Vector3 $start, Vector3 $end) : ?RayTraceResult{
if($block->getId() !== BlockIds::AIR and empty($block->getCollisionBoxes())){
if($block->getId() !== BlockLegacyIds::AIR and empty($block->getCollisionBoxes())){
//TODO: remove this once block collision boxes are fixed properly
return AxisAlignedBB::one()->offset($block->x, $block->y, $block->z)->calculateIntercept($start, $end);
}

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\entity\projectile;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\entity\effect\EffectInstance;
use pocketmine\entity\effect\InstantEffect;
use pocketmine\entity\Living;
@ -121,12 +121,12 @@ class SplashPotion extends Throwable{
}elseif($event instanceof ProjectileHitBlockEvent and $this->getPotionId() === Potion::WATER){
$blockIn = $event->getBlockHit()->getSide($event->getRayTraceResult()->getHitFace());
if($blockIn->getId() === BlockIds::FIRE){
$this->level->setBlock($blockIn, BlockFactory::get(BlockIds::AIR));
if($blockIn->getId() === BlockLegacyIds::FIRE){
$this->level->setBlock($blockIn, BlockFactory::get(BlockLegacyIds::AIR));
}
foreach($blockIn->getHorizontalSides() as $horizontalSide){
if($horizontalSide->getId() === BlockIds::FIRE){
$this->level->setBlock($horizontalSide, BlockFactory::get(BlockIds::AIR));
if($horizontalSide->getId() === BlockLegacyIds::FIRE){
$this->level->setBlock($horizontalSide, BlockFactory::get(BlockLegacyIds::AIR));
}
}
}

View File

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\event\player;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\entity\Living;
use pocketmine\event\entity\EntityDamageByBlockEvent;
use pocketmine\event\entity\EntityDamageByEntityEvent;
@ -170,7 +170,7 @@ class PlayerDeathEvent extends EntityDeathEvent{
case EntityDamageEvent::CAUSE_CONTACT:
if($deathCause instanceof EntityDamageByBlockEvent){
if($deathCause->getDamager()->getId() === BlockIds::CACTUS){
if($deathCause->getDamager()->getId() === BlockLegacyIds::CACTUS){
$message = "death.attack.cactus";
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\item;
use Ds\Deque;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\utils\BannerPattern;
use pocketmine\block\utils\DyeColor;
use pocketmine\nbt\tag\CompoundTag;
@ -54,7 +54,7 @@ class Banner extends Item{
}
public function getBlock() : Block{
return BlockFactory::get(BlockIds::STANDING_BANNER);
return BlockFactory::get(BlockLegacyIds::STANDING_BANNER);
}
public function getMaxStackSize() : int{

View File

@ -25,7 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\utils\DyeColor;
class Bed extends Item{
@ -46,7 +46,7 @@ class Bed extends Item{
}
public function getBlock() : Block{
return BlockFactory::get(BlockIds::BED_BLOCK);
return BlockFactory::get(BlockLegacyIds::BED_BLOCK);
}
public function getMaxStackSize() : int{

View File

@ -25,7 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
class BeetrootSeeds extends Item{
public function __construct(){
@ -33,6 +33,6 @@ class BeetrootSeeds extends Item{
}
public function getBlock() : Block{
return BlockFactory::get(BlockIds::BEETROOT_BLOCK);
return BlockFactory::get(BlockLegacyIds::BEETROOT_BLOCK);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\Liquid;
use pocketmine\event\player\PlayerBucketFillEvent;
use pocketmine\math\Vector3;
@ -47,7 +47,7 @@ class Bucket extends Item{
$ev = new PlayerBucketFillEvent($player, $blockReplace, $face, $this, $resultItem);
$ev->call();
if(!$ev->isCancelled()){
$player->getLevel()->setBlock($blockClicked, BlockFactory::get(BlockIds::AIR));
$player->getLevel()->setBlock($blockClicked, BlockFactory::get(BlockLegacyIds::AIR));
$player->getLevel()->broadcastLevelSoundEvent($blockClicked->add(0.5, 0.5, 0.5), $blockClicked->getBucketFillSound());
if($player->isSurvival()){
if($stack->getCount() === 0){

View File

@ -25,7 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
class Carrot extends Food{
public function __construct(){
@ -33,7 +33,7 @@ class Carrot extends Food{
}
public function getBlock() : Block{
return BlockFactory::get(BlockIds::CARROT_BLOCK);
return BlockFactory::get(BlockLegacyIds::CARROT_BLOCK);
}
public function getFoodRestore() : int{

View File

@ -25,11 +25,11 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
class CocoaBeans extends Item{
public function getBlock() : Block{
return BlockFactory::get(BlockIds::COCOA);
return BlockFactory::get(BlockLegacyIds::COCOA);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
use pocketmine\Player;
@ -37,10 +37,10 @@ class FlintSteel extends Tool{
}
public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : ItemUseResult{
if($blockReplace->getId() === BlockIds::AIR){
if($blockReplace->getId() === BlockLegacyIds::AIR){
$level = $player->getLevel();
assert($level !== null);
$level->setBlock($blockReplace, BlockFactory::get(BlockIds::FIRE));
$level->setBlock($blockReplace, BlockFactory::get(BlockLegacyIds::FIRE));
$level->broadcastLevelSoundEvent($blockReplace->add(0.5, 0.5, 0.5), LevelSoundEventPacket::SOUND_IGNITE);
$this->applyDamage(1);

View File

@ -28,7 +28,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\BlockToolType;
use pocketmine\entity\Entity;
use pocketmine\item\enchantment\Enchantment;
@ -591,7 +591,7 @@ class Item implements ItemIds, \JsonSerializable{
* @return Block
*/
public function getBlock() : Block{
return BlockFactory::get(BlockIds::AIR);
return BlockFactory::get(BlockLegacyIds::AIR);
}
/**

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\item;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\utils\DyeColor;
use pocketmine\block\utils\SkullType;
use pocketmine\block\utils\TreeType;
@ -156,23 +156,23 @@ class ItemFactory{
self::register(new Item(Item::SUGAR, 0, "Sugar"));
self::register(new Item(Item::TURTLE_SHELL_PIECE, 0, "Scute"));
self::register(new Item(Item::WHEAT, 0, "Wheat"));
self::register(new ItemBlock(BlockIds::ACACIA_DOOR_BLOCK, 0, Item::ACACIA_DOOR));
self::register(new ItemBlock(BlockIds::BIRCH_DOOR_BLOCK, 0, Item::BIRCH_DOOR));
self::register(new ItemBlock(BlockIds::BREWING_STAND_BLOCK, 0, Item::BREWING_STAND));
self::register(new ItemBlock(BlockIds::CAKE_BLOCK, 0, Item::CAKE));
self::register(new ItemBlock(BlockIds::CAULDRON_BLOCK, 0, Item::CAULDRON));
self::register(new ItemBlock(BlockIds::COMPARATOR_BLOCK, 0, Item::COMPARATOR));
self::register(new ItemBlock(BlockIds::DARK_OAK_DOOR_BLOCK, 0, Item::DARK_OAK_DOOR));
self::register(new ItemBlock(BlockIds::FLOWER_POT_BLOCK, 0, Item::FLOWER_POT));
self::register(new ItemBlock(BlockIds::HOPPER_BLOCK, 0, Item::HOPPER));
self::register(new ItemBlock(BlockIds::IRON_DOOR_BLOCK, 0, Item::IRON_DOOR));
self::register(new ItemBlock(BlockIds::ITEM_FRAME_BLOCK, 0, Item::ITEM_FRAME));
self::register(new ItemBlock(BlockIds::JUNGLE_DOOR_BLOCK, 0, Item::JUNGLE_DOOR));
self::register(new ItemBlock(BlockIds::NETHER_WART_PLANT, 0, Item::NETHER_WART));
self::register(new ItemBlock(BlockIds::OAK_DOOR_BLOCK, 0, Item::OAK_DOOR));
self::register(new ItemBlock(BlockIds::REPEATER_BLOCK, 0, Item::REPEATER));
self::register(new ItemBlock(BlockIds::SPRUCE_DOOR_BLOCK, 0, Item::SPRUCE_DOOR));
self::register(new ItemBlock(BlockIds::SUGARCANE_BLOCK, 0, Item::SUGARCANE));
self::register(new ItemBlock(BlockLegacyIds::ACACIA_DOOR_BLOCK, 0, Item::ACACIA_DOOR));
self::register(new ItemBlock(BlockLegacyIds::BIRCH_DOOR_BLOCK, 0, Item::BIRCH_DOOR));
self::register(new ItemBlock(BlockLegacyIds::BREWING_STAND_BLOCK, 0, Item::BREWING_STAND));
self::register(new ItemBlock(BlockLegacyIds::CAKE_BLOCK, 0, Item::CAKE));
self::register(new ItemBlock(BlockLegacyIds::CAULDRON_BLOCK, 0, Item::CAULDRON));
self::register(new ItemBlock(BlockLegacyIds::COMPARATOR_BLOCK, 0, Item::COMPARATOR));
self::register(new ItemBlock(BlockLegacyIds::DARK_OAK_DOOR_BLOCK, 0, Item::DARK_OAK_DOOR));
self::register(new ItemBlock(BlockLegacyIds::FLOWER_POT_BLOCK, 0, Item::FLOWER_POT));
self::register(new ItemBlock(BlockLegacyIds::HOPPER_BLOCK, 0, Item::HOPPER));
self::register(new ItemBlock(BlockLegacyIds::IRON_DOOR_BLOCK, 0, Item::IRON_DOOR));
self::register(new ItemBlock(BlockLegacyIds::ITEM_FRAME_BLOCK, 0, Item::ITEM_FRAME));
self::register(new ItemBlock(BlockLegacyIds::JUNGLE_DOOR_BLOCK, 0, Item::JUNGLE_DOOR));
self::register(new ItemBlock(BlockLegacyIds::NETHER_WART_PLANT, 0, Item::NETHER_WART));
self::register(new ItemBlock(BlockLegacyIds::OAK_DOOR_BLOCK, 0, Item::OAK_DOOR));
self::register(new ItemBlock(BlockLegacyIds::REPEATER_BLOCK, 0, Item::REPEATER));
self::register(new ItemBlock(BlockLegacyIds::SPRUCE_DOOR_BLOCK, 0, Item::SPRUCE_DOOR));
self::register(new ItemBlock(BlockLegacyIds::SUGARCANE_BLOCK, 0, Item::SUGARCANE));
self::register(new Leggings(Item::CHAIN_LEGGINGS, 0, "Chainmail Leggings", new ArmorTypeInfo(4, 226)));
self::register(new Leggings(Item::DIAMOND_LEGGINGS, 0, "Diamond Leggings", new ArmorTypeInfo(6, 496)));
self::register(new Leggings(Item::GOLDEN_LEGGINGS, 0, "Gold Leggings", new ArmorTypeInfo(3, 106)));
@ -180,8 +180,8 @@ class ItemFactory{
self::register(new Leggings(Item::LEATHER_LEGGINGS, 0, "Leather Pants", new ArmorTypeInfo(2, 76)));
//TODO: fix metadata for buckets with still liquid in them
//the meta values are intentionally hardcoded because block IDs will change in the future
self::register(new LiquidBucket(Item::BUCKET, 8, "Water Bucket", BlockIds::FLOWING_WATER));
self::register(new LiquidBucket(Item::BUCKET, 10, "Lava Bucket", BlockIds::FLOWING_LAVA));
self::register(new LiquidBucket(Item::BUCKET, 8, "Water Bucket", BlockLegacyIds::FLOWING_WATER));
self::register(new LiquidBucket(Item::BUCKET, 10, "Lava Bucket", BlockLegacyIds::FLOWING_LAVA));
self::register(new Melon());
self::register(new MelonSeeds());
self::register(new MilkBucket(Item::BUCKET, 1, "Milk Bucket"));
@ -214,12 +214,12 @@ class ItemFactory{
self::register(new Shovel(Item::IRON_SHOVEL, "Iron Shovel", TieredTool::TIER_IRON));
self::register(new Shovel(Item::STONE_SHOVEL, "Stone Shovel", TieredTool::TIER_STONE));
self::register(new Shovel(Item::WOODEN_SHOVEL, "Wooden Shovel", TieredTool::TIER_WOODEN));
self::register(new Sign(BlockIds::STANDING_SIGN, 0, Item::SIGN));
self::register(new Sign(BlockIds::SPRUCE_STANDING_SIGN, 0, Item::SPRUCE_SIGN));
self::register(new Sign(BlockIds::BIRCH_STANDING_SIGN, 0, Item::BIRCH_SIGN));
self::register(new Sign(BlockIds::JUNGLE_STANDING_SIGN, 0, Item::JUNGLE_SIGN));
self::register(new Sign(BlockIds::ACACIA_STANDING_SIGN, 0, Item::ACACIA_SIGN));
self::register(new Sign(BlockIds::DARKOAK_STANDING_SIGN, 0, Item::DARKOAK_SIGN));
self::register(new Sign(BlockLegacyIds::STANDING_SIGN, 0, Item::SIGN));
self::register(new Sign(BlockLegacyIds::SPRUCE_STANDING_SIGN, 0, Item::SPRUCE_SIGN));
self::register(new Sign(BlockLegacyIds::BIRCH_STANDING_SIGN, 0, Item::BIRCH_SIGN));
self::register(new Sign(BlockLegacyIds::JUNGLE_STANDING_SIGN, 0, Item::JUNGLE_SIGN));
self::register(new Sign(BlockLegacyIds::ACACIA_STANDING_SIGN, 0, Item::ACACIA_SIGN));
self::register(new Sign(BlockLegacyIds::DARKOAK_STANDING_SIGN, 0, Item::DARKOAK_SIGN));
self::register(new Snowball());
self::register(new SpiderEye());
self::register(new Steak());

View File

@ -25,7 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
class MelonSeeds extends Item{
public function __construct(){
@ -33,6 +33,6 @@ class MelonSeeds extends Item{
}
public function getBlock() : Block{
return BlockFactory::get(BlockIds::MELON_STEM);
return BlockFactory::get(BlockLegacyIds::MELON_STEM);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
class Potato extends Food{
public function __construct(){
@ -33,7 +33,7 @@ class Potato extends Food{
}
public function getBlock() : Block{
return BlockFactory::get(BlockIds::POTATO_BLOCK);
return BlockFactory::get(BlockLegacyIds::POTATO_BLOCK);
}
public function getFoodRestore() : int{

View File

@ -25,7 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
class PumpkinSeeds extends Item{
public function __construct(){
@ -33,6 +33,6 @@ class PumpkinSeeds extends Item{
}
public function getBlock() : Block{
return BlockFactory::get(BlockIds::PUMPKIN_STEM);
return BlockFactory::get(BlockLegacyIds::PUMPKIN_STEM);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
class Redstone extends Item{
public function __construct(){
@ -33,6 +33,6 @@ class Redstone extends Item{
}
public function getBlock() : Block{
return BlockFactory::get(BlockIds::REDSTONE_WIRE);
return BlockFactory::get(BlockLegacyIds::REDSTONE_WIRE);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\utils\SkullType;
class Skull extends Item{
@ -39,7 +39,7 @@ class Skull extends Item{
}
public function getBlock() : Block{
return BlockFactory::get(BlockIds::SKULL_BLOCK);
return BlockFactory::get(BlockLegacyIds::SKULL_BLOCK);
}
public function getSkullType() : SkullType{

View File

@ -25,7 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
class StringItem extends Item{
public function __construct(){
@ -33,6 +33,6 @@ class StringItem extends Item{
}
public function getBlock() : Block{
return BlockFactory::get(BlockIds::TRIPWIRE);
return BlockFactory::get(BlockLegacyIds::TRIPWIRE);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
class WheatSeeds extends Item{
public function __construct(){
@ -33,6 +33,6 @@ class WheatSeeds extends Item{
}
public function getBlock() : Block{
return BlockFactory::get(BlockIds::WHEAT_BLOCK);
return BlockFactory::get(BlockLegacyIds::WHEAT_BLOCK);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\level;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\TNT;
use pocketmine\entity\Entity;
use pocketmine\event\block\BlockUpdateEvent;
@ -200,7 +200,7 @@ class Explosion{
$air = ItemFactory::air();
$airBlock = BlockFactory::get(BlockIds::AIR);
$airBlock = BlockFactory::get(BlockLegacyIds::AIR);
foreach($this->affectedBlocks as $block){
if($block instanceof TNT){

View File

@ -28,7 +28,7 @@ namespace pocketmine\level;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\UnknownBlock;
use pocketmine\entity\Entity;
use pocketmine\entity\EntityFactory;
@ -1803,7 +1803,7 @@ class Level implements ChunkManager, Metadatable{
return false;
}
if($blockClicked->getId() === BlockIds::AIR){
if($blockClicked->getId() === BlockLegacyIds::AIR){
return false;
}
@ -2783,7 +2783,7 @@ class Level implements ChunkManager, Metadatable{
$z = (int) $v->z;
if($chunk !== null and $chunk->isGenerated()){
$y = (int) min($max - 2, $v->y);
$wasAir = $this->getBlockAt($x, $y - 1, $z)->getId() === BlockIds::AIR; //TODO: bad hack, clean up
$wasAir = $this->getBlockAt($x, $y - 1, $z)->getId() === BlockLegacyIds::AIR; //TODO: bad hack, clean up
for(; $y > 0; --$y){
if($this->isFullBlock($this->getBlockAt($x, $y, $z))){
if($wasAir){

View File

@ -25,7 +25,7 @@ namespace pocketmine\level;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\level\format\Chunk;
use const INT32_MAX;
use const INT32_MIN;
@ -50,7 +50,7 @@ class SimpleChunkManager implements ChunkManager{
if($chunk = $this->getChunk($x >> 4, $z >> 4)){
return BlockFactory::fromFullBlock($chunk->getFullBlock($x & 0xf, $y, $z & 0xf));
}
return BlockFactory::get(BlockIds::AIR);
return BlockFactory::get(BlockLegacyIds::AIR);
}
public function setBlockAt(int $x, int $y, int $z, Block $block) : bool{

View File

@ -24,17 +24,17 @@ declare(strict_types=1);
namespace pocketmine\level\biome;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
abstract class GrassyBiome extends Biome{
public function __construct(){
$this->setGroundCover([
BlockFactory::get(BlockIds::GRASS),
BlockFactory::get(BlockIds::DIRT),
BlockFactory::get(BlockIds::DIRT),
BlockFactory::get(BlockIds::DIRT),
BlockFactory::get(BlockIds::DIRT)
BlockFactory::get(BlockLegacyIds::GRASS),
BlockFactory::get(BlockLegacyIds::DIRT),
BlockFactory::get(BlockLegacyIds::DIRT),
BlockFactory::get(BlockLegacyIds::DIRT),
BlockFactory::get(BlockLegacyIds::DIRT)
]);
}
}

View File

@ -24,18 +24,18 @@ declare(strict_types=1);
namespace pocketmine\level\biome;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\level\generator\populator\TallGrass;
class OceanBiome extends Biome{
public function __construct(){
$this->setGroundCover([
BlockFactory::get(BlockIds::GRAVEL),
BlockFactory::get(BlockIds::GRAVEL),
BlockFactory::get(BlockIds::GRAVEL),
BlockFactory::get(BlockIds::GRAVEL),
BlockFactory::get(BlockIds::GRAVEL)
BlockFactory::get(BlockLegacyIds::GRAVEL),
BlockFactory::get(BlockLegacyIds::GRAVEL),
BlockFactory::get(BlockLegacyIds::GRAVEL),
BlockFactory::get(BlockLegacyIds::GRAVEL),
BlockFactory::get(BlockLegacyIds::GRAVEL)
]);
$tallGrass = new TallGrass();

View File

@ -24,18 +24,18 @@ declare(strict_types=1);
namespace pocketmine\level\biome;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\level\generator\populator\TallGrass;
class RiverBiome extends Biome{
public function __construct(){
$this->setGroundCover([
BlockFactory::get(BlockIds::DIRT),
BlockFactory::get(BlockIds::DIRT),
BlockFactory::get(BlockIds::DIRT),
BlockFactory::get(BlockIds::DIRT),
BlockFactory::get(BlockIds::DIRT)
BlockFactory::get(BlockLegacyIds::DIRT),
BlockFactory::get(BlockLegacyIds::DIRT),
BlockFactory::get(BlockLegacyIds::DIRT),
BlockFactory::get(BlockLegacyIds::DIRT),
BlockFactory::get(BlockLegacyIds::DIRT)
]);
$tallGrass = new TallGrass();

View File

@ -24,17 +24,17 @@ declare(strict_types=1);
namespace pocketmine\level\biome;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
abstract class SandyBiome extends Biome{
public function __construct(){
$this->setGroundCover([
BlockFactory::get(BlockIds::SAND),
BlockFactory::get(BlockIds::SAND),
BlockFactory::get(BlockIds::SANDSTONE),
BlockFactory::get(BlockIds::SANDSTONE),
BlockFactory::get(BlockIds::SANDSTONE)
BlockFactory::get(BlockLegacyIds::SAND),
BlockFactory::get(BlockLegacyIds::SAND),
BlockFactory::get(BlockLegacyIds::SANDSTONE),
BlockFactory::get(BlockLegacyIds::SANDSTONE),
BlockFactory::get(BlockLegacyIds::SANDSTONE)
]);
}
}

View File

@ -24,17 +24,17 @@ declare(strict_types=1);
namespace pocketmine\level\biome;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
abstract class SnowyBiome extends Biome{
public function __construct(){
$this->setGroundCover([
BlockFactory::get(BlockIds::SNOW_LAYER),
BlockFactory::get(BlockIds::GRASS),
BlockFactory::get(BlockIds::DIRT),
BlockFactory::get(BlockIds::DIRT),
BlockFactory::get(BlockIds::DIRT)
BlockFactory::get(BlockLegacyIds::SNOW_LAYER),
BlockFactory::get(BlockLegacyIds::GRASS),
BlockFactory::get(BlockLegacyIds::DIRT),
BlockFactory::get(BlockLegacyIds::DIRT),
BlockFactory::get(BlockLegacyIds::DIRT)
]);
}
}

View File

@ -27,7 +27,7 @@ declare(strict_types=1);
namespace pocketmine\level\format;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\entity\Entity;
use pocketmine\entity\EntityFactory;
use pocketmine\level\Level;
@ -664,7 +664,7 @@ class Chunk{
if($y < 0 or $y >= $this->height){
return $this->emptySubChunk;
}elseif($generateNew and $this->subChunks[$y] instanceof EmptySubChunk){
$this->subChunks[$y] = new SubChunk([new PalettedBlockArray(BlockIds::AIR << 4)]);
$this->subChunks[$y] = new SubChunk([new PalettedBlockArray(BlockLegacyIds::AIR << 4)]);
}
return $this->subChunks[$y];

View File

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\level\format;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use function array_values;
use function assert;
use function chr;
@ -74,7 +74,7 @@ class SubChunk implements SubChunkInterface{
foreach($this->blockLayers as $layer){
$palette = $layer->getPalette();
foreach($palette as $p){
if(($p >> 4) !== BlockIds::AIR){
if(($p >> 4) !== BlockLegacyIds::AIR){
return false;
}
}
@ -89,14 +89,14 @@ class SubChunk implements SubChunkInterface{
public function getFullBlock(int $x, int $y, int $z) : int{
if(empty($this->blockLayers)){
return BlockIds::AIR << 4;
return BlockLegacyIds::AIR << 4;
}
return $this->blockLayers[0]->get($x, $y, $z);
}
public function setFullBlock(int $x, int $y, int $z, int $block) : void{
if(empty($this->blockLayers)){
$this->blockLayers[] = new PalettedBlockArray(BlockIds::AIR << 4);
$this->blockLayers[] = new PalettedBlockArray(BlockLegacyIds::AIR << 4);
}
$this->blockLayers[0]->set($x, $y, $z, $block);
}
@ -141,7 +141,7 @@ class SubChunk implements SubChunkInterface{
return -1;
}
for($y = 15; $y >= 0; --$y){
if(($this->blockLayers[0]->get($x, $y, $z) >> 4) !== BlockIds::AIR){
if(($this->blockLayers[0]->get($x, $y, $z) >> 4) !== BlockLegacyIds::AIR){
return $y;
}
}
@ -178,7 +178,7 @@ class SubChunk implements SubChunkInterface{
$layer->collectGarbage();
foreach($layer->getPalette() as $p){
if(($p >> 4) !== BlockIds::AIR){
if(($p >> 4) !== BlockLegacyIds::AIR){
continue 2;
}
}

View File

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\level\format\io\leveldb;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\level\format\Chunk;
use pocketmine\level\format\io\BaseLevelProvider;
use pocketmine\level\format\io\ChunkUtils;
@ -161,7 +161,7 @@ class LevelDB extends BaseLevelProvider implements WritableLevelProvider{
$tag = $nbt->read($stream->getBuffer(), $offset)->getTag();
$stream->setOffset($offset);
$id = $stringToLegacyId[$tag->getString("name")] ?? BlockIds::INFO_UPDATE;
$id = $stringToLegacyId[$tag->getString("name")] ?? BlockLegacyIds::INFO_UPDATE;
$data = $tag->getShort("val");
$palette[] = ($id << 4) | $data;
}

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\level\generator;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\item\ItemFactory;
use pocketmine\level\ChunkManager;
use pocketmine\level\format\Chunk;
@ -78,14 +78,14 @@ class Flat extends Generator{
if(isset($this->options["decoration"])){
$ores = new Ore();
$ores->setOreTypes([
new OreType(BlockFactory::get(BlockIds::COAL_ORE), 20, 16, 0, 128),
new OreType(BlockFactory::get(BlockIds::IRON_ORE), 20, 8, 0, 64),
new OreType(BlockFactory::get(BlockIds::REDSTONE_ORE), 8, 7, 0, 16),
new OreType(BlockFactory::get(BlockIds::LAPIS_ORE), 1, 6, 0, 32),
new OreType(BlockFactory::get(BlockIds::GOLD_ORE), 2, 8, 0, 32),
new OreType(BlockFactory::get(BlockIds::DIAMOND_ORE), 1, 7, 0, 16),
new OreType(BlockFactory::get(BlockIds::DIRT), 20, 32, 0, 128),
new OreType(BlockFactory::get(BlockIds::GRAVEL), 10, 16, 0, 128)
new OreType(BlockFactory::get(BlockLegacyIds::COAL_ORE), 20, 16, 0, 128),
new OreType(BlockFactory::get(BlockLegacyIds::IRON_ORE), 20, 8, 0, 64),
new OreType(BlockFactory::get(BlockLegacyIds::REDSTONE_ORE), 8, 7, 0, 16),
new OreType(BlockFactory::get(BlockLegacyIds::LAPIS_ORE), 1, 6, 0, 32),
new OreType(BlockFactory::get(BlockLegacyIds::GOLD_ORE), 2, 8, 0, 32),
new OreType(BlockFactory::get(BlockLegacyIds::DIAMOND_ORE), 1, 7, 0, 16),
new OreType(BlockFactory::get(BlockLegacyIds::DIRT), 20, 32, 0, 128),
new OreType(BlockFactory::get(BlockLegacyIds::GRAVEL), 10, 16, 0, 128)
]);
$this->populators[] = $ores;
}

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\level\generator\hell;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\level\biome\Biome;
use pocketmine\level\ChunkManager;
use pocketmine\level\generator\Generator;
@ -90,9 +90,9 @@ class Nether extends Generator{
$chunk = $this->level->getChunk($chunkX, $chunkZ);
$bedrock = BlockFactory::get(BlockIds::BEDROCK)->getFullId();
$netherrack = BlockFactory::get(BlockIds::NETHERRACK)->getFullId();
$stillLava = BlockFactory::get(BlockIds::STILL_LAVA)->getFullId();
$bedrock = BlockFactory::get(BlockLegacyIds::BEDROCK)->getFullId();
$netherrack = BlockFactory::get(BlockLegacyIds::NETHERRACK)->getFullId();
$stillLava = BlockFactory::get(BlockLegacyIds::STILL_LAVA)->getFullId();
for($x = 0; $x < 16; ++$x){
for($z = 0; $z < 16; ++$z){

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\level\generator\normal;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\level\biome\Biome;
use pocketmine\level\ChunkManager;
use pocketmine\level\generator\biome\BiomeSelector;
@ -121,14 +121,14 @@ class Normal extends Generator{
$ores = new Ore();
$ores->setOreTypes([
new OreType(BlockFactory::get(BlockIds::COAL_ORE), 20, 16, 0, 128),
new OreType(BlockFactory::get(BlockIds::IRON_ORE), 20, 8, 0, 64),
new OreType(BlockFactory::get(BlockIds::REDSTONE_ORE), 8, 7, 0, 16),
new OreType(BlockFactory::get(BlockIds::LAPIS_ORE), 1, 6, 0, 32),
new OreType(BlockFactory::get(BlockIds::GOLD_ORE), 2, 8, 0, 32),
new OreType(BlockFactory::get(BlockIds::DIAMOND_ORE), 1, 7, 0, 16),
new OreType(BlockFactory::get(BlockIds::DIRT), 20, 32, 0, 128),
new OreType(BlockFactory::get(BlockIds::GRAVEL), 10, 16, 0, 128)
new OreType(BlockFactory::get(BlockLegacyIds::COAL_ORE), 20, 16, 0, 128),
new OreType(BlockFactory::get(BlockLegacyIds::IRON_ORE), 20, 8, 0, 64),
new OreType(BlockFactory::get(BlockLegacyIds::REDSTONE_ORE), 8, 7, 0, 16),
new OreType(BlockFactory::get(BlockLegacyIds::LAPIS_ORE), 1, 6, 0, 32),
new OreType(BlockFactory::get(BlockLegacyIds::GOLD_ORE), 2, 8, 0, 32),
new OreType(BlockFactory::get(BlockLegacyIds::DIAMOND_ORE), 1, 7, 0, 16),
new OreType(BlockFactory::get(BlockLegacyIds::DIRT), 20, 32, 0, 128),
new OreType(BlockFactory::get(BlockLegacyIds::GRAVEL), 10, 16, 0, 128)
]);
$this->populators[] = $ores;
}
@ -178,9 +178,9 @@ class Normal extends Generator{
$biomeCache = [];
$bedrock = BlockFactory::get(BlockIds::BEDROCK)->getFullId();
$stillWater = BlockFactory::get(BlockIds::STILL_WATER)->getFullId();
$stone = BlockFactory::get(BlockIds::STONE)->getFullId();
$bedrock = BlockFactory::get(BlockLegacyIds::BEDROCK)->getFullId();
$stillWater = BlockFactory::get(BlockLegacyIds::STILL_WATER)->getFullId();
$stone = BlockFactory::get(BlockLegacyIds::STONE)->getFullId();
for($x = 0; $x < 16; ++$x){
for($z = 0; $z < 16; ++$z){

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\level\generator\object;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\utils\TreeType;
use pocketmine\level\ChunkManager;
use pocketmine\utils\Random;
@ -34,7 +34,7 @@ class BirchTree extends Tree{
protected $superBirch = false;
public function __construct(bool $superBirch = false){
parent::__construct(BlockFactory::get(BlockIds::LOG, TreeType::BIRCH()->getMagicNumber()), BlockFactory::get(BlockIds::LEAVES, TreeType::BIRCH()->getMagicNumber()));
parent::__construct(BlockFactory::get(BlockLegacyIds::LOG, TreeType::BIRCH()->getMagicNumber()), BlockFactory::get(BlockLegacyIds::LEAVES, TreeType::BIRCH()->getMagicNumber()));
$this->superBirch = $superBirch;
}

View File

@ -24,12 +24,12 @@ declare(strict_types=1);
namespace pocketmine\level\generator\object;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\utils\TreeType;
class JungleTree extends Tree{
public function __construct(){
parent::__construct(BlockFactory::get(BlockIds::LOG, TreeType::JUNGLE()->getMagicNumber()), BlockFactory::get(BlockIds::LEAVES, TreeType::JUNGLE()->getMagicNumber()), 8);
parent::__construct(BlockFactory::get(BlockLegacyIds::LOG, TreeType::JUNGLE()->getMagicNumber()), BlockFactory::get(BlockLegacyIds::LEAVES, TreeType::JUNGLE()->getMagicNumber()), 8);
}
}

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\level\generator\object;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\utils\TreeType;
use pocketmine\level\ChunkManager;
use pocketmine\utils\Random;
@ -32,7 +32,7 @@ use pocketmine\utils\Random;
class OakTree extends Tree{
public function __construct(){
parent::__construct(BlockFactory::get(BlockIds::LOG, TreeType::OAK()->getMagicNumber()), BlockFactory::get(BlockIds::LEAVES, TreeType::OAK()->getMagicNumber()));
parent::__construct(BlockFactory::get(BlockLegacyIds::LOG, TreeType::OAK()->getMagicNumber()), BlockFactory::get(BlockLegacyIds::LEAVES, TreeType::OAK()->getMagicNumber()));
}
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random) : void{

View File

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\level\generator\object;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\level\ChunkManager;
use pocketmine\math\VectorMath;
use pocketmine\utils\Random;
@ -46,7 +46,7 @@ class Ore{
}
public function canPlaceObject(ChunkManager $level, int $x, int $y, int $z) : bool{
return $level->getBlockAt($x, $y, $z)->getId() === BlockIds::STONE;
return $level->getBlockAt($x, $y, $z)->getId() === BlockLegacyIds::STONE;
}
public function placeObject(ChunkManager $level, int $x, int $y, int $z) : void{
@ -86,7 +86,7 @@ class Ore{
$sizeZ = ($z + 0.5 - $seedZ) / $size;
$sizeZ *= $sizeZ;
if(($sizeX + $sizeY + $sizeZ) < 1 and $level->getBlockAt($x, $y, $z)->getId() === BlockIds::STONE){
if(($sizeX + $sizeY + $sizeZ) < 1 and $level->getBlockAt($x, $y, $z)->getId() === BlockLegacyIds::STONE){
$level->setBlockAt($x, $y, $z, $this->type->material);
}
}

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\level\generator\object;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\utils\TreeType;
use pocketmine\level\BlockTransaction;
use pocketmine\level\ChunkManager;
@ -34,7 +34,7 @@ use function abs;
class SpruceTree extends Tree{
public function __construct(){
parent::__construct(BlockFactory::get(BlockIds::LOG, TreeType::SPRUCE()->getMagicNumber()), BlockFactory::get(BlockIds::LEAVES, TreeType::SPRUCE()->getMagicNumber()), 10);
parent::__construct(BlockFactory::get(BlockLegacyIds::LOG, TreeType::SPRUCE()->getMagicNumber()), BlockFactory::get(BlockLegacyIds::LEAVES, TreeType::SPRUCE()->getMagicNumber()), 10);
}
protected function generateChunkHeight(Random $random) : int{

View File

@ -25,7 +25,7 @@ namespace pocketmine\level\generator\object;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\level\ChunkManager;
use pocketmine\math\Vector3;
use pocketmine\utils\Random;
@ -36,9 +36,9 @@ class TallGrass{
public static function growGrass(ChunkManager $level, Vector3 $pos, Random $random, int $count = 15, int $radius = 10) : void{
/** @var Block[] $arr */
$arr = [
BlockFactory::get(BlockIds::DANDELION),
BlockFactory::get(BlockIds::POPPY),
$tallGrass = BlockFactory::get(BlockIds::TALL_GRASS, 1),
BlockFactory::get(BlockLegacyIds::DANDELION),
BlockFactory::get(BlockLegacyIds::POPPY),
$tallGrass = BlockFactory::get(BlockLegacyIds::TALL_GRASS, 1),
$tallGrass,
$tallGrass,
$tallGrass
@ -47,7 +47,7 @@ class TallGrass{
for($c = 0; $c < $count; ++$c){
$x = $random->nextRange($pos->x - $radius, $pos->x + $radius);
$z = $random->nextRange($pos->z - $radius, $pos->z + $radius);
if($level->getBlockAt($x, $pos->y + 1, $z)->getId() === BlockIds::AIR and $level->getBlockAt($x, $pos->y, $z)->getId() === BlockIds::GRASS){
if($level->getBlockAt($x, $pos->y + 1, $z)->getId() === BlockLegacyIds::AIR and $level->getBlockAt($x, $pos->y, $z)->getId() === BlockLegacyIds::GRASS){
$level->setBlockAt($x, $pos->y + 1, $z, $arr[$random->nextRange(0, $arrC)]);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\level\generator\object;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\Leaves;
use pocketmine\block\Sapling;
use pocketmine\block\utils\TreeType;
@ -121,7 +121,7 @@ abstract class Tree{
protected function placeTrunk(int $x, int $y, int $z, Random $random, int $trunkHeight, BlockTransaction $transaction) : void{
// The base dirt block
$transaction->addBlockAt($x, $y - 1, $z, BlockFactory::get(BlockIds::DIRT));
$transaction->addBlockAt($x, $y - 1, $z, BlockFactory::get(BlockLegacyIds::DIRT));
for($yy = 0; $yy < $trunkHeight; ++$yy){
if($this->canOverride($transaction->fetchBlockAt($x, $y + $yy, $z))){

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\level\generator\populator;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\Liquid;
use pocketmine\level\biome\Biome;
use pocketmine\level\ChunkManager;
@ -56,7 +56,7 @@ class GroundCover extends Populator{
for($y = $startY; $y > $endY and $y >= 0; --$y){
$b = $cover[$startY - $y];
$id = BlockFactory::fromFullBlock($chunk->getFullBlock($x, $y, $z));
if($id->getId() === BlockIds::AIR and $b->isSolid()){
if($id->getId() === BlockLegacyIds::AIR and $b->isSolid()){
break;
}
if($b->canBeFlowedInto() and $id instanceof Liquid){

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\level\generator\populator;
use pocketmine\block\BlockFactory;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\level\ChunkManager;
use pocketmine\utils\Random;
@ -46,7 +46,7 @@ class TallGrass extends Populator{
$this->level = $level;
$amount = $random->nextRange(0, $this->randomAmount + 1) + $this->baseAmount;
$block = BlockFactory::get(BlockIds::TALL_GRASS, 1);
$block = BlockFactory::get(BlockLegacyIds::TALL_GRASS, 1);
for($i = 0; $i < $amount; ++$i){
$x = $random->nextRange($chunkX * 16, $chunkX * 16 + 15);
$z = $random->nextRange($chunkZ * 16, $chunkZ * 16 + 15);
@ -60,13 +60,13 @@ class TallGrass extends Populator{
private function canTallGrassStay(int $x, int $y, int $z) : bool{
$b = $this->level->getBlockAt($x, $y, $z)->getId();
return ($b === BlockIds::AIR or $b === BlockIds::SNOW_LAYER) and $this->level->getBlockAt($x, $y - 1, $z)->getId() === BlockIds::GRASS;
return ($b === BlockLegacyIds::AIR or $b === BlockLegacyIds::SNOW_LAYER) and $this->level->getBlockAt($x, $y - 1, $z)->getId() === BlockLegacyIds::GRASS;
}
private function getHighestWorkableBlock(int $x, int $z) : int{
for($y = 127; $y >= 0; --$y){
$b = $this->level->getBlockAt($x, $y, $z)->getId();
if($b !== BlockIds::AIR and $b !== BlockIds::LEAVES and $b !== BlockIds::LEAVES2 and $b !== BlockIds::SNOW_LAYER){
if($b !== BlockLegacyIds::AIR and $b !== BlockLegacyIds::LEAVES and $b !== BlockLegacyIds::LEAVES2 and $b !== BlockLegacyIds::SNOW_LAYER){
break;
}
}

View File

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\level\generator\populator;
use pocketmine\block\BlockIds;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\utils\TreeType;
use pocketmine\level\ChunkManager;
use pocketmine\level\generator\object\Tree as ObjectTree;
@ -70,9 +70,9 @@ class Tree extends Populator{
private function getHighestWorkableBlock(int $x, int $z) : int{
for($y = 127; $y > 0; --$y){
$b = $this->level->getBlockAt($x, $y, $z)->getId();
if($b === BlockIds::DIRT or $b === BlockIds::GRASS){
if($b === BlockLegacyIds::DIRT or $b === BlockLegacyIds::GRASS){
break;
}elseif($b !== BlockIds::AIR and $b !== BlockIds::SNOW_LAYER){
}elseif($b !== BlockLegacyIds::AIR and $b !== BlockLegacyIds::SNOW_LAYER){
return -1;
}
}

View File

@ -37,7 +37,7 @@ class BlockTest extends TestCase{
* Test registering a block which would overwrite another block, without forcing it
*/
public function testAccidentalOverrideBlock() : void{
$block = new MyCustomBlock(new BlockIdentifier(BlockIds::COBBLESTONE), "Cobblestone");
$block = new MyCustomBlock(new BlockIdentifier(BlockLegacyIds::COBBLESTONE), "Cobblestone");
$this->expectException(\InvalidArgumentException::class);
BlockFactory::register($block);
}
@ -46,7 +46,7 @@ class BlockTest extends TestCase{
* Test registering a block deliberately overwriting another block works as expected
*/
public function testDeliberateOverrideBlock() : void{
$block = new MyCustomBlock(new BlockIdentifier(BlockIds::COBBLESTONE), "Cobblestone");
$block = new MyCustomBlock(new BlockIdentifier(BlockLegacyIds::COBBLESTONE), "Cobblestone");
BlockFactory::register($block, true);
self::assertInstanceOf(MyCustomBlock::class, BlockFactory::get($block->getId()));
}
@ -101,12 +101,12 @@ class BlockTest extends TestCase{
*/
public function blockGetProvider() : array{
return [
[BlockIds::STONE, 5],
[BlockIds::STONE, 15],
[BlockIds::GOLD_BLOCK, 0],
[BlockIds::WOODEN_PLANKS, 5],
[BlockIds::SAND, 0],
[BlockIds::GOLD_BLOCK, 0]
[BlockLegacyIds::STONE, 5],
[BlockLegacyIds::STONE, 15],
[BlockLegacyIds::GOLD_BLOCK, 0],
[BlockLegacyIds::WOODEN_PLANKS, 5],
[BlockLegacyIds::SAND, 0],
[BlockLegacyIds::GOLD_BLOCK, 0]
];
}