mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-15 16:05:28 +00:00
shorten BlockToolType constants
This commit is contained in:
parent
85051554c4
commit
ee885bb725
@ -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{
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
@ -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{
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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{
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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{
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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{
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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{
|
||||
|
@ -595,7 +595,7 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
* @return int
|
||||
*/
|
||||
public function getBlockToolType() : int{
|
||||
return BlockToolType::TYPE_NONE;
|
||||
return BlockToolType::NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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{
|
||||
|
@ -33,7 +33,7 @@ class Shears extends Tool{
|
||||
}
|
||||
|
||||
public function getBlockToolType() : int{
|
||||
return BlockToolType::TYPE_SHEARS;
|
||||
return BlockToolType::SHEARS;
|
||||
}
|
||||
|
||||
public function getBlockToolHarvestLevel() : int{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user