Added deepslate, cobbled/tiles/bricks walls/slabs/stairs/cubes

This commit is contained in:
Dylan K. Taylor 2022-07-03 01:43:27 +01:00
parent c7ba791ff8
commit 89632f3514
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
7 changed files with 125 additions and 2 deletions

View File

@ -880,6 +880,33 @@ class BlockFactory{
$this->register(new Opaque(new BID(Ids::RAW_COPPER), "Raw Copper Block", new BreakInfo(5, ToolType::PICKAXE, ToolTier::STONE()->getHarvestLevel())));
$this->register(new Opaque(new BID(Ids::RAW_GOLD), "Raw Gold Block", new BreakInfo(5, ToolType::PICKAXE, ToolTier::IRON()->getHarvestLevel())));
$this->register(new Opaque(new BID(Ids::RAW_IRON), "Raw Iron Block", new BreakInfo(5, ToolType::PICKAXE, ToolTier::STONE()->getHarvestLevel())));
//TODO: check blast resistance
$deepslateBreakInfo = new BreakInfo(3, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel());
$this->register(new SimplePillar(new BID(Ids::DEEPSLATE), "Deepslate", $deepslateBreakInfo));
//TODO: check blast resistance
$deepslateBrickBreakInfo = new BreakInfo(3.5, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel());
$this->register(new Opaque(new BID(Ids::DEEPSLATE_BRICKS), "Deepslate Bricks", $deepslateBrickBreakInfo));
$this->register(new Slab(new BID(Ids::DEEPSLATE_BRICK_SLAB), "Deepslate Brick", $deepslateBrickBreakInfo));
$this->register(new Stair(new BID(Ids::DEEPSLATE_BRICK_STAIRS), "Deepslate Brick Stairs", $deepslateBrickBreakInfo));
$this->register(new Wall(new BID(Ids::DEEPSLATE_BRICK_WALL), "Deepslate Brick Wall", $deepslateBrickBreakInfo));
$this->register(new Opaque(new BID(Ids::CRACKED_DEEPSLATE_BRICKS), "Cracked Deepslate Bricks", $deepslateBrickBreakInfo));
//TODO: check blast resistance
$deepslateTilesBreakInfo = new BreakInfo(3.5, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel());
$this->register(new Opaque(new BID(Ids::DEEPSLATE_TILES), "Deepslate Tiles", $deepslateTilesBreakInfo));
$this->register(new Slab(new BID(Ids::DEEPSLATE_TILE_SLAB), "Deepslate Tile", $deepslateTilesBreakInfo));
$this->register(new Stair(new BID(Ids::DEEPSLATE_TILE_STAIRS), "Deepslate Tile Stairs", $deepslateTilesBreakInfo));
$this->register(new Wall(new BID(Ids::DEEPSLATE_TILE_WALL), "Deepslate Tile Wall", $deepslateTilesBreakInfo));
$this->register(new Opaque(new BID(Ids::CRACKED_DEEPSLATE_TILES), "Cracked Deepslate Tiles", $deepslateTilesBreakInfo));
//TODO: check blast resistance
$cobbledDeepslateBreakInfo = new BreakInfo(3.5, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel());
$this->register(new Opaque(new BID(Ids::COBBLED_DEEPSLATE), "Cobbled Deepslate", $cobbledDeepslateBreakInfo));
$this->register(new Slab(new BID(Ids::COBBLED_DEEPSLATE_SLAB), "Cobbled Deepslate", $cobbledDeepslateBreakInfo));
$this->register(new Stair(new BID(Ids::COBBLED_DEEPSLATE_STAIRS), "Cobbled Deepslate Stairs", $cobbledDeepslateBreakInfo));
$this->register(new Wall(new BID(Ids::COBBLED_DEEPSLATE_WALL), "Cobbled Deepslate Wall", $cobbledDeepslateBreakInfo));
}
/**

View File

@ -590,6 +590,21 @@ final class BlockTypeIds{
public const RAW_GOLD = 10563;
public const RAW_IRON = 10564;
public const CALCITE = 10565;
public const DEEPSLATE = 10566;
public const DEEPSLATE_BRICKS = 10567;
public const DEEPSLATE_BRICK_SLAB = 10568;
public const DEEPSLATE_BRICK_STAIRS = 10569;
public const DEEPSLATE_BRICK_WALL = 10570;
public const CRACKED_DEEPSLATE_BRICKS = 10571;
public const DEEPSLATE_TILES = 10572;
public const DEEPSLATE_TILE_SLAB = 10573;
public const DEEPSLATE_TILE_STAIRS = 10574;
public const DEEPSLATE_TILE_WALL = 10575;
public const CRACKED_DEEPSLATE_TILES = 10576;
public const COBBLED_DEEPSLATE = 10577;
public const COBBLED_DEEPSLATE_SLAB = 10578;
public const COBBLED_DEEPSLATE_STAIRS = 10579;
public const COBBLED_DEEPSLATE_WALL = 10580;
public const FIRST_UNUSED_BLOCK_ID = 10566;
public const FIRST_UNUSED_BLOCK_ID = 10581;
}

View File

@ -118,6 +118,10 @@ use pocketmine\utils\CloningRegistryTrait;
* @method static Clay CLAY()
* @method static Coal COAL()
* @method static CoalOre COAL_ORE()
* @method static Opaque COBBLED_DEEPSLATE()
* @method static Slab COBBLED_DEEPSLATE_SLAB()
* @method static Stair COBBLED_DEEPSLATE_STAIRS()
* @method static Wall COBBLED_DEEPSLATE_WALL()
* @method static Opaque COBBLESTONE()
* @method static Slab COBBLESTONE_SLAB()
* @method static Stair COBBLESTONE_STAIRS()
@ -131,6 +135,8 @@ use pocketmine\utils\CloningRegistryTrait;
* @method static CoralBlock CORAL_BLOCK()
* @method static FloorCoralFan CORAL_FAN()
* @method static Flower CORNFLOWER()
* @method static Opaque CRACKED_DEEPSLATE_BRICKS()
* @method static Opaque CRACKED_DEEPSLATE_TILES()
* @method static Opaque CRACKED_POLISHED_BLACKSTONE_BRICKS()
* @method static Opaque CRACKED_STONE_BRICKS()
* @method static CraftingTable CRAFTING_TABLE()
@ -159,6 +165,15 @@ use pocketmine\utils\CloningRegistryTrait;
* @method static Stair DARK_PRISMARINE_STAIRS()
* @method static DaylightSensor DAYLIGHT_SENSOR()
* @method static DeadBush DEAD_BUSH()
* @method static SimplePillar DEEPSLATE()
* @method static Opaque DEEPSLATE_BRICKS()
* @method static Slab DEEPSLATE_BRICK_SLAB()
* @method static Stair DEEPSLATE_BRICK_STAIRS()
* @method static Wall DEEPSLATE_BRICK_WALL()
* @method static Opaque DEEPSLATE_TILES()
* @method static Slab DEEPSLATE_TILE_SLAB()
* @method static Stair DEEPSLATE_TILE_STAIRS()
* @method static Wall DEEPSLATE_TILE_WALL()
* @method static DetectorRail DETECTOR_RAIL()
* @method static Opaque DIAMOND()
* @method static DiamondOre DIAMOND_ORE()
@ -680,6 +695,10 @@ final class VanillaBlocks{
self::register("clay", $factory->get(Ids::CLAY, 0));
self::register("coal", $factory->get(Ids::COAL, 0));
self::register("coal_ore", $factory->get(Ids::COAL_ORE, 0));
self::register("cobbled_deepslate", $factory->get(Ids::COBBLED_DEEPSLATE, 0));
self::register("cobbled_deepslate_slab", $factory->get(Ids::COBBLED_DEEPSLATE_SLAB, 0));
self::register("cobbled_deepslate_stairs", $factory->get(Ids::COBBLED_DEEPSLATE_STAIRS, 0));
self::register("cobbled_deepslate_wall", $factory->get(Ids::COBBLED_DEEPSLATE_WALL, 0));
self::register("cobblestone", $factory->get(Ids::COBBLESTONE, 0));
self::register("cobblestone_slab", $factory->get(Ids::COBBLESTONE_SLAB, 0));
self::register("cobblestone_stairs", $factory->get(Ids::COBBLESTONE_STAIRS, 0));
@ -693,6 +712,8 @@ final class VanillaBlocks{
self::register("coral_block", $factory->get(Ids::CORAL_BLOCK, 4));
self::register("coral_fan", $factory->get(Ids::CORAL_FAN, 4));
self::register("cornflower", $factory->get(Ids::CORNFLOWER, 0));
self::register("cracked_deepslate_bricks", $factory->get(Ids::CRACKED_DEEPSLATE_BRICKS, 0));
self::register("cracked_deepslate_tiles", $factory->get(Ids::CRACKED_DEEPSLATE_TILES, 0));
self::register("cracked_polished_blackstone_bricks", $factory->get(Ids::CRACKED_POLISHED_BLACKSTONE_BRICKS, 0));
self::register("cracked_stone_bricks", $factory->get(Ids::CRACKED_STONE_BRICKS, 0));
self::register("crafting_table", $factory->get(Ids::CRAFTING_TABLE, 0));
@ -721,6 +742,15 @@ final class VanillaBlocks{
self::register("dark_prismarine_stairs", $factory->get(Ids::DARK_PRISMARINE_STAIRS, 0));
self::register("daylight_sensor", $factory->get(Ids::DAYLIGHT_SENSOR, 0));
self::register("dead_bush", $factory->get(Ids::DEAD_BUSH, 0));
self::register("deepslate", $factory->get(Ids::DEEPSLATE, 2));
self::register("deepslate_brick_slab", $factory->get(Ids::DEEPSLATE_BRICK_SLAB, 0));
self::register("deepslate_brick_stairs", $factory->get(Ids::DEEPSLATE_BRICK_STAIRS, 0));
self::register("deepslate_brick_wall", $factory->get(Ids::DEEPSLATE_BRICK_WALL, 0));
self::register("deepslate_bricks", $factory->get(Ids::DEEPSLATE_BRICKS, 0));
self::register("deepslate_tile_slab", $factory->get(Ids::DEEPSLATE_TILE_SLAB, 0));
self::register("deepslate_tile_stairs", $factory->get(Ids::DEEPSLATE_TILE_STAIRS, 0));
self::register("deepslate_tile_wall", $factory->get(Ids::DEEPSLATE_TILE_WALL, 0));
self::register("deepslate_tiles", $factory->get(Ids::DEEPSLATE_TILES, 0));
self::register("detector_rail", $factory->get(Ids::DETECTOR_RAIL, 0));
self::register("diamond", $factory->get(Ids::DIAMOND, 0));
self::register("diamond_ore", $factory->get(Ids::DIAMOND_ORE, 0));

View File

@ -408,6 +408,10 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
$this->mapSimple(Blocks::CLAY(), Ids::CLAY);
$this->mapSimple(Blocks::COAL(), Ids::COAL_BLOCK);
$this->mapSimple(Blocks::COAL_ORE(), Ids::COAL_ORE);
$this->mapSimple(Blocks::COBBLED_DEEPSLATE(), Ids::COBBLED_DEEPSLATE);
$this->mapSlab(Blocks::COBBLED_DEEPSLATE_SLAB(), Ids::COBBLED_DEEPSLATE_SLAB, Ids::COBBLED_DEEPSLATE_DOUBLE_SLAB);
$this->mapStairs(Blocks::COBBLED_DEEPSLATE_STAIRS(), Ids::COBBLED_DEEPSLATE_STAIRS);
$this->map(Blocks::COBBLED_DEEPSLATE_WALL(), fn(Wall $block) => Helper::encodeWall($block, new Writer(Ids::COBBLED_DEEPSLATE_WALL)));
$this->mapSimple(Blocks::COBBLESTONE(), Ids::COBBLESTONE);
$this->map(Blocks::COBBLESTONE_SLAB(), fn(Slab $block) => Helper::encodeStoneSlab1($block, StringValues::STONE_SLAB_TYPE_COBBLESTONE));
$this->mapStairs(Blocks::COBBLESTONE_STAIRS(), Ids::STONE_STAIRS);
@ -447,6 +451,8 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
});
});
$this->map(Blocks::CORNFLOWER(), fn() => Helper::encodeRedFlower(StringValues::FLOWER_TYPE_CORNFLOWER));
$this->mapSimple(Blocks::CRACKED_DEEPSLATE_BRICKS(), Ids::CRACKED_DEEPSLATE_BRICKS);
$this->mapSimple(Blocks::CRACKED_DEEPSLATE_TILES(), Ids::CRACKED_DEEPSLATE_TILES);
$this->mapSimple(Blocks::CRACKED_POLISHED_BLACKSTONE_BRICKS(), Ids::CRACKED_POLISHED_BLACKSTONE_BRICKS);
$this->map(Blocks::CRACKED_STONE_BRICKS(), fn() => Helper::encodeStoneBricks(StringValues::STONE_BRICK_TYPE_CRACKED));
$this->mapSimple(Blocks::CRAFTING_TABLE(), Ids::CRAFTING_TABLE);
@ -481,6 +487,18 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
->writeInt(StateNames::REDSTONE_SIGNAL, $block->getOutputSignalStrength());
});
$this->mapSimple(Blocks::DEAD_BUSH(), Ids::DEADBUSH);
$this->map(Blocks::DEEPSLATE(), function(SimplePillar $block) : Writer{
return Writer::create(Ids::DEEPSLATE)
->writePillarAxis($block->getAxis());
});
$this->mapSimple(Blocks::DEEPSLATE_BRICKS(), Ids::DEEPSLATE_BRICKS);
$this->mapSlab(Blocks::DEEPSLATE_BRICK_SLAB(), Ids::DEEPSLATE_BRICK_SLAB, Ids::DEEPSLATE_BRICK_DOUBLE_SLAB);
$this->mapStairs(Blocks::DEEPSLATE_BRICK_STAIRS(), Ids::DEEPSLATE_BRICK_STAIRS);
$this->map(Blocks::DEEPSLATE_BRICK_WALL(), fn(Wall $block) => Helper::encodeWall($block, new Writer(Ids::DEEPSLATE_BRICK_WALL)));
$this->mapSimple(Blocks::DEEPSLATE_TILES(), Ids::DEEPSLATE_TILES);
$this->mapSlab(Blocks::DEEPSLATE_TILE_SLAB(), Ids::DEEPSLATE_TILE_SLAB, Ids::DEEPSLATE_TILE_DOUBLE_SLAB);
$this->mapStairs(Blocks::DEEPSLATE_TILE_STAIRS(), Ids::DEEPSLATE_TILE_STAIRS);
$this->map(Blocks::DEEPSLATE_TILE_WALL(), fn(Wall $block) => Helper::encodeWall($block, new Writer(Ids::DEEPSLATE_TILE_WALL)));
$this->map(Blocks::DETECTOR_RAIL(), function(DetectorRail $block) : Writer{
return Writer::create(Ids::DETECTOR_RAIL)
->writeBool(StateNames::RAIL_DATA_BIT, $block->isActivated())

View File

@ -239,6 +239,10 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
$this->map(Ids::CLAY, fn() => Blocks::CLAY());
$this->map(Ids::COAL_BLOCK, fn() => Blocks::COAL());
$this->map(Ids::COAL_ORE, fn() => Blocks::COAL_ORE());
$this->map(Ids::COBBLED_DEEPSLATE, fn() => Blocks::COBBLED_DEEPSLATE());
$this->mapSlab(Ids::COBBLED_DEEPSLATE_SLAB, Ids::COBBLED_DEEPSLATE_DOUBLE_SLAB, fn() => Blocks::COBBLED_DEEPSLATE_SLAB());
$this->mapStairs(Ids::COBBLED_DEEPSLATE_STAIRS, fn() => Blocks::COBBLED_DEEPSLATE_STAIRS());
$this->map(Ids::COBBLED_DEEPSLATE_WALL, fn(Reader $in) => Helper::decodeWall(Blocks::COBBLED_DEEPSLATE_WALL(), $in));
$this->map(Ids::COBBLESTONE, fn() => Blocks::COBBLESTONE());
$this->map(Ids::COBBLESTONE_WALL, fn(Reader $in) => Helper::mapLegacyWallType($in));
$this->map(Ids::COCOA, function(Reader $in) : Block{
@ -289,6 +293,8 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
return Helper::decodeWallCoralFan(Blocks::WALL_CORAL_FAN(), $in)
->setCoralType(CoralType::HORN());
});
$this->map(Ids::CRACKED_DEEPSLATE_BRICKS, fn() => Blocks::CRACKED_DEEPSLATE_BRICKS());
$this->map(Ids::CRACKED_DEEPSLATE_TILES, fn() => Blocks::CRACKED_DEEPSLATE_TILES());
$this->map(Ids::CRACKED_POLISHED_BLACKSTONE_BRICKS, fn() => Blocks::CRACKED_POLISHED_BLACKSTONE_BRICKS());
$this->map(Ids::CRAFTING_TABLE, fn() => Blocks::CRAFTING_TABLE());
$this->map(Ids::CYAN_GLAZED_TERRACOTTA, fn(Reader $in) => Helper::decodeGlazedTerracotta(DyeColor::CYAN(), $in));
@ -306,6 +312,18 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
$this->map(Ids::DAYLIGHT_DETECTOR_INVERTED, fn(Reader $in) => Helper::decodeDaylightSensor(Blocks::DAYLIGHT_SENSOR(), $in)
->setInverted(true));
$this->map(Ids::DEADBUSH, fn() => Blocks::DEAD_BUSH());
$this->map(Ids::DEEPSLATE, function(Reader $in) : Block{
return Blocks::DEEPSLATE()
->setAxis($in->readPillarAxis());
});
$this->map(Ids::DEEPSLATE_BRICKS, fn() => Blocks::DEEPSLATE_BRICKS());
$this->mapSlab(Ids::DEEPSLATE_BRICK_SLAB, Ids::DEEPSLATE_BRICK_DOUBLE_SLAB, fn() => Blocks::DEEPSLATE_BRICK_SLAB());
$this->mapStairs(Ids::DEEPSLATE_BRICK_STAIRS, fn() => Blocks::DEEPSLATE_BRICK_STAIRS());
$this->map(Ids::DEEPSLATE_BRICK_WALL, fn(Reader $in) => Helper::decodeWall(Blocks::DEEPSLATE_BRICK_WALL(), $in));
$this->map(Ids::DEEPSLATE_TILES, fn() => Blocks::DEEPSLATE_TILES());
$this->mapSlab(Ids::DEEPSLATE_TILE_SLAB, Ids::DEEPSLATE_TILE_DOUBLE_SLAB, fn() => Blocks::DEEPSLATE_TILE_SLAB());
$this->mapStairs(Ids::DEEPSLATE_TILE_STAIRS, fn() => Blocks::DEEPSLATE_TILE_STAIRS());
$this->map(Ids::DEEPSLATE_TILE_WALL, fn(Reader $in) => Helper::decodeWall(Blocks::DEEPSLATE_TILE_WALL(), $in));
$this->map(Ids::DETECTOR_RAIL, function(Reader $in) : Block{
return Blocks::DETECTOR_RAIL()
->setActivated($in->readBool(StateNames::RAIL_DATA_BIT))

View File

@ -188,6 +188,10 @@ final class StringToItemParser extends StringToTParser{
$result->registerBlock("cobble", fn() => Blocks::COBBLESTONE());
$result->registerBlock("cobble_stairs", fn() => Blocks::COBBLESTONE_STAIRS());
$result->registerBlock("cobble_wall", fn() => Blocks::COBBLESTONE_WALL());
$result->registerBlock("cobbled_deepslate", fn() => Blocks::COBBLED_DEEPSLATE());
$result->registerBlock("cobbled_deepslate_slab", fn() => Blocks::COBBLED_DEEPSLATE_SLAB());
$result->registerBlock("cobbled_deepslate_stairs", fn() => Blocks::COBBLED_DEEPSLATE_STAIRS());
$result->registerBlock("cobbled_deepslate_wall", fn() => Blocks::COBBLED_DEEPSLATE_WALL());
$result->registerBlock("cobblestone", fn() => Blocks::COBBLESTONE());
$result->registerBlock("cobblestone_slab", fn() => Blocks::COBBLESTONE_SLAB());
$result->registerBlock("cobblestone_stairs", fn() => Blocks::COBBLESTONE_STAIRS());
@ -213,6 +217,8 @@ final class StringToItemParser extends StringToTParser{
$result->registerBlock("coral_fan_hang2", fn() => Blocks::WALL_CORAL_FAN()->setCoralType(CoralType::BUBBLE()));
$result->registerBlock("coral_fan_hang3", fn() => Blocks::WALL_CORAL_FAN()->setCoralType(CoralType::HORN()));
$result->registerBlock("cornflower", fn() => Blocks::CORNFLOWER());
$result->registerBlock("cracked_deepslate_bricks", fn() => Blocks::CRACKED_DEEPSLATE_BRICKS());
$result->registerBlock("cracked_deepslate_tiles", fn() => Blocks::CRACKED_DEEPSLATE_TILES());
$result->registerBlock("cracked_polished_blackstone_bricks", fn() => Blocks::CRACKED_POLISHED_BLACKSTONE_BRICKS());
$result->registerBlock("cracked_stone_bricks", fn() => Blocks::CRACKED_STONE_BRICKS());
$result->registerBlock("crafting_table", fn() => Blocks::CRAFTING_TABLE());
@ -254,6 +260,15 @@ final class StringToItemParser extends StringToTParser{
$result->registerBlock("daylight_sensor_inverted", fn() => Blocks::DAYLIGHT_SENSOR()->setInverted(true));
$result->registerBlock("dead_bush", fn() => Blocks::DEAD_BUSH());
$result->registerBlock("deadbush", fn() => Blocks::DEAD_BUSH());
$result->registerBlock("deepslate", fn() => Blocks::DEEPSLATE());
$result->registerBlock("deepslate_bricks", fn() => Blocks::DEEPSLATE_BRICKS());
$result->registerBlock("deepslate_brick_slab", fn() => Blocks::DEEPSLATE_BRICK_SLAB());
$result->registerBlock("deepslate_brick_stairs", fn() => Blocks::DEEPSLATE_BRICK_STAIRS());
$result->registerBlock("deepslate_brick_wall", fn() => Blocks::DEEPSLATE_BRICK_WALL());
$result->registerBlock("deepslate_tiles", fn() => Blocks::DEEPSLATE_TILES());
$result->registerBlock("deepslate_tile_slab", fn() => Blocks::DEEPSLATE_TILE_SLAB());
$result->registerBlock("deepslate_tile_stairs", fn() => Blocks::DEEPSLATE_TILE_STAIRS());
$result->registerBlock("deepslate_tile_wall", fn() => Blocks::DEEPSLATE_TILE_WALL());
$result->registerBlock("detector_rail", fn() => Blocks::DETECTOR_RAIL());
$result->registerBlock("diamond_block", fn() => Blocks::DIAMOND());
$result->registerBlock("diamond_ore", fn() => Blocks::DIAMOND_ORE());

File diff suppressed because one or more lines are too long