Added cartography and smithing tables

these have working inventories, and their crafting menus will 'just work' once the items for the associated recipes have been implemented (maps, netherite).
This commit is contained in:
Dylan K. Taylor
2022-07-14 18:01:47 +01:00
parent 91719051e2
commit eb8fb63409
14 changed files with 202 additions and 9 deletions

View File

@ -443,6 +443,7 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
->writeColor($block->getColor());
});
$this->map(Blocks::CARROTS(), fn(Carrot $block) => Helper::encodeCrops($block, new Writer(Ids::CARROTS)));
$this->mapSimple(Blocks::CARTOGRAPHY_TABLE(), Ids::CARTOGRAPHY_TABLE);
$this->map(Blocks::CARVED_PUMPKIN(), function(CarvedPumpkin $block) : Writer{
return Writer::create(Ids::CARVED_PUMPKIN)
->writeLegacyHorizontalFacing($block->getFacing());
@ -1205,6 +1206,7 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
$this->mapSimple(Blocks::SHROOMLIGHT(), Ids::SHROOMLIGHT);
$this->mapSimple(Blocks::SHULKER_BOX(), Ids::UNDYED_SHULKER_BOX);
$this->mapSimple(Blocks::SLIME(), Ids::SLIME);
$this->mapSimple(Blocks::SMITHING_TABLE(), Ids::SMITHING_TABLE);
$this->map(Blocks::SMOKER(), fn(Furnace $block) => Helper::encodeFurnace($block, Ids::SMOKER, Ids::LIT_SMOKER));
$this->mapSimple(Blocks::SMOOTH_BASALT(), Ids::SMOOTH_BASALT);
$this->map(Blocks::SMOOTH_QUARTZ(), fn() => Helper::encodeQuartz(StringValues::CHISEL_TYPE_SMOOTH, Axis::Y));

View File

@ -261,6 +261,7 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
->setColor($in->readColor());
});
$this->map(Ids::CARROTS, fn(Reader $in) => Helper::decodeCrops(Blocks::CARROTS(), $in));
$this->map(Ids::CARTOGRAPHY_TABLE, fn() => Blocks::CARTOGRAPHY_TABLE());
$this->map(Ids::CARVED_PUMPKIN, function(Reader $in) : Block{
return Blocks::CARVED_PUMPKIN()
->setFacing($in->readLegacyHorizontalFacing());
@ -1055,6 +1056,7 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
->setFacing($in->readFacingWithoutDown());
});
$this->map(Ids::SLIME, fn() => Blocks::SLIME());
$this->map(Ids::SMITHING_TABLE, fn() => Blocks::SMITHING_TABLE());
$this->map(Ids::SMOKER, function(Reader $in) : Block{
return Blocks::SMOKER()
->setFacing($in->readHorizontalFacing())