fixed match indentations

This commit is contained in:
Dylan K. Taylor 2022-02-01 05:28:52 +00:00
parent fe7d942500
commit 1a800cf4df
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -242,22 +242,22 @@ final class BlockStateSerializer{
return Writer::create(Ids::ANVIL) return Writer::create(Ids::ANVIL)
->writeLegacyHorizontalFacing($block->getFacing()) ->writeLegacyHorizontalFacing($block->getFacing())
->writeString(BlockStateNames::DAMAGE, match($damage = $block->getDamage()){ ->writeString(BlockStateNames::DAMAGE, match($damage = $block->getDamage()){
0 => StringValues::DAMAGE_UNDAMAGED, 0 => StringValues::DAMAGE_UNDAMAGED,
1 => StringValues::DAMAGE_SLIGHTLY_DAMAGED, 1 => StringValues::DAMAGE_SLIGHTLY_DAMAGED,
2 => StringValues::DAMAGE_VERY_DAMAGED, 2 => StringValues::DAMAGE_VERY_DAMAGED,
default => throw new BlockStateSerializeException("Invalid Anvil damage {$damage}"), default => throw new BlockStateSerializeException("Invalid Anvil damage {$damage}"),
}); });
}); });
$this->map(VanillaBlocks::AZURE_BLUET(), fn() => Helper::encodeRedFlower(StringValues::FLOWER_TYPE_HOUSTONIA)); $this->map(VanillaBlocks::AZURE_BLUET(), fn() => Helper::encodeRedFlower(StringValues::FLOWER_TYPE_HOUSTONIA));
$this->map(VanillaBlocks::BAMBOO(), function(Bamboo $block) : Writer{ $this->map(VanillaBlocks::BAMBOO(), function(Bamboo $block) : Writer{
return Writer::create(Ids::BAMBOO) return Writer::create(Ids::BAMBOO)
->writeBool(BlockStateNames::AGE_BIT, $block->isReady()) ->writeBool(BlockStateNames::AGE_BIT, $block->isReady())
->writeString(BlockStateNames::BAMBOO_LEAF_SIZE, match($block->getLeafSize()){ ->writeString(BlockStateNames::BAMBOO_LEAF_SIZE, match($block->getLeafSize()){
Bamboo::NO_LEAVES => StringValues::BAMBOO_LEAF_SIZE_NO_LEAVES, Bamboo::NO_LEAVES => StringValues::BAMBOO_LEAF_SIZE_NO_LEAVES,
Bamboo::SMALL_LEAVES => StringValues::BAMBOO_LEAF_SIZE_SMALL_LEAVES, Bamboo::SMALL_LEAVES => StringValues::BAMBOO_LEAF_SIZE_SMALL_LEAVES,
Bamboo::LARGE_LEAVES => StringValues::BAMBOO_LEAF_SIZE_LARGE_LEAVES, Bamboo::LARGE_LEAVES => StringValues::BAMBOO_LEAF_SIZE_LARGE_LEAVES,
default => throw new BlockStateSerializeException("Invalid Bamboo leaf thickness " . $block->getLeafSize()), default => throw new BlockStateSerializeException("Invalid Bamboo leaf thickness " . $block->getLeafSize()),
}) })
->writeString(BlockStateNames::BAMBOO_STALK_THICKNESS, $block->isThick() ? StringValues::BAMBOO_STALK_THICKNESS_THICK : StringValues::BAMBOO_STALK_THICKNESS_THIN); ->writeString(BlockStateNames::BAMBOO_STALK_THICKNESS, $block->isThick() ? StringValues::BAMBOO_STALK_THICKNESS_THICK : StringValues::BAMBOO_STALK_THICKNESS_THIN);
}); });
$this->map(VanillaBlocks::BAMBOO_SAPLING(), function(BambooSapling $block) : Writer{ $this->map(VanillaBlocks::BAMBOO_SAPLING(), function(BambooSapling $block) : Writer{
@ -400,10 +400,10 @@ final class BlockStateSerializer{
return Writer::create($block->isDead() ? Ids::CORAL_FAN_DEAD : Ids::CORAL_FAN) return Writer::create($block->isDead() ? Ids::CORAL_FAN_DEAD : Ids::CORAL_FAN)
->writeCoralType($block->getCoralType()) ->writeCoralType($block->getCoralType())
->writeInt(BlockStateNames::CORAL_FAN_DIRECTION, match($axis = $block->getAxis()){ ->writeInt(BlockStateNames::CORAL_FAN_DIRECTION, match($axis = $block->getAxis()){
Axis::X => 0, Axis::X => 0,
Axis::Z => 1, Axis::Z => 1,
default => throw new BlockStateSerializeException("Invalid axis {$axis}"), default => throw new BlockStateSerializeException("Invalid axis {$axis}"),
}); });
}); });
$this->map(VanillaBlocks::CORNFLOWER(), fn() => Helper::encodeRedFlower(StringValues::FLOWER_TYPE_CORNFLOWER)); $this->map(VanillaBlocks::CORNFLOWER(), fn() => Helper::encodeRedFlower(StringValues::FLOWER_TYPE_CORNFLOWER));
$this->map(VanillaBlocks::CRACKED_STONE_BRICKS(), fn() => Helper::encodeStoneBricks(StringValues::STONE_BRICK_TYPE_CRACKED)); $this->map(VanillaBlocks::CRACKED_STONE_BRICKS(), fn() => Helper::encodeStoneBricks(StringValues::STONE_BRICK_TYPE_CRACKED));
@ -722,16 +722,16 @@ final class BlockStateSerializer{
return Writer::create(Ids::LEVER) return Writer::create(Ids::LEVER)
->writeBool(BlockStateNames::OPEN_BIT, $block->isActivated()) ->writeBool(BlockStateNames::OPEN_BIT, $block->isActivated())
->writeString(BlockStateNames::LEVER_DIRECTION, match($block->getFacing()->id()){ ->writeString(BlockStateNames::LEVER_DIRECTION, match($block->getFacing()->id()){
LeverFacing::DOWN_AXIS_Z()->id() => StringValues::LEVER_DIRECTION_DOWN_NORTH_SOUTH, LeverFacing::DOWN_AXIS_Z()->id() => StringValues::LEVER_DIRECTION_DOWN_NORTH_SOUTH,
LeverFacing::DOWN_AXIS_X()->id() => StringValues::LEVER_DIRECTION_DOWN_EAST_WEST, LeverFacing::DOWN_AXIS_X()->id() => StringValues::LEVER_DIRECTION_DOWN_EAST_WEST,
LeverFacing::UP_AXIS_Z()->id() => StringValues::LEVER_DIRECTION_UP_NORTH_SOUTH, LeverFacing::UP_AXIS_Z()->id() => StringValues::LEVER_DIRECTION_UP_NORTH_SOUTH,
LeverFacing::UP_AXIS_X()->id() => StringValues::LEVER_DIRECTION_UP_EAST_WEST, LeverFacing::UP_AXIS_X()->id() => StringValues::LEVER_DIRECTION_UP_EAST_WEST,
LeverFacing::NORTH()->id() => StringValues::LEVER_DIRECTION_NORTH, LeverFacing::NORTH()->id() => StringValues::LEVER_DIRECTION_NORTH,
LeverFacing::SOUTH()->id() => StringValues::LEVER_DIRECTION_SOUTH, LeverFacing::SOUTH()->id() => StringValues::LEVER_DIRECTION_SOUTH,
LeverFacing::WEST()->id() => StringValues::LEVER_DIRECTION_WEST, LeverFacing::WEST()->id() => StringValues::LEVER_DIRECTION_WEST,
LeverFacing::EAST()->id() => StringValues::LEVER_DIRECTION_EAST, LeverFacing::EAST()->id() => StringValues::LEVER_DIRECTION_EAST,
default => throw new BlockStateSerializeException("Invalid Lever facing " . $block->getFacing()->name()), default => throw new BlockStateSerializeException("Invalid Lever facing " . $block->getFacing()->name()),
}); });
}); });
$this->map(VanillaBlocks::LIGHT_BLUE_GLAZED_TERRACOTTA(), fn(GlazedTerracotta $block) => Helper::encodeGlazedTerracotta($block, new Writer(Ids::LIGHT_BLUE_GLAZED_TERRACOTTA))); $this->map(VanillaBlocks::LIGHT_BLUE_GLAZED_TERRACOTTA(), fn(GlazedTerracotta $block) => Helper::encodeGlazedTerracotta($block, new Writer(Ids::LIGHT_BLUE_GLAZED_TERRACOTTA)));
$this->map(VanillaBlocks::LIGHT_GRAY_GLAZED_TERRACOTTA(), fn(GlazedTerracotta $block) => Helper::encodeGlazedTerracotta($block, new Writer(Ids::SILVER_GLAZED_TERRACOTTA))); $this->map(VanillaBlocks::LIGHT_GRAY_GLAZED_TERRACOTTA(), fn(GlazedTerracotta $block) => Helper::encodeGlazedTerracotta($block, new Writer(Ids::SILVER_GLAZED_TERRACOTTA)));
@ -778,10 +778,10 @@ final class BlockStateSerializer{
$this->map(VanillaBlocks::NETHER_PORTAL(), function(NetherPortal $block) : Writer{ $this->map(VanillaBlocks::NETHER_PORTAL(), function(NetherPortal $block) : Writer{
return Writer::create(Ids::PORTAL) return Writer::create(Ids::PORTAL)
->writeString(BlockStateNames::PORTAL_AXIS, match($block->getAxis()){ ->writeString(BlockStateNames::PORTAL_AXIS, match($block->getAxis()){
Axis::X => StringValues::PORTAL_AXIS_X, Axis::X => StringValues::PORTAL_AXIS_X,
Axis::Z => StringValues::PORTAL_AXIS_Z, Axis::Z => StringValues::PORTAL_AXIS_Z,
default => throw new BlockStateSerializeException("Invalid Nether Portal axis " . $block->getAxis()), default => throw new BlockStateSerializeException("Invalid Nether Portal axis " . $block->getAxis()),
}); });
}); });
$this->map(VanillaBlocks::NETHER_QUARTZ_ORE(), fn() => new Writer(Ids::QUARTZ_ORE)); $this->map(VanillaBlocks::NETHER_QUARTZ_ORE(), fn() => new Writer(Ids::QUARTZ_ORE));
$this->map(VanillaBlocks::NETHER_REACTOR_CORE(), fn() => new Writer(Ids::NETHERREACTOR)); $this->map(VanillaBlocks::NETHER_REACTOR_CORE(), fn() => new Writer(Ids::NETHERREACTOR));