Implement campfire & soul campfire (#4696)

This commit is contained in:
ipad54
2024-07-07 23:01:34 +03:00
committed by GitHub
parent f6c0b228ec
commit 2ffc38c835
18 changed files with 661 additions and 3 deletions

View File

@ -1039,6 +1039,11 @@ final class BlockStateToObjectDeserializer implements BlockStateDeserializer{
return Blocks::CAKE()
->setBites($in->readBoundedInt(StateNames::BITE_COUNTER, 0, 6));
});
$this->map(Ids::CAMPFIRE, function(Reader $in) : Block{
return Blocks::CAMPFIRE()
->setFacing($in->readCardinalHorizontalFacing())
->setLit(!$in->readBool(StateNames::EXTINGUISHED));
});
$this->map(Ids::CARROTS, fn(Reader $in) => Helper::decodeCrops(Blocks::CARROTS(), $in));
$this->map(Ids::CARVED_PUMPKIN, function(Reader $in) : Block{
return Blocks::CARVED_PUMPKIN()
@ -1525,6 +1530,11 @@ final class BlockStateToObjectDeserializer implements BlockStateDeserializer{
$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_CAMPFIRE, function(Reader $in) : Block{
return Blocks::SOUL_CAMPFIRE()
->setFacing($in->readCardinalHorizontalFacing())
->setLit(!$in->readBool(StateNames::EXTINGUISHED));
});
$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();