From ebe0e81949aac5b9eb4986a3bcebaf1399b27942 Mon Sep 17 00:00:00 2001 From: JohnBraham Date: Tue, 24 Nov 2026 14:53:22 +0000 Subject: [PATCH] Use released Building Pieces 0.3.12 --- README.md | 2 +- docs/BUILDING.md | 5 +++ gradle/core-dependency.properties | 8 ++-- gradle/native-probes.gradle | 2 +- .../skysbuildingpiecesbop/RepositoryTest.java | 2 +- tools/bop_development_notice.py | 41 +++++++++++++++++++ tools/native_client_log.py | 26 +++++++----- tools/native_registry_notices.py | 5 ++- tools/run_development_checks.py | 5 ++- tools/run_packaged_checks.py | 12 +++--- tools/test_bop_development_notice.py | 39 ++++++++++++++++++ 11 files changed, 121 insertions(+), 26 deletions(-) create mode 100644 tools/bop_development_notice.py create mode 100644 tools/test_bop_development_notice.py diff --git a/README.md b/README.md index 0f20c15e..732e748e 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ It doesn't accept unrelated items. Use the versions for **Minecraft 1.21.1**, with **NeoForge 21.1.247** and **Java 21**. You'll need: -- **Sky's Building Pieces 0.3.11.121012** and this add-on. +- **Sky's Building Pieces 0.3.12.121012** and this add-on. - **Biomes O' Plenty 21.1.0.14**, **TerraBlender 4.1.0.8** and **GlitchCore 2.1.0.2**. Put those jars in `mods` on both the client and server. diff --git a/docs/BUILDING.md b/docs/BUILDING.md index d234cf54..7f2029e9 100644 --- a/docs/BUILDING.md +++ b/docs/BUILDING.md @@ -23,6 +23,11 @@ to export the native launch files. Use one Gradle home for this checkout's command line and Eclipse launches. The regular client and server use the merged production output, without test classes or test mods. +The pinned BOP development jars report one allay spawn-registration error, +including in the vendor-only control. Development checks recognise that exact +startup message only with the three verified vendor jar checksums. Raw logs +are kept, and other errors still fail. + ## Runtime checks The test harnesses use Python 3.11 or later. Build the separate runtime diff --git a/gradle/core-dependency.properties b/gradle/core-dependency.properties index 58cfe539..a7cd79e3 100644 --- a/gradle/core-dependency.properties +++ b/gradle/core-dependency.properties @@ -1,10 +1,10 @@ repository=MinecraftModDevelopmentMods/SkysBuildingPieces kind=release -commit=4a4f8925cc3a9a77b4a9ad10325d5c8a50867d16 -version=0.3.11.121012 +commit=6b5c1ae786bc7e164e6341b7304e2e08e70c945a +version=0.3.12.121012 api=1 -sha256=C7E8A84301076CE56CDFEA34186AD6EA9AF81D70C8B7489CE1026CDEA2C346A3 -development.sha256=C7E8A84301076CE56CDFEA34186AD6EA9AF81D70C8B7489CE1026CDEA2C346A3 +sha256=FCDC667590881D75C96471CB6A65DBBA50F859CB6B691EC33834B3C6262B843D +development.sha256=FCDC667590881D75C96471CB6A65DBBA50F859CB6B691EC33834B3C6262B843D bop_modrinth_version=BtZKRp69 bop_sha256=5F3C8D752C2E0464ECA8C9527D8FFE498129FD37A2FE86A266B64C98371763B1 terrablender_modrinth_version=6e8GCrLb diff --git a/gradle/native-probes.gradle b/gradle/native-probes.gradle index 89691e53..5831f8c9 100644 --- a/gradle/native-probes.gradle +++ b/gradle/native-probes.gradle @@ -26,7 +26,7 @@ def compileBootstrap = tasks.register('compileNativeBootstrap', JavaCompile) { source file(new File(project.ext.coreDirectory, 'src/integrationTest/java/zone/moddev/mc/skysbuildingpieces/probe/RecipeBookChecks.java')) source file(new File(project.ext.coreDirectory, 'src/integrationTest/java/zone/moddev/mc/skysbuildingpieces/probe/RecombinationChecks.java')) source file(new File(project.ext.coreDirectory, 'src/integrationTest/java/zone/moddev/mc/skysbuildingpieces/probe/PersistenceRegistrationChecks.java')) - ['NativeLegacyChecks', 'DirtCoverageChecks', 'CoverageContributor', 'NativeProbeItems', + ['NativeLegacyChecks', 'LiveInventoryRecoveryChecks', 'DirtCoverageChecks', 'CoverageContributor', 'NativeProbeItems', 'SurvivalDropChecks', 'FuelChecks', 'RecipeUniquenessChecks'].each { name -> source file(new File(project.ext.coreDirectory, 'src/integrationTest/java/zone/moddev/mc/skysbuildingpieces/probe/' + name + '.java')) } diff --git a/src/test/java/zone/moddev/mc/skysbuildingpiecesbop/RepositoryTest.java b/src/test/java/zone/moddev/mc/skysbuildingpiecesbop/RepositoryTest.java index c4c702b0..6e5fbd3d 100644 --- a/src/test/java/zone/moddev/mc/skysbuildingpiecesbop/RepositoryTest.java +++ b/src/test/java/zone/moddev/mc/skysbuildingpiecesbop/RepositoryTest.java @@ -16,7 +16,7 @@ void newerCoreOverrideIsLocalOnly() throws Exception { String pin = text("gradle/core-dependency.properties"); - assertTrue(pin.contains("version=0.3.11.121012")); + assertTrue(pin.contains("version=0.3.12.121012")); assertTrue(pin.contains("api=1")); } diff --git a/tools/bop_development_notice.py b/tools/bop_development_notice.py new file mode 100644 index 00000000..47d6138e --- /dev/null +++ b/tools/bop_development_notice.py @@ -0,0 +1,41 @@ +"""The exact startup notice reproduced with the pinned BOP development jars.""" + +import re + +BOP_SPAWN_CONTROL_HASHES = frozenset({ + "5F3C8D752C2E0464ECA8C9527D8FFE498129FD37A2FE86A266B64C98371763B1", + "0C49B5EF447A7F09100E9A210888A7347FBDA0AA75322063991F6063B25FE3F9", + "59D2A3FB3D6877E43018FD6A2B199D526074A864276A5F49091409A1CDC62FAE", +}) + + +def has_controlled_bop_inputs(vendor_inputs): + return BOP_SPAWN_CONTROL_HASHES <= set(vendor_inputs) + + +BOP_ALLAY_MESSAGE = ( + "The following entities have not registered to the RegisterSpawnPlacementsEvent, " + "but a spawn entry was found. This will mean that the entity doesn't have restrictions " + "on its spawn location, please register a spawn placement for the entity, you can " + "register with NO_RESTRICTIONS if you don't want any restrictions." +) +BOP_ALLAY_NOTICE = re.compile( + r"(?m)^\[[^\r\n]+\] \[Server thread/ERROR\] \[" + r"(?:net\.neoforged\.neoforge\.server|ne\.ne\.ne\.se)\.ServerLifecycleHooks/\]: " + + re.escape(BOP_ALLAY_MESSAGE) + r"\n\t - minecraft:allay\n(?![ \t]+-)" +) + + +def checked_bop_development_text(text): + """Validate the known startup notice without changing the saved log.""" + text = text.replace("\r\n", "\n") + notices = list(BOP_ALLAY_NOTICE.finditer(text)) + if len(notices) > 1: + raise ValueError("Repeated BOP allay spawn diagnostic") + if notices: + notice = notices[0] + before = text[:notice.start()] + if "Done (" in before or "Preparing start region for dimension " in before: + raise ValueError("BOP allay spawn diagnostic appeared after startup") + text = text[:notice.start()] + text[notice.end():] + return text diff --git a/tools/native_client_log.py b/tools/native_client_log.py index 271e7f79..42d526b5 100644 --- a/tools/native_client_log.py +++ b/tools/native_client_log.py @@ -7,10 +7,11 @@ import re import tomllib from native_registry_notices import audit_text, profile_for, audit_biome_proof +from bop_development_notice import checked_bop_development_text -def audit_complete_logs(directory): +def audit_complete_logs(directory, *, bop_development=False): """Include rolled first-load logs, so a clean reload cannot hide a failure.""" paths = sorted(path for path in (Path(directory) / "logs").rglob("*") if path.is_file() and (path.name.endswith(".log") or path.name.endswith(".log.gz"))) @@ -23,14 +24,16 @@ def audit_complete_logs(directory): else: text = path.read_text(encoding="utf-8") try: - audit_text(text, profile_for(directory)) + audit_text(text, profile_for(directory), bop_development=bop_development) except ValueError as failure: raise ValueError(str(path) + ": " + str(failure)) from failure return len(paths) -def classify(log, unchanged_defaults): +def classify(log, unchanged_defaults, *, bop_development=False): """Require a complete client login without severe notices.""" + if bop_development: + log = checked_bop_development_text(log) lines = log.splitlines() severe = [line for line in lines if re.search(r"/(?:ERROR|FATAL)\]", line)] startup = next((index for index, line in enumerate(lines) @@ -64,14 +67,14 @@ def unchanged_native_settings(directory, names): return True -def audit(directory, phase, control=False): +def audit(directory, phase, control=False, *, bop_development=False): directory = Path(directory) log = (directory / "logs/latest.log").read_text(encoding="utf-8") unchanged = unchanged_native_settings(directory, ( "fml.toml", "neoforge-client.toml", "neoforge-common.toml", "neoforge-server.toml")) if not unchanged: raise ValueError("NeoForge settings differ from the controlled defaults") - receipt = classify(log, unchanged) + receipt = classify(log, unchanged, bop_development=bop_development) required = (("NEOFORGE_CLIENT_CONTROL_PASS joined=true sky_mods=false",) if control else ("BUILDING_PIECES_CLIENT_WORLD_ACCEPTED", "SKY_RECIPE_PREVIEW_MODELS_PASS", "BUILDING_PIECES_CONTINUOUS_GLASS_PASS", "BUILDING_PIECES_COLOURS_PASS")) @@ -88,7 +91,7 @@ def audit(directory, phase, control=False): raise ValueError("The NeoForge-only control must complete without handshake errors") if list((directory / "crash-reports").glob("*")): raise ValueError("Native client produced a crash report") - receipt["complete_log_files"] = audit_complete_logs(directory) + receipt["complete_log_files"] = audit_complete_logs(directory, bop_development=bop_development) receipt["phase"] = phase receipt["control_without_sky_mods"] = control (directory / (phase + "-log-audit.json")).write_text( @@ -96,7 +99,7 @@ def audit(directory, phase, control=False): return receipt -def classify_server(log, debug, unchanged_defaults, profile=None): +def classify_server(log, debug, unchanged_defaults, profile=None, *, bop_development=False): """Require unchanged defaults and a complete native server start.""" lines = log.splitlines() severe = [line for line in lines if re.search(r"/(?:ERROR|FATAL)\]", line)] @@ -104,21 +107,22 @@ def classify_server(log, debug, unchanged_defaults, profile=None): for line in lines) if not unchanged_defaults or not startup or 'Done (' not in log: raise ValueError('Native server defaults or startup sequence changed') - notices = audit_text(log, profile) + notices = audit_text(log, profile, bop_development=bop_development) audit_biome_proof(log, profile) if not debug.strip(): raise ValueError('Native server debug evidence is missing') return {'native_server_config_notices': 0, 'notices': notices, 'unchanged_native_defaults': True, 'debug_identity_verified': True} -def audit_server(directory, phase): +def audit_server(directory, phase, *, bop_development=False): directory = Path(directory) unchanged = unchanged_native_settings(directory, ("fml.toml", "neoforge-common.toml", "neoforge-server.toml")) receipt = classify_server((directory / 'logs/latest.log').read_text(encoding='utf-8'), - (directory / 'logs/debug.log').read_text(encoding='utf-8'), unchanged, profile_for(directory)) + (directory / 'logs/debug.log').read_text(encoding='utf-8'), unchanged, profile_for(directory), + bop_development=bop_development) if list((directory / 'crash-reports').glob('*')): raise ValueError('Native server produced a crash report') - receipt['complete_log_files'] = audit_complete_logs(directory) + receipt['complete_log_files'] = audit_complete_logs(directory, bop_development=bop_development) receipt['phase'] = phase (directory / (phase + '-server-log-audit.json')).write_text( json.dumps(receipt, indent=2) + '\n', encoding='utf-8') diff --git a/tools/native_registry_notices.py b/tools/native_registry_notices.py index 25737137..e20f4e7a 100644 --- a/tools/native_registry_notices.py +++ b/tools/native_registry_notices.py @@ -4,6 +4,7 @@ import json from pathlib import Path import re +from bop_development_notice import checked_bop_development_text def validate_registry_proofs(root, profile): @@ -112,8 +113,10 @@ def audit_biome_proof(text, profile): raise ValueError("The complete native biome conversion was not verified") -def audit_text(text, profile=None): +def audit_text(text, profile=None, *, bop_development=False): text = text.replace("\r\n", "\n") + if bop_development: + text = checked_bop_development_text(text) observed = {} pattern = r"Unidentified mapping from registry (minecraft:[a-z_/]+)\n(.*?)(?:\n\n)" for registry, body in re.findall(pattern, text, re.S): diff --git a/tools/run_development_checks.py b/tools/run_development_checks.py index 926717a0..446ea210 100644 --- a/tools/run_development_checks.py +++ b/tools/run_development_checks.py @@ -7,6 +7,7 @@ import subprocess from run_packaged_checks import audit, digest, prepare +from bop_development_notice import has_controlled_bop_inputs def main(): @@ -43,7 +44,9 @@ def main(): console = directory / (options.phase + "-console.log") with console.open("x", encoding="utf-8") as output: subprocess.run(command, check=True, stdout=output, stderr=subprocess.STDOUT, timeout=600) - audit(directory, options.phase, options.mode) + vendor_inputs = {row["sha256"] for row in expected} + audit(directory, options.phase, options.mode, + bop_development=has_controlled_bop_inputs(vendor_inputs)) print("NEOFORGE_BUILDING_PIECES_BOP_DEVELOPMENT_PASS", options.mode, options.phase) diff --git a/tools/run_packaged_checks.py b/tools/run_packaged_checks.py index 2fd6be2a..6fbd8827 100644 --- a/tools/run_packaged_checks.py +++ b/tools/run_packaged_checks.py @@ -287,25 +287,25 @@ def payload(data, x, z): output.write("\n") -def audit_console(directory, phase): +def audit_console(directory, phase, *, bop_development=False): """Include loader diagnostics that can happen before Minecraft opens its logs.""" path = directory / (phase + "-console.log") console = path.read_text(encoding="utf-8") status_error = re.search(r"(?m)^(?:ERROR|FATAL) Status(?:Console)?Listener\b.*", console) if status_error: raise ValueError("Unexpected loader logging failure: " + status_error[0]) - audit_text(console, profile_for(directory)) + audit_text(console, profile_for(directory), bop_development=bop_development) -def audit(directory, phase, mode, biomes_only=False): - audit_console(directory, phase) +def audit(directory, phase, mode, biomes_only=False, *, bop_development=False): + audit_console(directory, phase, bop_development=bop_development) if mode == "client": - audit_client(directory, phase) + audit_client(directory, phase, bop_development=bop_development) shutil.copyfile(directory / "logs/latest.log", directory / (phase + "-complete.log")) shutil.copyfile(directory / "logs/debug.log", directory / (phase + "-debug.log")) return log = (directory / "logs/latest.log").read_text(encoding="utf-8") - audit_server(directory, phase) + audit_server(directory, phase, bop_development=bop_development) required = ("Done (", "BUILDING_PIECES_BOP_NATIVE_BOOTSTRAP_PASS") if (directory / 'forward-fixture.json').is_file(): required += ('BOP_NATIVE_BIOMES_PASS biomes=73 loaded_chunks=true',) if biomes_only else ( diff --git a/tools/test_bop_development_notice.py b/tools/test_bop_development_notice.py new file mode 100644 index 00000000..a4ea048a --- /dev/null +++ b/tools/test_bop_development_notice.py @@ -0,0 +1,39 @@ +"""Keep the known vendor notice narrow and all other diagnostics visible.""" + +import unittest + +from bop_development_notice import BOP_ALLAY_MESSAGE, BOP_SPAWN_CONTROL_HASHES, has_controlled_bop_inputs +from native_registry_notices import audit_text + + +class BopDevelopmentNoticeTest(unittest.TestCase): + def test_complete_vendor_hashes_are_required(self): + expected = set(BOP_SPAWN_CONTROL_HASHES) + self.assertTrue(has_controlled_bop_inputs(expected)) + self.assertTrue(has_controlled_bop_inputs(expected | {"another Sky jar"})) + for missing in expected: + with self.subTest(missing=missing): + self.assertFalse(has_controlled_bop_inputs(expected - {missing})) + self.assertFalse(has_controlled_bop_inputs((expected - {missing}) | {"different vendor jar"})) + + def test_only_one_exact_startup_notice_is_accepted(self): + prefix = "[time] [Server thread/ERROR] [ne.ne.ne.se.ServerLifecycleHooks/]: " + known = prefix + BOP_ALLAY_MESSAGE + "\n\t - minecraft:allay\n" + startup = '[Server thread/INFO] [MinecraftServer/]: Preparing level "world"\nDone (1.0s)!' + self.assertEqual(audit_text(known + startup, bop_development=True), []) + with self.assertRaises(ValueError): + audit_text(known + startup) + for text in ( + known + known + startup, + startup + "\n" + known, + known.replace("minecraft:allay", "minecraft:bat") + startup, + known + "\t - minecraft:bat\n" + startup, + known.replace("ServerLifecycleHooks", "DifferentLogger") + startup, + known + "[time] [Server thread/ERROR] [Sky/]: Broken generation\n" + startup, + ): + with self.subTest(text=text), self.assertRaises(ValueError): + audit_text(text, bop_development=True) + + +if __name__ == "__main__": + unittest.main()