Added soul fire

This commit is contained in:
Dylan K. Taylor
2022-07-04 22:31:59 +01:00
parent 4909c0f257
commit d9544b5d0e
10 changed files with 128 additions and 41 deletions

View File

@ -1070,6 +1070,10 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
->writeBool(StateNames::COVERED_BIT, false)
->writeInt(StateNames::HEIGHT, $block->getLayers() - 1);
});
$this->map(Blocks::SOUL_FIRE(), function() : Writer{
return Writer::create(Ids::SOUL_FIRE)
->writeInt(StateNames::AGE, 0); //useless for soul fire, we don't track it
});
$this->mapSimple(Blocks::SOUL_SAND(), Ids::SOUL_SAND);
$this->map(Blocks::SPONGE(), function(Sponge $block) : Writer{
return Writer::create(Ids::SPONGE)

View File

@ -992,6 +992,10 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
$in->ignored(StateNames::COVERED_BIT); //seems to be useless
return Blocks::SNOW_LAYER()->setLayers($in->readBoundedInt(StateNames::HEIGHT, 0, 7) + 1);
});
$this->map(Ids::SOUL_FIRE, function(Reader $in) : Block{
$in->ignored(StateNames::AGE); //this is useless for soul fire, since it doesn't have the logic associated
return Blocks::SOUL_FIRE();
});
$this->map(Ids::SOUL_SAND, fn() => Blocks::SOUL_SAND());
$this->map(Ids::SPONGE, function(Reader $in) : Block{
return Blocks::SPONGE()->setWet(match($type = $in->readString(StateNames::SPONGE_TYPE)){