diff --git a/src/pocketmine/block/Anvil.php b/src/pocketmine/block/Anvil.php index f2c280fd4a..aecd4c9e58 100644 --- a/src/pocketmine/block/Anvil.php +++ b/src/pocketmine/block/Anvil.php @@ -43,7 +43,7 @@ class Anvil extends Transparent implements Fallable{ protected $facing = Facing::NORTH; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 6000.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(5.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 6000.0)); } protected function writeStateToMeta() : int{ diff --git a/src/pocketmine/block/Banner.php b/src/pocketmine/block/Banner.php index 348d4843ef..85f499f6db 100644 --- a/src/pocketmine/block/Banner.php +++ b/src/pocketmine/block/Banner.php @@ -58,7 +58,7 @@ class Banner extends Transparent{ protected $patterns; public function __construct(BlockIdentifierFlattened $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.0, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.0, BlockToolType::AXE)); $this->baseColor = DyeColor::BLACK(); $this->patterns = new Deque(); } diff --git a/src/pocketmine/block/BlockBreakInfo.php b/src/pocketmine/block/BlockBreakInfo.php index e900b927f0..68e287bb69 100644 --- a/src/pocketmine/block/BlockBreakInfo.php +++ b/src/pocketmine/block/BlockBreakInfo.php @@ -43,19 +43,19 @@ class BlockBreakInfo{ * @param int $toolHarvestLevel * @param float|null $blastResistance default 5x hardness */ - public function __construct(float $hardness, int $toolType = BlockToolType::TYPE_NONE, int $toolHarvestLevel = 0, ?float $blastResistance = null){ + public function __construct(float $hardness, int $toolType = BlockToolType::NONE, int $toolHarvestLevel = 0, ?float $blastResistance = null){ $this->hardness = $hardness; $this->toolType = $toolType; $this->toolHarvestLevel = $toolHarvestLevel; $this->blastResistance = $blastResistance ?? $hardness * 5; } - public static function instant(int $toolType = BlockToolType::TYPE_NONE, int $toolHarvestLevel = 0) : self{ + public static function instant(int $toolType = BlockToolType::NONE, int $toolHarvestLevel = 0) : self{ return new self(0.0, $toolType, $toolHarvestLevel, 0.0); } public static function indestructible(float $blastResistance = 18000000.0) : self{ - return new self(-1.0, BlockToolType::TYPE_NONE, 0, $blastResistance); + return new self(-1.0, BlockToolType::NONE, 0, $blastResistance); } /** @@ -133,7 +133,7 @@ class BlockBreakInfo{ return false; } - return $this->toolType === BlockToolType::TYPE_NONE or $this->toolHarvestLevel === 0 or ( + return $this->toolType === BlockToolType::NONE or $this->toolHarvestLevel === 0 or ( ($this->toolType & $tool->getBlockToolType()) !== 0 and $tool->getBlockToolHarvestLevel() >= $this->toolHarvestLevel); } diff --git a/src/pocketmine/block/BlockFactory.php b/src/pocketmine/block/BlockFactory.php index e9d784c52d..555847800e 100644 --- a/src/pocketmine/block/BlockFactory.php +++ b/src/pocketmine/block/BlockFactory.php @@ -100,7 +100,7 @@ class BlockFactory{ self::register(new Bookshelf(new BID(Ids::BOOKSHELF), "Bookshelf")); self::register(new BrewingStand(new BID(Ids::BREWING_STAND_BLOCK, 0, ItemIds::BREWING_STAND, TileBrewingStand::class), "Brewing Stand")); - $bricksBreakInfo = new BlockBreakInfo(2.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 30.0); + $bricksBreakInfo = new BlockBreakInfo(2.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0); self::register(new Stair(new BID(Ids::BRICK_STAIRS), "Brick Stairs", $bricksBreakInfo)); self::register(new Solid(new BID(Ids::BRICK_BLOCK), "Bricks", $bricksBreakInfo)); @@ -115,7 +115,7 @@ class BlockFactory{ self::register(new CoalOre(new BID(Ids::COAL_ORE), "Coal Ore")); self::register(new CoarseDirt(new BID(Ids::DIRT, Meta::DIRT_COARSE), "Coarse Dirt")); - $cobblestoneBreakInfo = new BlockBreakInfo(2.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 30.0); + $cobblestoneBreakInfo = new BlockBreakInfo(2.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0); self::register(new Solid(new BID(Ids::COBBLESTONE), "Cobblestone", $cobblestoneBreakInfo)); self::register(new Solid(new BID(Ids::MOSSY_COBBLESTONE), "Mossy Cobblestone", $cobblestoneBreakInfo)); self::register(new Stair(new BID(Ids::COBBLESTONE_STAIRS), "Cobblestone Stairs", $cobblestoneBreakInfo)); @@ -128,7 +128,7 @@ class BlockFactory{ self::register(new DeadBush(new BID(Ids::DEADBUSH), "Dead Bush")); self::register(new DetectorRail(new BID(Ids::DETECTOR_RAIL), "Detector Rail")); - self::register(new Solid(new BID(Ids::DIAMOND_BLOCK), "Diamond Block", new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_IRON, 30.0))); + self::register(new Solid(new BID(Ids::DIAMOND_BLOCK), "Diamond Block", new BlockBreakInfo(5.0, BlockToolType::PICKAXE, TieredTool::TIER_IRON, 30.0))); self::register(new DiamondOre(new BID(Ids::DIAMOND_ORE), "Diamond Ore")); self::register(new Dirt(new BID(Ids::DIRT, Meta::DIRT_NORMAL), "Dirt")); self::register(new DoublePlant(new BID(Ids::DOUBLE_PLANT, Meta::DOUBLE_PLANT_SUNFLOWER), "Sunflower")); @@ -138,15 +138,15 @@ class BlockFactory{ self::register(new DoubleTallGrass(new BID(Ids::DOUBLE_PLANT, Meta::DOUBLE_PLANT_TALLGRASS), "Double Tallgrass")); self::register(new DoubleTallGrass(new BID(Ids::DOUBLE_PLANT, Meta::DOUBLE_PLANT_LARGE_FERN), "Large Fern")); self::register(new DragonEgg(new BID(Ids::DRAGON_EGG), "Dragon Egg")); - self::register(new DriedKelp(new BID(Ids::DRIED_KELP_BLOCK), "Dried Kelp Block", new BlockBreakInfo(0.5, BlockToolType::TYPE_NONE, 0, 12.5))); - self::register(new Solid(new BID(Ids::EMERALD_BLOCK), "Emerald Block", new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_IRON, 30.0))); + self::register(new DriedKelp(new BID(Ids::DRIED_KELP_BLOCK), "Dried Kelp Block", new BlockBreakInfo(0.5, BlockToolType::NONE, 0, 12.5))); + self::register(new Solid(new BID(Ids::EMERALD_BLOCK), "Emerald Block", new BlockBreakInfo(5.0, BlockToolType::PICKAXE, TieredTool::TIER_IRON, 30.0))); self::register(new EmeraldOre(new BID(Ids::EMERALD_ORE), "Emerald Ore")); self::register(new EnchantingTable(new BID(Ids::ENCHANTING_TABLE, 0, null, TileEnchantingTable::class), "Enchanting Table")); self::register(new EndPortalFrame(new BID(Ids::END_PORTAL_FRAME), "End Portal Frame")); self::register(new EndRod(new BID(Ids::END_ROD), "End Rod")); - self::register(new Solid(new BID(Ids::END_STONE), "End Stone", new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 45.0))); + self::register(new Solid(new BID(Ids::END_STONE), "End Stone", new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 45.0))); - $endBrickBreakInfo = new BlockBreakInfo(0.8, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 4.0); + $endBrickBreakInfo = new BlockBreakInfo(0.8, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 4.0); self::register(new Solid(new BID(Ids::END_BRICKS), "End Stone Bricks", $endBrickBreakInfo)); self::register(new Stair(new BID(Ids::END_BRICK_STAIRS), "End Stone Brick Stairs", $endBrickBreakInfo)); @@ -172,8 +172,8 @@ class BlockFactory{ self::register(new GlassPane(new BID(Ids::GLASS_PANE), "Glass Pane")); self::register(new GlowingObsidian(new BID(Ids::GLOWINGOBSIDIAN), "Glowing Obsidian")); self::register(new Glowstone(new BID(Ids::GLOWSTONE), "Glowstone")); - self::register(new Solid(new BID(Ids::GOLD_BLOCK), "Gold Block", new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_IRON, 30.0))); - self::register(new Solid(new BID(Ids::GOLD_ORE), "Gold Ore", new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_IRON))); + self::register(new Solid(new BID(Ids::GOLD_BLOCK), "Gold Block", new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_IRON, 30.0))); + self::register(new Solid(new BID(Ids::GOLD_ORE), "Gold Ore", new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_IRON))); self::register(new Grass(new BID(Ids::GRASS), "Grass")); self::register(new GrassPath(new BID(Ids::GRASS_PATH), "Grass Path")); self::register(new Gravel(new BID(Ids::GRAVEL), "Gravel")); @@ -181,7 +181,7 @@ class BlockFactory{ self::register(new HardenedGlass(new BID(Ids::HARD_GLASS), "Hardened Glass")); self::register(new HardenedGlassPane(new BID(Ids::HARD_GLASS_PANE), "Hardened Glass Pane")); self::register(new HayBale(new BID(Ids::HAY_BALE), "Hay Bale")); - self::register(new Hopper(new BID(Ids::HOPPER_BLOCK, 0, ItemIds::HOPPER, TileHopper::class), "Hopper", new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 15.0))); + self::register(new Hopper(new BID(Ids::HOPPER_BLOCK, 0, ItemIds::HOPPER, TileHopper::class), "Hopper", new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 15.0))); self::register(new Ice(new BID(Ids::ICE), "Ice")); self::register(new class(new BID(Ids::MONSTER_EGG, Meta::INFESTED_STONE), "Infested Stone") extends InfestedStone{ public function getSilkTouchDrops(Item $item) : array{ @@ -218,14 +218,14 @@ class BlockFactory{ self::register(new Solid(new BID(Ids::INFO_UPDATE), "update!", $updateBlockBreakInfo)); self::register(new Solid(new BID(Ids::INFO_UPDATE2), "ate!upd", $updateBlockBreakInfo)); self::register(new Transparent(new BID(Ids::INVISIBLEBEDROCK), "Invisible Bedrock", BlockBreakInfo::indestructible())); - self::register(new Solid(new BID(Ids::IRON_BLOCK), "Iron Block", new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_STONE, 30.0))); - self::register(new Thin(new BID(Ids::IRON_BARS), "Iron Bars", new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 30.0))); - self::register(new Door(new BID(Ids::IRON_DOOR_BLOCK, 0, ItemIds::IRON_DOOR), "Iron Door", new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 25.0))); - self::register(new Solid(new BID(Ids::IRON_ORE), "Iron Ore", new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_STONE))); - self::register(new Trapdoor(new BID(Ids::IRON_TRAPDOOR), "Iron Trapdoor", new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 25.0))); + self::register(new Solid(new BID(Ids::IRON_BLOCK), "Iron Block", new BlockBreakInfo(5.0, BlockToolType::PICKAXE, TieredTool::TIER_STONE, 30.0))); + self::register(new Thin(new BID(Ids::IRON_BARS), "Iron Bars", new BlockBreakInfo(5.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0))); + self::register(new Door(new BID(Ids::IRON_DOOR_BLOCK, 0, ItemIds::IRON_DOOR), "Iron Door", new BlockBreakInfo(5.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 25.0))); + self::register(new Solid(new BID(Ids::IRON_ORE), "Iron Ore", new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_STONE))); + self::register(new Trapdoor(new BID(Ids::IRON_TRAPDOOR), "Iron Trapdoor", new BlockBreakInfo(5.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 25.0))); self::register(new ItemFrame(new BID(Ids::FRAME_BLOCK, 0, ItemIds::FRAME, TileItemFrame::class), "Item Frame")); self::register(new Ladder(new BID(Ids::LADDER), "Ladder")); - self::register(new Solid(new BID(Ids::LAPIS_BLOCK), "Lapis Lazuli Block", new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_STONE))); + self::register(new Solid(new BID(Ids::LAPIS_BLOCK), "Lapis Lazuli Block", new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_STONE))); self::register(new LapisOre(new BID(Ids::LAPIS_ORE), "Lapis Lazuli Ore")); self::register(new Lava(new BIDFlattened(Ids::FLOWING_LAVA, Ids::STILL_LAVA), "Lava")); self::register(new Lever(new BID(Ids::LEVER), "Lever")); @@ -236,7 +236,7 @@ class BlockFactory{ self::register(new MonsterSpawner(new BID(Ids::MOB_SPAWNER, 0, null, TileMonsterSpawner::class), "Monster Spawner")); self::register(new Mycelium(new BID(Ids::MYCELIUM), "Mycelium")); - $netherBrickBreakInfo = new BlockBreakInfo(2.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 30.0); + $netherBrickBreakInfo = new BlockBreakInfo(2.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0); self::register(new Solid(new BID(Ids::NETHER_BRICK_BLOCK), "Nether Bricks", $netherBrickBreakInfo)); self::register(new Solid(new BID(Ids::RED_NETHER_BRICK), "Red Nether Bricks", $netherBrickBreakInfo)); self::register(new Fence(new BID(Ids::NETHER_BRICK_FENCE), "Nether Brick Fence", $netherBrickBreakInfo)); @@ -249,13 +249,13 @@ class BlockFactory{ self::register(new NetherWartPlant(new BID(Ids::NETHER_WART_PLANT, 0, ItemIds::NETHER_WART), "Nether Wart")); self::register(new Netherrack(new BID(Ids::NETHERRACK), "Netherrack")); self::register(new Note(new BID(Ids::NOTEBLOCK, 0, null, TileNote::class), "Note Block")); - self::register(new Solid(new BID(Ids::OBSIDIAN), "Obsidian", new BlockBreakInfo(35.0 /* 50 in PC */, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_DIAMOND, 6000.0))); + self::register(new Solid(new BID(Ids::OBSIDIAN), "Obsidian", new BlockBreakInfo(35.0 /* 50 in PC */, BlockToolType::PICKAXE, TieredTool::TIER_DIAMOND, 6000.0))); self::register(new PackedIce(new BID(Ids::PACKED_ICE), "Packed Ice")); self::register(new Podzol(new BID(Ids::PODZOL), "Podzol")); self::register(new Potato(new BID(Ids::POTATOES), "Potato Block")); self::register(new PoweredRail(new BID(Ids::GOLDEN_RAIL, Meta::RAIL_STRAIGHT_NORTH_SOUTH), "Powered Rail")); - $prismarineBreakInfo = new BlockBreakInfo(1.5, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 30.0); + $prismarineBreakInfo = new BlockBreakInfo(1.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0); self::register(new Solid(new BID(Ids::PRISMARINE, Meta::PRISMARINE_BRICKS), "Prismarine Bricks", $prismarineBreakInfo)); self::register(new Stair(new BID(Ids::PRISMARINE_BRICKS_STAIRS), "Prismarine Bricks Stairs", $prismarineBreakInfo)); self::register(new Solid(new BID(Ids::PRISMARINE, Meta::PRISMARINE_DARK), "Dark Prismarine", $prismarineBreakInfo)); @@ -266,14 +266,14 @@ class BlockFactory{ self::register(new Pumpkin(new BID(Ids::PUMPKIN), "Pumpkin")); self::register(new PumpkinStem(new BID(Ids::PUMPKIN_STEM, 0, ItemIds::PUMPKIN_SEEDS), "Pumpkin Stem")); - $purpurBreakInfo = new BlockBreakInfo(1.5, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 30.0); + $purpurBreakInfo = new BlockBreakInfo(1.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0); self::register(new Solid(new BID(Ids::PURPUR_BLOCK, Meta::PURPUR_NORMAL), "Purpur Block", $purpurBreakInfo)); self::register(new class(new BID(Ids::PURPUR_BLOCK, Meta::PURPUR_PILLAR), "Purpur Pillar", $purpurBreakInfo) extends Solid{ use PillarRotationTrait; }); self::register(new Stair(new BID(Ids::PURPUR_STAIRS), "Purpur Stairs", $purpurBreakInfo)); - $quartzBreakInfo = new BlockBreakInfo(0.8, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN); + $quartzBreakInfo = new BlockBreakInfo(0.8, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN); self::register(new Solid(new BID(Ids::QUARTZ_BLOCK, Meta::QUARTZ_NORMAL), "Quartz Block", $quartzBreakInfo)); self::register(new Stair(new BID(Ids::QUARTZ_STAIRS), "Quartz Stairs", $quartzBreakInfo)); self::register(new class(new BID(Ids::QUARTZ_BLOCK, Meta::QUARTZ_CHISELED), "Chiseled Quartz Block", $quartzBreakInfo) extends Solid{ @@ -309,7 +309,7 @@ class BlockFactory{ self::register(new SoulSand(new BID(Ids::SOUL_SAND), "Soul Sand")); self::register(new Sponge(new BID(Ids::SPONGE), "Sponge")); - $stoneBreakInfo = new BlockBreakInfo(1.5, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 30.0); + $stoneBreakInfo = new BlockBreakInfo(1.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0); self::register(new class(new BID(Ids::STONE, Meta::STONE_NORMAL), "Stone", $stoneBreakInfo) extends Solid{ public function getDropsForCompatibleTool(Item $item) : array{ return [ItemFactory::get(Item::COBBLESTONE)]; @@ -339,7 +339,7 @@ class BlockFactory{ self::register(new StonePressurePlate(new BID(Ids::STONE_PRESSURE_PLATE), "Stone Pressure Plate")); //TODO: in the future this won't be the same for all the types - $stoneSlabBreakInfo = new BlockBreakInfo(2.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 30.0); + $stoneSlabBreakInfo = new BlockBreakInfo(2.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0); self::register(new Slab(new BIDFlattened(Ids::STONE_SLAB, Ids::DOUBLE_STONE_SLAB, Meta::STONE_SLAB_BRICK), "Brick", $stoneSlabBreakInfo)); self::register(new Slab(new BIDFlattened(Ids::STONE_SLAB, Ids::DOUBLE_STONE_SLAB, Meta::STONE_SLAB_COBBLESTONE), "Cobblestone", $stoneSlabBreakInfo)); self::register(new Slab(new BIDFlattened(Ids::STONE_SLAB, Ids::DOUBLE_STONE_SLAB, Meta::STONE_SLAB_FAKE_WOODEN), "Fake Wooden", $stoneSlabBreakInfo)); @@ -369,7 +369,7 @@ class BlockFactory{ self::register(new Slab(new BIDFlattened(Ids::STONE_SLAB4, Ids::DOUBLE_STONE_SLAB4, Meta::STONE_SLAB4_MOSSY_STONE_BRICK), "Mossy Stone Brick", $stoneSlabBreakInfo)); self::register(new Slab(new BIDFlattened(Ids::STONE_SLAB4, Ids::DOUBLE_STONE_SLAB4, Meta::STONE_SLAB4_SMOOTH_QUARTZ), "Smooth Quartz", $stoneSlabBreakInfo)); self::register(new Slab(new BIDFlattened(Ids::STONE_SLAB4, Ids::DOUBLE_STONE_SLAB4, Meta::STONE_SLAB4_STONE), "Stone", $stoneSlabBreakInfo)); - self::register(new Solid(new BID(Ids::STONECUTTER), "Stonecutter", new BlockBreakInfo(3.5, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN))); + self::register(new Solid(new BID(Ids::STONECUTTER), "Stonecutter", new BlockBreakInfo(3.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN))); self::register(new Sugarcane(new BID(Ids::REEDS_BLOCK, 0, ItemIds::REEDS), "Sugarcane")); self::register(new TNT(new BID(Ids::TNT), "TNT")); self::register(new TallGrass(new BID(Ids::TALLGRASS), "Fern")); //TODO: remap this to normal fern @@ -491,7 +491,7 @@ class BlockFactory{ Meta::SANDSTONE_CUT => "Cut ", Meta::SANDSTONE_SMOOTH => "Smooth " ]; - $sandstoneBreakInfo = new BlockBreakInfo(0.8, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN); + $sandstoneBreakInfo = new BlockBreakInfo(0.8, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN); self::register(new Stair(new BID(Ids::RED_SANDSTONE_STAIRS), "Red Sandstone Stairs", $sandstoneBreakInfo)); self::register(new Stair(new BID(Ids::SMOOTH_RED_SANDSTONE_STAIRS), "Smooth Red Sandstone Stairs", $sandstoneBreakInfo)); self::register(new Stair(new BID(Ids::SANDSTONE_STAIRS), "Sandstone Stairs", $sandstoneBreakInfo)); diff --git a/src/pocketmine/block/BlockToolType.php b/src/pocketmine/block/BlockToolType.php index 17670e1c79..ca58763594 100644 --- a/src/pocketmine/block/BlockToolType.php +++ b/src/pocketmine/block/BlockToolType.php @@ -29,11 +29,11 @@ namespace pocketmine\block; */ interface BlockToolType{ - public const TYPE_NONE = 0; - public const TYPE_SWORD = 1 << 0; - public const TYPE_SHOVEL = 1 << 1; - public const TYPE_PICKAXE = 1 << 2; - public const TYPE_AXE = 1 << 3; - public const TYPE_SHEARS = 1 << 4; + public const NONE = 0; + public const SWORD = 1 << 0; + public const SHOVEL = 1 << 1; + public const PICKAXE = 1 << 2; + public const AXE = 1 << 3; + public const SHEARS = 1 << 4; } diff --git a/src/pocketmine/block/BlueIce.php b/src/pocketmine/block/BlueIce.php index 07fa1c6902..bb6c0b152c 100644 --- a/src/pocketmine/block/BlueIce.php +++ b/src/pocketmine/block/BlueIce.php @@ -28,7 +28,7 @@ use pocketmine\item\Item; class BlueIce extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.8, BlockToolType::TYPE_PICKAXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.8, BlockToolType::PICKAXE)); } public function getLightLevel() : int{ diff --git a/src/pocketmine/block/BoneBlock.php b/src/pocketmine/block/BoneBlock.php index 4b95c222b6..36f8f751e9 100644 --- a/src/pocketmine/block/BoneBlock.php +++ b/src/pocketmine/block/BoneBlock.php @@ -30,6 +30,6 @@ class BoneBlock extends Solid{ use PillarRotationTrait; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } } diff --git a/src/pocketmine/block/Bookshelf.php b/src/pocketmine/block/Bookshelf.php index 30729420c9..aa49940c39 100644 --- a/src/pocketmine/block/Bookshelf.php +++ b/src/pocketmine/block/Bookshelf.php @@ -29,7 +29,7 @@ use pocketmine\item\ItemFactory; class Bookshelf extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.5, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.5, BlockToolType::AXE)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/BrewingStand.php b/src/pocketmine/block/BrewingStand.php index 1cfe4125ab..13ef6f11d4 100644 --- a/src/pocketmine/block/BrewingStand.php +++ b/src/pocketmine/block/BrewingStand.php @@ -39,7 +39,7 @@ class BrewingStand extends Transparent{ protected $southwestSlot = false; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } protected function writeStateToMeta() : int{ diff --git a/src/pocketmine/block/Chest.php b/src/pocketmine/block/Chest.php index baae80b328..e01ceae5df 100644 --- a/src/pocketmine/block/Chest.php +++ b/src/pocketmine/block/Chest.php @@ -38,7 +38,7 @@ class Chest extends Transparent{ protected $facing = Facing::NORTH; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.5, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.5, BlockToolType::AXE)); } protected function writeStateToMeta() : int{ diff --git a/src/pocketmine/block/Clay.php b/src/pocketmine/block/Clay.php index f32f808ce7..277e700f74 100644 --- a/src/pocketmine/block/Clay.php +++ b/src/pocketmine/block/Clay.php @@ -29,7 +29,7 @@ use pocketmine\item\ItemFactory; class Clay extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.6, BlockToolType::TYPE_SHOVEL)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.6, BlockToolType::SHOVEL)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/Coal.php b/src/pocketmine/block/Coal.php index 097b883ff8..1b7fae1d51 100644 --- a/src/pocketmine/block/Coal.php +++ b/src/pocketmine/block/Coal.php @@ -28,7 +28,7 @@ use pocketmine\item\TieredTool; class Coal extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 30.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(5.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0)); } public function getFuelTime() : int{ diff --git a/src/pocketmine/block/CoalOre.php b/src/pocketmine/block/CoalOre.php index 090509bbc3..45a693ee48 100644 --- a/src/pocketmine/block/CoalOre.php +++ b/src/pocketmine/block/CoalOre.php @@ -31,7 +31,7 @@ use function mt_rand; class CoalOre extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/Cobweb.php b/src/pocketmine/block/Cobweb.php index c3ea9447c5..012c2cf9d4 100644 --- a/src/pocketmine/block/Cobweb.php +++ b/src/pocketmine/block/Cobweb.php @@ -30,7 +30,7 @@ use pocketmine\item\ItemFactory; class Cobweb extends Flowable{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(4.0, BlockToolType::TYPE_SWORD | BlockToolType::TYPE_SHEARS, 1)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(4.0, BlockToolType::SWORD | BlockToolType::SHEARS, 1)); } public function hasEntityCollision() : bool{ diff --git a/src/pocketmine/block/CocoaBlock.php b/src/pocketmine/block/CocoaBlock.php index 06e2dfac7a..2995390d70 100644 --- a/src/pocketmine/block/CocoaBlock.php +++ b/src/pocketmine/block/CocoaBlock.php @@ -44,7 +44,7 @@ class CocoaBlock extends Transparent{ protected $age = 0; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.2, BlockToolType::TYPE_AXE, 0, 15.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.2, BlockToolType::AXE, 0, 15.0)); } protected function writeStateToMeta() : int{ diff --git a/src/pocketmine/block/Concrete.php b/src/pocketmine/block/Concrete.php index 38af139761..1ef4806c6b 100644 --- a/src/pocketmine/block/Concrete.php +++ b/src/pocketmine/block/Concrete.php @@ -28,6 +28,6 @@ use pocketmine\item\TieredTool; class Concrete extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.8, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.8, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } } diff --git a/src/pocketmine/block/ConcretePowder.php b/src/pocketmine/block/ConcretePowder.php index e18f1a9527..d4adec673e 100644 --- a/src/pocketmine/block/ConcretePowder.php +++ b/src/pocketmine/block/ConcretePowder.php @@ -33,7 +33,7 @@ class ConcretePowder extends Solid implements Fallable{ } public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_SHOVEL)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::SHOVEL)); } public function onNearbyBlockChange() : void{ diff --git a/src/pocketmine/block/CraftingTable.php b/src/pocketmine/block/CraftingTable.php index 453483a1b0..e63fd3f10f 100644 --- a/src/pocketmine/block/CraftingTable.php +++ b/src/pocketmine/block/CraftingTable.php @@ -31,7 +31,7 @@ use pocketmine\player\Player; class CraftingTable extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.5, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.5, BlockToolType::AXE)); } public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ diff --git a/src/pocketmine/block/DaylightSensor.php b/src/pocketmine/block/DaylightSensor.php index 596e71deee..27ec0ee768 100644 --- a/src/pocketmine/block/DaylightSensor.php +++ b/src/pocketmine/block/DaylightSensor.php @@ -45,7 +45,7 @@ class DaylightSensor extends Transparent{ protected $inverted = false; public function __construct(BlockIdentifierFlattened $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.2, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.2, BlockToolType::AXE)); } public function getId() : int{ diff --git a/src/pocketmine/block/DeadBush.php b/src/pocketmine/block/DeadBush.php index 19ff078c09..0239a7afb0 100644 --- a/src/pocketmine/block/DeadBush.php +++ b/src/pocketmine/block/DeadBush.php @@ -34,7 +34,7 @@ use function mt_rand; class DeadBush extends Flowable{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? BlockBreakInfo::instant(BlockToolType::TYPE_SHEARS, 1)); + parent::__construct($idInfo, $name, $breakInfo ?? BlockBreakInfo::instant(BlockToolType::SHEARS, 1)); } public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ diff --git a/src/pocketmine/block/DiamondOre.php b/src/pocketmine/block/DiamondOre.php index e872f78d8b..546e292542 100644 --- a/src/pocketmine/block/DiamondOre.php +++ b/src/pocketmine/block/DiamondOre.php @@ -31,7 +31,7 @@ use function mt_rand; class DiamondOre extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_IRON)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_IRON)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/Dirt.php b/src/pocketmine/block/Dirt.php index f1db0380e8..75ecc73eec 100644 --- a/src/pocketmine/block/Dirt.php +++ b/src/pocketmine/block/Dirt.php @@ -32,7 +32,7 @@ use pocketmine\player\Player; class Dirt extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_SHOVEL)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::SHOVEL)); } public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ diff --git a/src/pocketmine/block/DoubleTallGrass.php b/src/pocketmine/block/DoubleTallGrass.php index c0b5d858fe..662b4ca269 100644 --- a/src/pocketmine/block/DoubleTallGrass.php +++ b/src/pocketmine/block/DoubleTallGrass.php @@ -30,7 +30,7 @@ use function mt_rand; class DoubleTallGrass extends DoublePlant{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? BlockBreakInfo::instant(BlockToolType::TYPE_SHEARS, 1)); + parent::__construct($idInfo, $name, $breakInfo ?? BlockBreakInfo::instant(BlockToolType::SHEARS, 1)); } public function canBeReplaced() : bool{ diff --git a/src/pocketmine/block/DragonEgg.php b/src/pocketmine/block/DragonEgg.php index f90fb3da74..b2bd03efed 100644 --- a/src/pocketmine/block/DragonEgg.php +++ b/src/pocketmine/block/DragonEgg.php @@ -40,7 +40,7 @@ class DragonEgg extends Transparent implements Fallable{ use FallableTrait; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } public function getLightLevel() : int{ diff --git a/src/pocketmine/block/EmeraldOre.php b/src/pocketmine/block/EmeraldOre.php index d9d48df4af..178b34e2e7 100644 --- a/src/pocketmine/block/EmeraldOre.php +++ b/src/pocketmine/block/EmeraldOre.php @@ -31,7 +31,7 @@ use function mt_rand; class EmeraldOre extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_IRON)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_IRON)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/EnchantingTable.php b/src/pocketmine/block/EnchantingTable.php index 5afb805a51..96af742a2d 100644 --- a/src/pocketmine/block/EnchantingTable.php +++ b/src/pocketmine/block/EnchantingTable.php @@ -34,7 +34,7 @@ use pocketmine\player\Player; class EnchantingTable extends Transparent{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 6000.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(5.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 6000.0)); } protected function recalculateBoundingBox() : ?AxisAlignedBB{ diff --git a/src/pocketmine/block/EnderChest.php b/src/pocketmine/block/EnderChest.php index 17287b49c8..4902b46f41 100644 --- a/src/pocketmine/block/EnderChest.php +++ b/src/pocketmine/block/EnderChest.php @@ -40,7 +40,7 @@ class EnderChest extends Transparent{ protected $facing = Facing::NORTH; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(22.5, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 3000.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(22.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 3000.0)); } protected function writeStateToMeta() : int{ diff --git a/src/pocketmine/block/Farmland.php b/src/pocketmine/block/Farmland.php index 70a5353305..95398761c1 100644 --- a/src/pocketmine/block/Farmland.php +++ b/src/pocketmine/block/Farmland.php @@ -35,7 +35,7 @@ class Farmland extends Transparent{ protected $wetness = 0; //"moisture" blockstate property in PC public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.6, BlockToolType::TYPE_SHOVEL)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.6, BlockToolType::SHOVEL)); } protected function writeStateToMeta() : int{ diff --git a/src/pocketmine/block/FenceGate.php b/src/pocketmine/block/FenceGate.php index 41ae3543ba..3146a9470c 100644 --- a/src/pocketmine/block/FenceGate.php +++ b/src/pocketmine/block/FenceGate.php @@ -42,7 +42,7 @@ class FenceGate extends Transparent{ protected $inWall = false; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::AXE)); } protected function writeStateToMeta() : int{ diff --git a/src/pocketmine/block/FrostedIce.php b/src/pocketmine/block/FrostedIce.php index c1effff0ff..e3220ea9dc 100644 --- a/src/pocketmine/block/FrostedIce.php +++ b/src/pocketmine/block/FrostedIce.php @@ -33,7 +33,7 @@ class FrostedIce extends Ice{ protected $age = 0; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.5, BlockToolType::TYPE_PICKAXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.5, BlockToolType::PICKAXE)); } public function readStateFromData(int $id, int $stateMeta) : void{ diff --git a/src/pocketmine/block/Furnace.php b/src/pocketmine/block/Furnace.php index 404df7f19d..b242958ccc 100644 --- a/src/pocketmine/block/Furnace.php +++ b/src/pocketmine/block/Furnace.php @@ -42,7 +42,7 @@ class Furnace extends Solid{ protected $lit = false; //this is set based on the blockID public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.5, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } public function getId() : int{ diff --git a/src/pocketmine/block/GlazedTerracotta.php b/src/pocketmine/block/GlazedTerracotta.php index 196d6d10d6..781492db79 100644 --- a/src/pocketmine/block/GlazedTerracotta.php +++ b/src/pocketmine/block/GlazedTerracotta.php @@ -38,7 +38,7 @@ class GlazedTerracotta extends Solid{ protected $facing = Facing::NORTH; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.4, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.4, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } protected function writeStateToMeta() : int{ diff --git a/src/pocketmine/block/GlowingObsidian.php b/src/pocketmine/block/GlowingObsidian.php index 4f63de52dd..9dfb73b300 100644 --- a/src/pocketmine/block/GlowingObsidian.php +++ b/src/pocketmine/block/GlowingObsidian.php @@ -29,7 +29,7 @@ use pocketmine\item\TieredTool; class GlowingObsidian extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(10.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_DIAMOND, 50.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(10.0, BlockToolType::PICKAXE, TieredTool::TIER_DIAMOND, 50.0)); } public function getLightLevel() : int{ diff --git a/src/pocketmine/block/Glowstone.php b/src/pocketmine/block/Glowstone.php index c09ab8437f..9b8501fdb2 100644 --- a/src/pocketmine/block/Glowstone.php +++ b/src/pocketmine/block/Glowstone.php @@ -30,7 +30,7 @@ use function mt_rand; class Glowstone extends Transparent{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.3, BlockToolType::TYPE_PICKAXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.3, BlockToolType::PICKAXE)); } public function getLightLevel() : int{ diff --git a/src/pocketmine/block/Grass.php b/src/pocketmine/block/Grass.php index aa89356969..cc0d6588fe 100644 --- a/src/pocketmine/block/Grass.php +++ b/src/pocketmine/block/Grass.php @@ -39,7 +39,7 @@ use function mt_rand; class Grass extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.6, BlockToolType::TYPE_SHOVEL)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.6, BlockToolType::SHOVEL)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/GrassPath.php b/src/pocketmine/block/GrassPath.php index de41bbf38f..640da5dafb 100644 --- a/src/pocketmine/block/GrassPath.php +++ b/src/pocketmine/block/GrassPath.php @@ -31,7 +31,7 @@ use pocketmine\math\Facing; class GrassPath extends Transparent{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.6, BlockToolType::TYPE_SHOVEL)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.6, BlockToolType::SHOVEL)); } protected function recalculateBoundingBox() : ?AxisAlignedBB{ diff --git a/src/pocketmine/block/Gravel.php b/src/pocketmine/block/Gravel.php index 01b3ddd6eb..2303883609 100644 --- a/src/pocketmine/block/Gravel.php +++ b/src/pocketmine/block/Gravel.php @@ -33,7 +33,7 @@ class Gravel extends Solid implements Fallable{ use FallableTrait; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.6, BlockToolType::TYPE_SHOVEL)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.6, BlockToolType::SHOVEL)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/HardenedClay.php b/src/pocketmine/block/HardenedClay.php index 88902b756b..8c46c4ad1e 100644 --- a/src/pocketmine/block/HardenedClay.php +++ b/src/pocketmine/block/HardenedClay.php @@ -28,6 +28,6 @@ use pocketmine\item\TieredTool; class HardenedClay extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.25, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 21.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.25, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 21.0)); } } diff --git a/src/pocketmine/block/Ice.php b/src/pocketmine/block/Ice.php index d62193cc35..893a347824 100644 --- a/src/pocketmine/block/Ice.php +++ b/src/pocketmine/block/Ice.php @@ -30,7 +30,7 @@ use pocketmine\player\Player; class Ice extends Transparent{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_PICKAXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::PICKAXE)); } public function getLightFilter() : int{ diff --git a/src/pocketmine/block/Ladder.php b/src/pocketmine/block/Ladder.php index 2440ac50a7..632e712647 100644 --- a/src/pocketmine/block/Ladder.php +++ b/src/pocketmine/block/Ladder.php @@ -38,7 +38,7 @@ class Ladder extends Transparent{ protected $facing = Facing::NORTH; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.4, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.4, BlockToolType::AXE)); } protected function writeStateToMeta() : int{ diff --git a/src/pocketmine/block/LapisOre.php b/src/pocketmine/block/LapisOre.php index a9554559d7..b401b9c6bf 100644 --- a/src/pocketmine/block/LapisOre.php +++ b/src/pocketmine/block/LapisOre.php @@ -31,7 +31,7 @@ use function mt_rand; class LapisOre extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_STONE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_STONE)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/Leaves.php b/src/pocketmine/block/Leaves.php index a8c9d05375..864f0e3d3f 100644 --- a/src/pocketmine/block/Leaves.php +++ b/src/pocketmine/block/Leaves.php @@ -44,7 +44,7 @@ class Leaves extends Transparent{ protected $checkDecay = false; public function __construct(BlockIdentifier $idInfo, string $name, TreeType $treeType, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.2, BlockToolType::TYPE_SHEARS)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.2, BlockToolType::SHEARS)); $this->treeType = $treeType; } @@ -118,7 +118,7 @@ class Leaves extends Transparent{ } public function getDrops(Item $item) : array{ - if($item->getBlockToolType() & BlockToolType::TYPE_SHEARS){ + if($item->getBlockToolType() & BlockToolType::SHEARS){ return $this->getDropsForCompatibleTool($item); } diff --git a/src/pocketmine/block/Magma.php b/src/pocketmine/block/Magma.php index 266bd5fe9e..887dba1b37 100644 --- a/src/pocketmine/block/Magma.php +++ b/src/pocketmine/block/Magma.php @@ -31,7 +31,7 @@ use pocketmine\item\TieredTool; class Magma extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } public function getLightLevel() : int{ diff --git a/src/pocketmine/block/Melon.php b/src/pocketmine/block/Melon.php index 3a08773fbb..ee5424ce8c 100644 --- a/src/pocketmine/block/Melon.php +++ b/src/pocketmine/block/Melon.php @@ -30,7 +30,7 @@ use function mt_rand; class Melon extends Transparent{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.0, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.0, BlockToolType::AXE)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/MonsterSpawner.php b/src/pocketmine/block/MonsterSpawner.php index ca38aae65d..d545b0427c 100644 --- a/src/pocketmine/block/MonsterSpawner.php +++ b/src/pocketmine/block/MonsterSpawner.php @@ -30,7 +30,7 @@ use function mt_rand; class MonsterSpawner extends Transparent{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(5.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/Mycelium.php b/src/pocketmine/block/Mycelium.php index 40027b93a8..ef5ac71c30 100644 --- a/src/pocketmine/block/Mycelium.php +++ b/src/pocketmine/block/Mycelium.php @@ -32,7 +32,7 @@ use function mt_rand; class Mycelium extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.6, BlockToolType::TYPE_SHOVEL)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.6, BlockToolType::SHOVEL)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/NetherQuartzOre.php b/src/pocketmine/block/NetherQuartzOre.php index a72851d1e2..f8d4ebdfe4 100644 --- a/src/pocketmine/block/NetherQuartzOre.php +++ b/src/pocketmine/block/NetherQuartzOre.php @@ -31,7 +31,7 @@ use function mt_rand; class NetherQuartzOre extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/NetherReactor.php b/src/pocketmine/block/NetherReactor.php index f144f1c28c..47f8048d24 100644 --- a/src/pocketmine/block/NetherReactor.php +++ b/src/pocketmine/block/NetherReactor.php @@ -34,7 +34,7 @@ class NetherReactor extends Solid{ protected $state = BlockLegacyMetadata::NETHER_REACTOR_INACTIVE; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } protected function writeStateToMeta() : int{ diff --git a/src/pocketmine/block/Netherrack.php b/src/pocketmine/block/Netherrack.php index e5e84dd113..a6a3f70e60 100644 --- a/src/pocketmine/block/Netherrack.php +++ b/src/pocketmine/block/Netherrack.php @@ -28,7 +28,7 @@ use pocketmine\item\TieredTool; class Netherrack extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.4, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.4, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } public function burnsForever() : bool{ diff --git a/src/pocketmine/block/Note.php b/src/pocketmine/block/Note.php index d9be134765..ca298c5516 100644 --- a/src/pocketmine/block/Note.php +++ b/src/pocketmine/block/Note.php @@ -34,7 +34,7 @@ class Note extends Solid{ private $pitch = self::MIN_PITCH; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.8, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.8, BlockToolType::AXE)); } public function readStateFromWorld() : void{ diff --git a/src/pocketmine/block/PackedIce.php b/src/pocketmine/block/PackedIce.php index 298ce4bb3d..a5bca2726f 100644 --- a/src/pocketmine/block/PackedIce.php +++ b/src/pocketmine/block/PackedIce.php @@ -28,7 +28,7 @@ use pocketmine\item\Item; class PackedIce extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_PICKAXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::PICKAXE)); } public function getFrictionFactor() : float{ diff --git a/src/pocketmine/block/Planks.php b/src/pocketmine/block/Planks.php index 9da5889c79..593d21147a 100644 --- a/src/pocketmine/block/Planks.php +++ b/src/pocketmine/block/Planks.php @@ -26,7 +26,7 @@ namespace pocketmine\block; class Planks extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::TYPE_AXE, 0, 15.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::AXE, 0, 15.0)); } public function getFuelTime() : int{ diff --git a/src/pocketmine/block/Podzol.php b/src/pocketmine/block/Podzol.php index df2f931dda..20e55c1b01 100644 --- a/src/pocketmine/block/Podzol.php +++ b/src/pocketmine/block/Podzol.php @@ -26,6 +26,6 @@ namespace pocketmine\block; class Podzol extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.5, BlockToolType::TYPE_SHOVEL)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.5, BlockToolType::SHOVEL)); } } diff --git a/src/pocketmine/block/Pumpkin.php b/src/pocketmine/block/Pumpkin.php index 335835630a..568b366f12 100644 --- a/src/pocketmine/block/Pumpkin.php +++ b/src/pocketmine/block/Pumpkin.php @@ -37,7 +37,7 @@ class Pumpkin extends Solid{ protected $facing = Facing::NORTH; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.0, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.0, BlockToolType::AXE)); } public function readStateFromData(int $id, int $stateMeta) : void{ diff --git a/src/pocketmine/block/RedMushroomBlock.php b/src/pocketmine/block/RedMushroomBlock.php index 409e946532..68786a7886 100644 --- a/src/pocketmine/block/RedMushroomBlock.php +++ b/src/pocketmine/block/RedMushroomBlock.php @@ -38,7 +38,7 @@ class RedMushroomBlock extends Solid{ protected $rotationData = 0; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.2, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.2, BlockToolType::AXE)); } protected function writeStateToMeta() : int{ diff --git a/src/pocketmine/block/Redstone.php b/src/pocketmine/block/Redstone.php index 7195844bb6..b4400b0c14 100644 --- a/src/pocketmine/block/Redstone.php +++ b/src/pocketmine/block/Redstone.php @@ -28,6 +28,6 @@ use pocketmine\item\TieredTool; class Redstone extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 30.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(5.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0)); } } diff --git a/src/pocketmine/block/RedstoneOre.php b/src/pocketmine/block/RedstoneOre.php index 863c4fea83..b4b42873c3 100644 --- a/src/pocketmine/block/RedstoneOre.php +++ b/src/pocketmine/block/RedstoneOre.php @@ -38,7 +38,7 @@ class RedstoneOre extends Solid{ protected $lit = false; public function __construct(BlockIdentifierFlattened $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_IRON)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::PICKAXE, TieredTool::TIER_IRON)); } public function getId() : int{ diff --git a/src/pocketmine/block/Sand.php b/src/pocketmine/block/Sand.php index 1a5101921e..ce13cabcce 100644 --- a/src/pocketmine/block/Sand.php +++ b/src/pocketmine/block/Sand.php @@ -30,7 +30,7 @@ class Sand extends Solid implements Fallable{ use FallableTrait; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_SHOVEL)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::SHOVEL)); } public function tickFalling() : ?Block{ diff --git a/src/pocketmine/block/Sign.php b/src/pocketmine/block/Sign.php index a865d80ef0..21639cea6d 100644 --- a/src/pocketmine/block/Sign.php +++ b/src/pocketmine/block/Sign.php @@ -55,7 +55,7 @@ class Sign extends Transparent{ protected $text; public function __construct(BlockIdentifierFlattened $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.0, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(1.0, BlockToolType::AXE)); $this->text = new SignText(); } diff --git a/src/pocketmine/block/Snow.php b/src/pocketmine/block/Snow.php index dea7b5d61e..b88474ce18 100644 --- a/src/pocketmine/block/Snow.php +++ b/src/pocketmine/block/Snow.php @@ -30,7 +30,7 @@ use pocketmine\item\TieredTool; class Snow extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.2, BlockToolType::TYPE_SHOVEL, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.2, BlockToolType::SHOVEL, TieredTool::TIER_WOODEN)); } public function getDropsForCompatibleTool(Item $item) : array{ diff --git a/src/pocketmine/block/SnowLayer.php b/src/pocketmine/block/SnowLayer.php index 80c2827014..1960eea1b0 100644 --- a/src/pocketmine/block/SnowLayer.php +++ b/src/pocketmine/block/SnowLayer.php @@ -44,7 +44,7 @@ class SnowLayer extends Flowable implements Fallable{ protected $layers = 1; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.1, BlockToolType::TYPE_SHOVEL, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.1, BlockToolType::SHOVEL, TieredTool::TIER_WOODEN)); } protected function writeStateToMeta() : int{ diff --git a/src/pocketmine/block/SoulSand.php b/src/pocketmine/block/SoulSand.php index bcf2fb4faf..b613a9f5ed 100644 --- a/src/pocketmine/block/SoulSand.php +++ b/src/pocketmine/block/SoulSand.php @@ -29,7 +29,7 @@ use pocketmine\math\Facing; class SoulSand extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_SHOVEL)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::SHOVEL)); } protected function recalculateBoundingBox() : ?AxisAlignedBB{ diff --git a/src/pocketmine/block/StoneButton.php b/src/pocketmine/block/StoneButton.php index 36bbefec79..d92a3552ff 100644 --- a/src/pocketmine/block/StoneButton.php +++ b/src/pocketmine/block/StoneButton.php @@ -26,7 +26,7 @@ namespace pocketmine\block; class StoneButton extends Button{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_PICKAXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::PICKAXE)); } protected function getActivationTime() : int{ diff --git a/src/pocketmine/block/StonePressurePlate.php b/src/pocketmine/block/StonePressurePlate.php index 411b5e0fa6..a6c1c0de63 100644 --- a/src/pocketmine/block/StonePressurePlate.php +++ b/src/pocketmine/block/StonePressurePlate.php @@ -28,6 +28,6 @@ use pocketmine\item\TieredTool; class StonePressurePlate extends SimplePressurePlate{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } } diff --git a/src/pocketmine/block/TallGrass.php b/src/pocketmine/block/TallGrass.php index 13c054410c..bdc093688d 100644 --- a/src/pocketmine/block/TallGrass.php +++ b/src/pocketmine/block/TallGrass.php @@ -34,7 +34,7 @@ use function mt_rand; class TallGrass extends Flowable{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? BlockBreakInfo::instant(BlockToolType::TYPE_SHEARS, 1)); + parent::__construct($idInfo, $name, $breakInfo ?? BlockBreakInfo::instant(BlockToolType::SHEARS, 1)); } public function canBeReplaced() : bool{ diff --git a/src/pocketmine/block/Vine.php b/src/pocketmine/block/Vine.php index 4c320540e0..a3706442c0 100644 --- a/src/pocketmine/block/Vine.php +++ b/src/pocketmine/block/Vine.php @@ -40,7 +40,7 @@ class Vine extends Flowable{ protected $faces = []; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.2, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.2, BlockToolType::AXE)); } protected function writeStateToMeta() : int{ @@ -144,7 +144,7 @@ class Vine extends Flowable{ } public function getDrops(Item $item) : array{ - if($item->getBlockToolType() & BlockToolType::TYPE_SHEARS){ + if($item->getBlockToolType() & BlockToolType::SHEARS){ return $this->getDropsForCompatibleTool($item); } diff --git a/src/pocketmine/block/Wall.php b/src/pocketmine/block/Wall.php index dd9ffdc656..e4462767dc 100644 --- a/src/pocketmine/block/Wall.php +++ b/src/pocketmine/block/Wall.php @@ -35,7 +35,7 @@ class Wall extends Transparent{ protected $up = false; public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 30.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN, 30.0)); } public function readStateFromWorld() : void{ diff --git a/src/pocketmine/block/WeightedPressurePlateHeavy.php b/src/pocketmine/block/WeightedPressurePlateHeavy.php index 00220d80c8..40fd3c507b 100644 --- a/src/pocketmine/block/WeightedPressurePlateHeavy.php +++ b/src/pocketmine/block/WeightedPressurePlateHeavy.php @@ -28,6 +28,6 @@ use pocketmine\item\TieredTool; class WeightedPressurePlateHeavy extends WeightedPressurePlate{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } } diff --git a/src/pocketmine/block/WeightedPressurePlateLight.php b/src/pocketmine/block/WeightedPressurePlateLight.php index 54cf57f5f8..44b2f41e28 100644 --- a/src/pocketmine/block/WeightedPressurePlateLight.php +++ b/src/pocketmine/block/WeightedPressurePlateLight.php @@ -28,6 +28,6 @@ use pocketmine\item\TieredTool; class WeightedPressurePlateLight extends WeightedPressurePlate{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::PICKAXE, TieredTool::TIER_WOODEN)); } } diff --git a/src/pocketmine/block/Wood.php b/src/pocketmine/block/Wood.php index 2882c002c1..31bbeb7df0 100644 --- a/src/pocketmine/block/Wood.php +++ b/src/pocketmine/block/Wood.php @@ -31,7 +31,7 @@ class Wood extends Solid{ private $treeType; public function __construct(BlockIdentifier $idInfo, string $name, TreeType $treeType, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::AXE)); $this->treeType = $treeType; } diff --git a/src/pocketmine/block/WoodenButton.php b/src/pocketmine/block/WoodenButton.php index 0cbec1f93b..9cfdb0dc71 100644 --- a/src/pocketmine/block/WoodenButton.php +++ b/src/pocketmine/block/WoodenButton.php @@ -26,7 +26,7 @@ namespace pocketmine\block; class WoodenButton extends Button{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::AXE)); } protected function getActivationTime() : int{ diff --git a/src/pocketmine/block/WoodenDoor.php b/src/pocketmine/block/WoodenDoor.php index 1686a7c820..4edd42a41b 100644 --- a/src/pocketmine/block/WoodenDoor.php +++ b/src/pocketmine/block/WoodenDoor.php @@ -26,6 +26,6 @@ namespace pocketmine\block; class WoodenDoor extends Door{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::AXE)); } } diff --git a/src/pocketmine/block/WoodenFence.php b/src/pocketmine/block/WoodenFence.php index eec484a7f1..070c36a1a8 100644 --- a/src/pocketmine/block/WoodenFence.php +++ b/src/pocketmine/block/WoodenFence.php @@ -26,7 +26,7 @@ namespace pocketmine\block; class WoodenFence extends Fence{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::TYPE_AXE, 0, 15.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::AXE, 0, 15.0)); } public function getFuelTime() : int{ diff --git a/src/pocketmine/block/WoodenPressurePlate.php b/src/pocketmine/block/WoodenPressurePlate.php index 996ec27d1b..4e624d2812 100644 --- a/src/pocketmine/block/WoodenPressurePlate.php +++ b/src/pocketmine/block/WoodenPressurePlate.php @@ -26,7 +26,7 @@ namespace pocketmine\block; class WoodenPressurePlate extends SimplePressurePlate{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::TYPE_AXE)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(0.5, BlockToolType::AXE)); } public function getFuelTime() : int{ diff --git a/src/pocketmine/block/WoodenSlab.php b/src/pocketmine/block/WoodenSlab.php index 474036490a..9c713c2ac2 100644 --- a/src/pocketmine/block/WoodenSlab.php +++ b/src/pocketmine/block/WoodenSlab.php @@ -26,7 +26,7 @@ namespace pocketmine\block; class WoodenSlab extends Slab{ public function __construct(BlockIdentifierFlattened $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::TYPE_AXE, 0, 15.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::AXE, 0, 15.0)); } public function getFuelTime() : int{ diff --git a/src/pocketmine/block/WoodenStairs.php b/src/pocketmine/block/WoodenStairs.php index 09d7ab2b25..2550d91a6d 100644 --- a/src/pocketmine/block/WoodenStairs.php +++ b/src/pocketmine/block/WoodenStairs.php @@ -26,7 +26,7 @@ namespace pocketmine\block; class WoodenStairs extends Stair{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::TYPE_AXE, 0, 15.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(2.0, BlockToolType::AXE, 0, 15.0)); } public function getFlameEncouragement() : int{ diff --git a/src/pocketmine/block/WoodenTrapdoor.php b/src/pocketmine/block/WoodenTrapdoor.php index ace3a2baae..07a73872ca 100644 --- a/src/pocketmine/block/WoodenTrapdoor.php +++ b/src/pocketmine/block/WoodenTrapdoor.php @@ -26,7 +26,7 @@ namespace pocketmine\block; class WoodenTrapdoor extends Trapdoor{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::TYPE_AXE, 0, 15.0)); + parent::__construct($idInfo, $name, $breakInfo ?? new BlockBreakInfo(3.0, BlockToolType::AXE, 0, 15.0)); } public function getFuelTime() : int{ diff --git a/src/pocketmine/block/Wool.php b/src/pocketmine/block/Wool.php index c13ad3af0d..63f6bf531a 100644 --- a/src/pocketmine/block/Wool.php +++ b/src/pocketmine/block/Wool.php @@ -28,10 +28,10 @@ use pocketmine\item\Item; class Wool extends Solid{ public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){ - parent::__construct($idInfo, $name, $breakInfo ?? new class(0.8, BlockToolType::TYPE_SHEARS) extends BlockBreakInfo{ + parent::__construct($idInfo, $name, $breakInfo ?? new class(0.8, BlockToolType::SHEARS) extends BlockBreakInfo{ public function getBreakTime(Item $item) : float{ $time = parent::getBreakTime($item); - if($item->getBlockToolType() === BlockToolType::TYPE_SHEARS){ + if($item->getBlockToolType() === BlockToolType::SHEARS){ $time *= 3; //shears break compatible blocks 15x faster, but wool 5x } diff --git a/src/pocketmine/item/Axe.php b/src/pocketmine/item/Axe.php index 08c08f953f..816f464445 100644 --- a/src/pocketmine/item/Axe.php +++ b/src/pocketmine/item/Axe.php @@ -30,7 +30,7 @@ use pocketmine\entity\Entity; class Axe extends TieredTool{ public function getBlockToolType() : int{ - return BlockToolType::TYPE_AXE; + return BlockToolType::AXE; } public function getBlockToolHarvestLevel() : int{ diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index 0f6257b5fb..7a4c2aca10 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -595,7 +595,7 @@ class Item implements ItemIds, \JsonSerializable{ * @return int */ public function getBlockToolType() : int{ - return BlockToolType::TYPE_NONE; + return BlockToolType::NONE; } /** diff --git a/src/pocketmine/item/Pickaxe.php b/src/pocketmine/item/Pickaxe.php index d5b49c3fa2..76fbd49d1c 100644 --- a/src/pocketmine/item/Pickaxe.php +++ b/src/pocketmine/item/Pickaxe.php @@ -30,7 +30,7 @@ use pocketmine\entity\Entity; class Pickaxe extends TieredTool{ public function getBlockToolType() : int{ - return BlockToolType::TYPE_PICKAXE; + return BlockToolType::PICKAXE; } public function getBlockToolHarvestLevel() : int{ diff --git a/src/pocketmine/item/Shears.php b/src/pocketmine/item/Shears.php index bc99b02b6c..888b6ce759 100644 --- a/src/pocketmine/item/Shears.php +++ b/src/pocketmine/item/Shears.php @@ -33,7 +33,7 @@ class Shears extends Tool{ } public function getBlockToolType() : int{ - return BlockToolType::TYPE_SHEARS; + return BlockToolType::SHEARS; } public function getBlockToolHarvestLevel() : int{ diff --git a/src/pocketmine/item/Shovel.php b/src/pocketmine/item/Shovel.php index d9a1b0f500..f3afc9494e 100644 --- a/src/pocketmine/item/Shovel.php +++ b/src/pocketmine/item/Shovel.php @@ -30,7 +30,7 @@ use pocketmine\entity\Entity; class Shovel extends TieredTool{ public function getBlockToolType() : int{ - return BlockToolType::TYPE_SHOVEL; + return BlockToolType::SHOVEL; } public function getBlockToolHarvestLevel() : int{ diff --git a/src/pocketmine/item/Sword.php b/src/pocketmine/item/Sword.php index 5f801461d4..24c46a36e2 100644 --- a/src/pocketmine/item/Sword.php +++ b/src/pocketmine/item/Sword.php @@ -30,7 +30,7 @@ use pocketmine\entity\Entity; class Sword extends TieredTool{ public function getBlockToolType() : int{ - return BlockToolType::TYPE_SWORD; + return BlockToolType::SWORD; } public function getAttackPoints() : int{