tools/generate-blockstate-upgrade-schema: give better errors when a weird new blockstate version is found

This commit is contained in:
Dylan K. Taylor 2023-04-19 16:42:50 +01:00
parent 1026811741
commit 4147d0dc75
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -196,7 +196,14 @@ function generateBlockStateUpgradeSchema(array $upgradeTable) : BlockStateUpgrad
if($foundVersion === -1 || $mapping->new->getVersion() === $foundVersion){
$foundVersion = $mapping->new->getVersion();
}else{
throw new AssumptionFailedError("Mixed versions found");
$logger = \GlobalLogger::get();
$logger->emergency("Mismatched upgraded versions found: $foundVersion and " . $mapping->new->getVersion());
$logger->emergency("Mismatched new state: " . $mapping->new->toNbt());
$logger->emergency("This is probably because the game didn't recognize the input blockstate, so it was returned unchanged.");
$logger->emergency("This is usually because the block is locked behind an experimental toggle that isn't enabled on the world you used when generating this upgrade table.");
$logger->emergency("You can test this in a vanilla game using the /give or /setblock commands to try and acquire the block. Keep trying different experiments until you find the right one.");
exit(1);
}
}
}