mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Added serialize/deserialize support for stonecutter
This commit is contained in:
parent
567bd8e330
commit
901a51a9dd
@ -108,6 +108,7 @@ use pocketmine\block\StainedHardenedGlass;
|
||||
use pocketmine\block\StainedHardenedGlassPane;
|
||||
use pocketmine\block\Stair;
|
||||
use pocketmine\block\StoneButton;
|
||||
use pocketmine\block\Stonecutter;
|
||||
use pocketmine\block\StonePressurePlate;
|
||||
use pocketmine\block\Sugarcane;
|
||||
use pocketmine\block\SweetBerryBush;
|
||||
@ -994,6 +995,8 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
|
||||
->writeColor($block->getColor());
|
||||
});
|
||||
$this->map(Blocks::STONE(), fn() => Helper::encodeStone(StringValues::STONE_TYPE_STONE));
|
||||
$this->map(Blocks::STONECUTTER(), fn(Stonecutter $block) => Writer::create(Ids::STONECUTTER_BLOCK)
|
||||
->writeHorizontalFacing($block->getFacing()));
|
||||
$this->map(Blocks::STONE_BRICKS(), fn() => Helper::encodeStoneBricks(StringValues::STONE_BRICK_TYPE_DEFAULT));
|
||||
$this->map(Blocks::STONE_BRICK_SLAB(), fn(Slab $block) => Helper::encodeStoneSlab1($block, StringValues::STONE_SLAB_TYPE_STONE_BRICK));
|
||||
$this->map(Blocks::STONE_BRICK_STAIRS(), fn(Stair $block) => Helper::encodeStairs($block, new Writer(Ids::STONE_BRICK_STAIRS)));
|
||||
|
@ -932,6 +932,10 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
|
||||
};
|
||||
});
|
||||
$this->map(Ids::STONECUTTER, fn() => Blocks::LEGACY_STONECUTTER());
|
||||
$this->map(Ids::STONECUTTER_BLOCK, function(Reader $in) : Block{
|
||||
return Blocks::STONECUTTER()
|
||||
->setFacing($in->readHorizontalFacing());
|
||||
});
|
||||
$this->map(Ids::STRIPPED_ACACIA_LOG, function(Reader $in) : Block{
|
||||
return Blocks::STRIPPED_ACACIA_LOG()
|
||||
->setAxis($in->readPillarAxis());
|
||||
@ -2181,12 +2185,6 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
|
||||
* facing_direction (IntTag) = 0, 1, 2, 3, 4, 5
|
||||
*/
|
||||
//});
|
||||
//$this->map(Ids::STONECUTTER_BLOCK, function(Reader $in) : Block{
|
||||
/*
|
||||
* TODO: Un-implemented block
|
||||
* facing_direction (IntTag) = 0, 1, 2, 3, 4, 5
|
||||
*/
|
||||
//});
|
||||
//$this->map(Ids::STRIPPED_CRIMSON_HYPHAE, function(Reader $in) : Block{
|
||||
/*
|
||||
* TODO: Un-implemented block
|
||||
|
Loading…
x
Reference in New Issue
Block a user