BlockStateUpgrader: do not apply backwards-incompatible schemas to blockstates already on the correct version

this notably led to corruption of glow_lichen and sculk_vein in 1.18.10.
This commit is contained in:
Dylan K. Taylor
2022-02-10 20:51:31 +00:00
parent 8a11ed70e3
commit 905eee3198
3 changed files with 42 additions and 8 deletions

View File

@ -53,7 +53,7 @@ class BlockStateUpgraderTest extends TestCase{
private function getNewSchemaVersion(int $versionId) : BlockStateUpgradeSchema{
$schema = new BlockStateUpgradeSchema(($versionId >> 24) & 0xff, ($versionId >> 16) & 0xff, ($versionId >> 8) & 0xff, $versionId & 0xff);
$this->upgrader->addSchema($schema, 0);
$this->upgrader->addSchema($schema);
return $schema;
}