Run /test as vanilla does in a world without test instances

Model TestCommand's release tree (ResourceSelectorArgument patterns
included) and its finder, locate, pos, stop and clear outcomes when no
test instance block exists. Compare /help's gamerule alternatives as a
set: GameRuleCommand registers them in identity-hash order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-11 16:47:42 +02:00
parent 38059ab9f9
commit 00371a7f35
9 changed files with 243 additions and 7 deletions
+6
View File
@@ -132,8 +132,14 @@ MASKS = [
]
GAMERULES = re.compile(r'/gamerule \(([^)]*)\)')
def masked(record):
text = json.dumps(record['messages'], ensure_ascii=False)
# GameRuleCommand registers the rules in identity-hash order, different
# in every JVM: compare /help's gamerule alternatives as a set.
text = GAMERULES.sub(lambda m: '/gamerule (' + '|'.join(sorted(m.group(1).split('|'))) + ')', text)
for pattern, replacement in MASKS:
text = pattern.sub(replacement, text)
return text