Fill dungeon chests and spawners and keep block entities across same-block updates
A monster room's chest took its loot table and seed from the level random in vanilla, and its spawner got the chosen mob's spawn data, but the worldgen world ignored both, so the random sequence and the block entities diverged. A block entity also now survives a set of the same kind of block (a waterlogging chest in a ruined portal), as in a vanilla proto chunk. The chunk harness stops reporting default block entities and vault reward tables as differences. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -154,7 +154,7 @@ def nbt_matches(vanilla, rust, default):
|
||||
return False
|
||||
elif value != default.get(key):
|
||||
return False
|
||||
return all(key in vanilla or key in ('x', 'y', 'z') or nbt_matches(default.get(key), rust[key], None) for key in rust)
|
||||
return all(key in vanilla or key in ('x', 'y', 'z') or nbt_matches(default.get(key), rust[key], None) or (key, rust[key]) == VAULT_REWARD for key in rust)
|
||||
if isinstance(vanilla, list) and isinstance(rust, list):
|
||||
return len(vanilla) == len(rust) and all(nbt_matches(a, b, None) for a, b in zip(vanilla, rust))
|
||||
if isinstance(vanilla, tuple) and isinstance(rust, tuple) and vanilla[0] in 'bsil' and rust[0] in 'bsil':
|
||||
@@ -178,6 +178,8 @@ def state_names():
|
||||
|
||||
|
||||
AIR = '0'
|
||||
# A vault's config omits its default reward table when saved by vanilla; templates spell it out.
|
||||
VAULT_REWARD = ('loot_table', ('str', 'minecraft:chests/trial_chambers/reward'))
|
||||
|
||||
|
||||
def compare(vanilla, rust, names, label, limit=6, quiet=False):
|
||||
|
||||
Reference in New Issue
Block a user