From f58c5ad5c38d5d4b5f4c1859b6ba579bf78e801f Mon Sep 17 00:00:00 2001 From: JohnBraham Date: Sun, 15 Nov 2026 08:48:59 +0000 Subject: [PATCH 1/2] Bring basePower to NeoForge 1.21.1 --- .github/NativeDependencyPins.psm1 | 111 ++ .github/native-dependencies.json | 63 + .github/pinned-native-inputs.gradle | 36 + .github/test-base-metals-pin.sh | 51 +- .github/test-native-dependencies.ps1 | 143 ++ .github/verify-base-metals-pin.sh | 24 +- .github/verify-native-dependencies.ps1 | 31 + .github/workflows/ci.yml | 108 +- .github/workflows/codeql-analysis.yml | 85 +- .github/workflows/release-on-tag.yml | 19 +- .github/workflows/validate-gradle-build.yml | 4 +- .gitignore | 1 + CHANGELOG.txt | 13 + README.md | 216 ++- build.gradle | 1288 +++-------------- docs/1.21.1-neoforge/TEST-RESULTS.md | 181 +++ gradle.properties | 34 +- gradle/client-integration.gradle | 96 ++ gradle/verify-eclipse-ecj.gradle | 282 ++++ gradle/wrapper/gradle-wrapper.jar | Bin 54413 -> 47623 bytes gradle/wrapper/gradle-wrapper.properties | 8 +- gradlew | 302 ++-- gradlew.bat | 130 +- .../api/FluidCategoryRegistry.java | 6 +- .../poweradvantage/api/PoweredEntity.java | 29 +- .../poweradvantage/api/fluid/FluidStack.java | 4 +- .../api/fluid/InteractiveFluidBlock.java | 2 +- .../api/modsupport/Wrappers.java | 2 +- .../modsupport/rf/TileEntityRFConverter.java | 28 +- .../api/simple/BlockSimpleFluidMachine.java | 4 +- .../api/simple/BlockSimplePowerMachine.java | 4 +- .../api/simple/SimpleMachineGUI.java | 4 +- .../moddev/mc/basepower/PowerAdvantage.java | 49 +- .../mc/basepower/blocks/BlockFrame.java | 4 +- .../basepower/client/ClientOilRenderer.java | 4 +- .../basepower/client/ClientRegistration.java | 15 + .../mc/basepower/compat/BaseMetalsCompat.java | 10 +- .../mc/basepower/compat/CrushingRecipes.java | 24 + .../conduitnetwork/ConduitRegistry.java | 15 +- .../config/PowerAdvantageConfig.java | 26 +- .../basepower/gui/FilteredFluidTankGUI.java | 4 +- .../moddev/mc/basepower/gui/FluidTankGUI.java | 6 +- .../moddev/mc/basepower/gui/StillGUI.java | 4 +- .../zone/moddev/mc/basepower/init/Blocks.java | 19 +- .../moddev/mc/basepower/init/Entities.java | 15 +- .../zone/moddev/mc/basepower/init/Fluids.java | 50 +- .../moddev/mc/basepower/init/ItemGroups.java | 12 +- .../zone/moddev/mc/basepower/init/Items.java | 15 +- .../moddev/mc/basepower/init/Recipes.java | 6 +- .../moddev/mc/basepower/init/Villages.java | 2 +- .../conveyors/TileEntityConveyor.java | 25 +- .../conveyors/TileEntityOreFilter.java | 2 +- .../conveyors/TileEntityPlantFilter.java | 8 +- .../fluidmachines/StorageTankBlock.java | 4 +- .../migration/BaseMetalsLegacyMigration.java | 8 +- .../migration/LegacyEntityDataFixes.java | 30 +- .../migration/LegacyMachineItemDataFixes.java | 3 +- .../migration/LegacyPlayerDataFixes.java | 6 +- .../migration/LegacyWorldDataHook.java | 25 +- .../migration/LegacyWorldMetadata.java | 2 +- .../migration/NativePersistentData.java | 78 + .../migration/VanillaRegistryRemaps.java | 147 +- .../basepower/recipe/MaterialPolicyPack.java | 8 +- .../mc/basepower/recipe/MaterialTags.java | 2 +- .../moddev/mc/basepower/recipe/PartsLoot.java | 15 +- .../mc/basepower/recipe/RecipeConditions.java | 15 +- .../mc/basepower/recipe/RecipeDiscovery.java | 2 +- .../mc/basepower/registry/FuelRegistry.java | 4 +- .../mc/basepower/registry/ITileEntityGUI.java | 4 +- .../registry/MachineGUIRegistry.java | 21 +- .../still/recipe/DistillationRecipe.java | 4 +- .../recipe/DistillationRecipeRegistry.java | 4 +- .../still/recipe/ExplicitFluidReference.java | 6 +- .../recipe/RegistryNameFluidReference.java | 4 +- .../basepower/util/AdvantageFluidAdapter.java | 11 +- .../basepower/util/FluidContainerHelper.java | 28 +- .../mc/basepower/util/FluidHandlerHelper.java | 3 +- .../mc/basepower/util/FluidIdHelper.java | 8 +- .../mc/basepower/util/ForgeFluidAdapter.java | 69 +- .../mc/basepower/util/InventoryLocks.java | 8 +- .../basepower/util/MachineCapabilities.java | 77 +- .../moddev/mc/basepower/util/PowerHelper.java | 5 +- .../mc/basepower/util/RegistryValues.java | 13 + .../{mods.toml => neoforge.mods.toml} | 41 +- .../recipes/converter_rf_electricity.json | 4 +- .../recipes/converter_rf_quantum.json | 2 +- .../recipes/converter_rf_steam.json | 4 +- .../converter_tr_electricity_iron.json | 4 +- ...converter_tr_electricity_refined_iron.json | 4 +- .../advancement/recipes/fluid_discharge.json | 8 +- .../advancement/recipes/fluid_drain.json | 8 +- .../recipes/fluid_metal_tank_iron_normal.json | 4 +- .../recipes/fluid_metal_tank_steel.json | 4 +- .../fluid_pipe_copper_apocalyptic.json | 2 +- .../recipes/fluid_pipe_copper_normal.json | 2 +- .../recipes/fluid_pipe_iron_apocalyptic.json | 2 +- .../recipes/fluid_pipe_iron_normal.json | 2 +- .../recipes/fluid_pipe_iron_tech.json | 2 +- .../recipes/fluid_pipe_lead_apocalyptic.json | 2 +- .../recipes/fluid_storage_tank.json | 4 +- .../advancement/recipes/fluid_switch.json | 4 +- .../advancement/recipes/item_conveyor.json | 4 +- .../advancement/recipes/item_filter_ore.json | 2 +- .../advancement/recipes/rotator_tool.json | 4 +- .../sprocket_bronze_nugget_tech_no_rod.json | 4 +- .../recipes/sprocket_rod_normal.json | 4 +- .../recipes/sprocket_rod_tech.json | 4 +- .../recipes/sprocket_stickwood_normal.json | 2 +- .../advancement/recipes/steel_frame.json | 2 +- .../basepower/advancement/recipes/still.json | 2 +- .../recipe/converter_rf_electricity.json | 32 +- .../recipe/converter_rf_quantum.json | 12 +- .../basepower/recipe/converter_rf_steam.json | 32 +- .../recipe/converter_tr_electricity_iron.json | 40 +- ...converter_tr_electricity_refined_iron.json | 32 +- .../recipe/crushing_fluid_discharge.json | 30 +- .../recipe/crushing_fluid_drain.json | 30 +- .../recipe/crushing_fluid_storage_tank.json | 30 +- .../recipe/crushing_item_conveyor.json | 38 +- .../recipe/crushing_item_filter_block.json | 38 +- .../recipe/crushing_item_filter_food.json | 38 +- .../recipe/crushing_item_filter_fuel.json | 38 +- .../crushing_item_filter_inventory.json | 38 +- .../recipe/crushing_item_filter_ore.json | 38 +- .../recipe/crushing_item_filter_overflow.json | 38 +- .../recipe/crushing_item_filter_plant.json | 38 +- .../recipe/crushing_item_filter_smelt.json | 38 +- .../recipe/crushing_potato_starch.json | 12 +- .../basepower/recipe/fluid_discharge.json | 52 +- .../data/basepower/recipe/fluid_drain.json | 52 +- .../recipe/fluid_metal_tank_iron_normal.json | 40 +- .../recipe/fluid_metal_tank_steel.json | 32 +- .../recipe/fluid_pipe_copper_apocalyptic.json | 30 +- .../recipe/fluid_pipe_copper_normal.json | 30 +- .../recipe/fluid_pipe_iron_apocalyptic.json | 30 +- .../recipe/fluid_pipe_iron_normal.json | 30 +- .../recipe/fluid_pipe_iron_tech.json | 30 +- .../recipe/fluid_pipe_lead_apocalyptic.json | 30 +- .../basepower/recipe/fluid_storage_tank.json | 32 +- .../data/basepower/recipe/fluid_switch.json | 32 +- .../data/basepower/recipe/item_conveyor.json | 32 +- .../basepower/recipe/item_filter_ore.json | 12 +- .../data/basepower/recipe/rotator_tool.json | 32 +- .../sprocket_bronze_nugget_tech_no_rod.json | 48 +- .../basepower/recipe/sprocket_rod_normal.json | 40 +- .../basepower/recipe/sprocket_rod_tech.json | 40 +- .../recipe/sprocket_stickwood_normal.json | 40 +- .../data/basepower/recipe/steel_frame.json | 12 +- .../data/basepower/recipe/still.json | 12 +- src/main/resources/data/c/tags/item/bars.json | 7 + .../data/c/tags/item/bars/steel.json | 9 + .../data/c/tags/item/dusts/charcoal.json | 4 + .../data/c/tags/item/dusts/coal.json | 4 + .../data/c/tags/item/dusts/lead.json | 4 + .../data/c/tags/item/dusts/redstone.json | 6 + .../data/c/tags/item/dusts/silver.json | 4 + .../resources/data/c/tags/item/dusts/tin.json | 4 + .../data/c/tags/item/frames/steel.json | 6 + .../resources/data/c/tags/item/gears.json | 6 + .../data/c/tags/item/gears/steel.json | 6 + .../data/c/tags/item/gems/diamond.json | 6 + .../data/c/tags/item/gems/emerald.json | 6 + .../resources/data/c/tags/item/governors.json | 4 + .../data/c/tags/item/ingots/brass.json | 4 + .../data/c/tags/item/ingots/copper.json | 4 + .../data/c/tags/item/ingots/gold.json | 6 + .../data/c/tags/item/ingots/iron.json | 6 + .../data/c/tags/item/ingots/lead.json | 4 + .../data/c/tags/item/ingots/nickel.json | 4 + .../data/c/tags/item/ingots/plastic.json | 6 + .../data/c/tags/item/ingots/refined_iron.json | 4 + .../data/c/tags/item/ingots/rubber.json | 4 + .../data/c/tags/item/ingots/steel.json | 4 + .../data/c/tags/item/ingots/zinc.json | 4 + .../data/c/tags/item/nuggets/bronze.json | 4 + .../data/c/tags/item/nuggets/copper.json | 4 + .../data/c/tags/item/nuggets/gold.json | 6 + .../data/c/tags/item/nuggets/iron.json | 6 + .../data/c/tags/item/nuggets/lead.json | 4 + .../data/c/tags/item/nuggets/tin.json | 4 + .../resources/data/c/tags/item/pipes.json | 6 + .../resources/data/c/tags/item/plastic.json | 6 + .../data/c/tags/item/plates/copper.json | 4 + .../data/c/tags/item/plates/iron.json | 4 + .../data/c/tags/item/plates/steel.json | 4 + .../data/c/tags/item/power_supply_units.json | 4 + src/main/resources/data/c/tags/item/rods.json | 4 + .../data/c/tags/item/rods/copper.json | 4 + .../data/c/tags/item/rods/wooden.json | 6 + .../resources/data/c/tags/item/rubber.json | 4 + .../resources/data/c/tags/item/sprockets.json | 6 + .../data/c/tags/item/sprockets/steel.json | 6 + .../resources/data/c/tags/item/stone.json | 6 + .../c/tags/item/storage_blocks/diamond.json | 6 + .../c/tags/item/storage_blocks/steel.json | 4 + .../data/forge/tags/block/stone.json | 4 + .../resources/data/forge/tags/item/bars.json | 2 +- .../loot_modifiers/global_loot_modifiers.json | 0 .../LegacyEntityAttributeAliasesTest.java | 30 +- .../migration/LegacyEntityDataFixesTest.java | 127 ++ .../LegacyForgeAttributeRegistryTest.java | 19 +- .../migration/LegacyMachineItemsTest.java | 8 +- .../LegacyPlayerTransformerTest.java | 2 +- .../migration/LegacyTransformerOrderTest.java | 6 +- .../migration/NativePersistentDataTest.java | 43 + .../VanillaRegistryMappingEventTest.java | 174 +-- .../migration/VanillaRegistryRemapsTest.java | 4 +- .../recipe/MaterialPolicyPackTest.java | 12 +- .../mc/basepower/recipe/MaterialTagsTest.java | 4 +- .../registry/MachineGuiTitleTest.java | 2 + .../resources/BuildWorkflowContractTest.java | 90 +- .../resources/ClientResourceContractTest.java | 2 +- .../CreativeTabInitializationTest.java | 15 +- .../NativeBlockEntityFactoryTest.java | 4 +- .../resources/NativeLootContractTest.java | 13 +- .../resources/NativeMachinePropertyTest.java | 2 +- .../resources/NativePlatformContractTest.java | 22 +- .../NativeTagReaderContractTest.java | 2 +- .../RecipeRegistrationThreadTest.java | 10 +- .../resources/RecipeUnlockContractTest.java | 6 +- .../basepower/resources/StarchRecipeTest.java | 4 +- .../basepower/util/ForgeFluidAdapterTest.java | 28 +- .../MachineCapabilitiesLifecycleTest.java | 393 +++-- .../util/NativeBucketContentTest.java | 24 + test-rig/build.gradle | 350 +---- test-rig/client-integration/README.md | 73 + .../integration/NativeClientIntegration.java | 221 +++ .../resources/META-INF/neoforge.mods.toml | 13 + test-rig/client-resources/README.md | 44 +- .../client/ChildRendererGeometryProbe.java | 20 +- .../client/ClientResourceProbe.java | 43 +- .../client/MachineGuiLayoutProbe.java | 11 +- .../advantageworks/client/OilRenderProbe.java | 18 +- .../client/RecipeBookGroupingProbe.java | 112 +- .../client/TankVisualProbe.java | 20 +- .../{mods.toml => neoforge.mods.toml} | 14 +- .../client-resources/resources/pack.mcmeta | 2 +- .../test-geometry-contract.ps1 | 41 +- .../test-probe-contract-negative-controls.ps1 | 31 +- .../client-resources/test-probe-contract.ps1 | 447 +++--- test-rig/gradle.properties | 2 +- .../migration/audit_native1201_endurance.py | 9 +- .../audit_native1211neo_endurance.py | 41 + test-rig/migration/historical_test_inputs.py | 6 +- test-rig/migration/native117_broad.py | 3 +- test-rig/migration/native1211neo.py | 409 ++++++ test-rig/migration/native1211neo_actors.py | 410 ++++++ test-rig/migration/native1211neo_broad.py | 119 ++ test-rig/migration/native1211neo_crushing.py | 118 ++ test-rig/migration/native1211neo_endurance.py | 243 ++++ test-rig/migration/native1211neo_machines.py | 140 ++ test-rig/migration/native1211neo_networks.py | 208 +++ .../migration/native1211neo_operations.py | 119 ++ .../migration/native1211neo_preservation.py | 74 + test-rig/migration/native1211neo_recipes.py | 146 ++ test-rig/migration/native1211neo_upgrade.py | 308 ++++ test-rig/migration/native1211neo_worldgen.py | 314 ++++ test-rig/migration/neoforge_code.py | 118 ++ test-rig/migration/test_native117_geometry.py | 8 +- .../migration/test_native117_readiness.py | 5 +- ...st_native1211neo_actor_network_adapters.py | 284 ++++ .../migration/test_native1211neo_identity.py | 340 +++++ .../test_native1211neo_preservation.py | 159 ++ .../test_native1211neo_recipe_exports.py | 73 + .../test_native1211neo_runtime_views.py | 176 +++ .../migration/test_native1211neo_worldgen.py | 273 ++++ test-rig/platform-controls/neo1211/.gitignore | 2 + test-rig/platform-controls/neo1211/README.md | 32 + .../platform-controls/neo1211/build.gradle | 103 ++ .../neo1211/gradle.properties | 4 + .../platform-controls/neo1211/settings.gradle | 4 + .../NativePlatformControlMod.java | 6 + .../resources/META-INF/neoforge.mods.toml | 13 + .../NativePlatformControlsTest.java | 37 + .../nativeplatform/NeoControlBootstrap.java | 80 + .../profiles/native1211neo/power-interop.json | 28 + .../moddev/mc/advantageworks/ActorProbe.java | 24 +- .../mc/advantageworks/AdvantageWorksMod.java | 11 +- .../mc/advantageworks/ConnectedProbe.java | 24 +- .../advantageworks/CrushingInteropProbe.java | 509 +++++++ .../advantageworks/DimensionEntityProbe.java | 36 +- .../ElectricOperationalCases.java | 29 +- .../mc/advantageworks/LifecycleProbe.java | 38 +- .../mc/advantageworks/MachineContext.java | 22 +- .../MachineOperationalProbe.java | 28 +- .../mc/advantageworks/MigrationProbe.java | 26 +- .../mc/advantageworks/Native117PlayerIo.java | 2 +- .../mc/advantageworks/Native117Readiness.java | 14 +- .../Native117StoppedEntitiesSnapshot.java | 8 +- .../Native117StoppedEntitiesSnapshotV2.java | 16 +- .../Native117WorldgenAccess.java | 6 +- .../NativeBlockEntityTicks.java | 6 +- .../mc/advantageworks/NativeEntityHold.java | 2 +- .../advantageworks/NativeEntityTickGate.java | 6 +- .../mc/advantageworks/NativeHarvestProbe.java | 20 +- .../mc/advantageworks/NativeInteropProbe.java | 201 ++- .../advantageworks/NativeOilBucketProbe.java | 33 +- .../advantageworks/NativeTicketGeometry.java | 6 +- .../advantageworks/PowerOperationalCases.java | 4 +- .../mc/advantageworks/ProcessProgression.java | 40 +- .../mc/advantageworks/ProgressionProbe.java | 32 +- .../mc/advantageworks/RecipeBookProbe.java | 2 + .../mc/advantageworks/RecipeUnlockProbe.java | 162 ++- .../advantageworks/RedstoneReloadProbe.java | 20 +- .../SteamOperationalActors.java | 10 +- .../advantageworks/SteamOperationalCases.java | 28 +- .../SteamOperationalSupplementalCases.java | 6 +- .../mc/advantageworks/WorksCapabilities.java | 17 + .../mc/advantageworks/WorksController.java | 32 +- .../mc/advantageworks/WorksEntityUpdates.java | 23 + .../mc/advantageworks/WorksLevelTick.java | 20 + .../mc/advantageworks/WorksResultWriter.java | 10 +- .../src/main/resources/META-INF/mods.toml | 31 - .../resources/META-INF/neoforge.mods.toml | 20 + .../native1211neo-helper-contract.json | 27 + .../mc/advantageworks/runner/WorksRunner.java | 2 +- .../ConnectedProbeObservationTest.java | 6 +- .../LifecycleNaturalTickObserverTest.java | 4 +- .../Native117AsyncWorldgenSourceTest.java | 4 +- .../Native117CommandRegistrationTest.java | 4 +- .../Native117EntityContextTest.java | 2 + .../Native117HammerQueryGateTest.java | 10 +- .../Native117JoiningHoldTest.java | 12 +- .../advantageworks/Native117PlayerIoTest.java | 3 +- .../Native117RedstoneReadinessTest.java | 2 +- .../Native117RespawnRequestTest.java | 2 +- .../Native117StoppedEntitiesSnapshotTest.java | 6 +- ...ative117StoppedEntitiesSnapshotV2Test.java | 4 +- .../NativeEntityReadSelectorsTest.java | 2 +- .../NativeEntityTickGateTest.java | 4 +- .../NativeRegistryExportTest.java | 116 ++ .../advantageworks/ProfileManifestTest.java | 2 +- .../advantageworks/WorksWorldGuardTest.java | 10 +- .../WorldgenProtocolContractTest.java | 5 +- .../runner/HarnessOutputIsolationTest.java | 2 +- .../runner/Native114ProfileTest.java | 6 +- .../runner/Native115ProfileTest.java | 8 +- .../runner/Native117ProfileTest.java | 8 +- .../runner/Native117RunnerLaunchTest.java | 2 +- .../runner/Native1201ProfileTest.java | 2 +- .../ForgeCapabilityBootstrap.java | 12 +- .../unit/Forge52UnitControl.java | 39 +- .../unit/ForgeUnitRegistries.java | 63 +- .../unit/NativeClassResources.java | 19 + .../mc/advantageworks/unit/TestProject.java | 15 + 345 files changed, 10508 insertions(+), 4222 deletions(-) create mode 100644 .github/NativeDependencyPins.psm1 create mode 100644 .github/native-dependencies.json create mode 100644 .github/pinned-native-inputs.gradle create mode 100644 .github/test-native-dependencies.ps1 create mode 100644 .github/verify-native-dependencies.ps1 create mode 100644 docs/1.21.1-neoforge/TEST-RESULTS.md create mode 100644 gradle/client-integration.gradle create mode 100644 gradle/verify-eclipse-ecj.gradle create mode 100644 src/main/java/zone/moddev/mc/basepower/client/ClientRegistration.java create mode 100644 src/main/java/zone/moddev/mc/basepower/compat/CrushingRecipes.java create mode 100644 src/main/java/zone/moddev/mc/basepower/migration/NativePersistentData.java create mode 100644 src/main/java/zone/moddev/mc/basepower/util/RegistryValues.java rename src/main/resources/META-INF/{mods.toml => neoforge.mods.toml} (58%) create mode 100644 src/main/resources/data/c/tags/item/bars.json create mode 100644 src/main/resources/data/c/tags/item/bars/steel.json create mode 100644 src/main/resources/data/c/tags/item/dusts/charcoal.json create mode 100644 src/main/resources/data/c/tags/item/dusts/coal.json create mode 100644 src/main/resources/data/c/tags/item/dusts/lead.json create mode 100644 src/main/resources/data/c/tags/item/dusts/redstone.json create mode 100644 src/main/resources/data/c/tags/item/dusts/silver.json create mode 100644 src/main/resources/data/c/tags/item/dusts/tin.json create mode 100644 src/main/resources/data/c/tags/item/frames/steel.json create mode 100644 src/main/resources/data/c/tags/item/gears.json create mode 100644 src/main/resources/data/c/tags/item/gears/steel.json create mode 100644 src/main/resources/data/c/tags/item/gems/diamond.json create mode 100644 src/main/resources/data/c/tags/item/gems/emerald.json create mode 100644 src/main/resources/data/c/tags/item/governors.json create mode 100644 src/main/resources/data/c/tags/item/ingots/brass.json create mode 100644 src/main/resources/data/c/tags/item/ingots/copper.json create mode 100644 src/main/resources/data/c/tags/item/ingots/gold.json create mode 100644 src/main/resources/data/c/tags/item/ingots/iron.json create mode 100644 src/main/resources/data/c/tags/item/ingots/lead.json create mode 100644 src/main/resources/data/c/tags/item/ingots/nickel.json create mode 100644 src/main/resources/data/c/tags/item/ingots/plastic.json create mode 100644 src/main/resources/data/c/tags/item/ingots/refined_iron.json create mode 100644 src/main/resources/data/c/tags/item/ingots/rubber.json create mode 100644 src/main/resources/data/c/tags/item/ingots/steel.json create mode 100644 src/main/resources/data/c/tags/item/ingots/zinc.json create mode 100644 src/main/resources/data/c/tags/item/nuggets/bronze.json create mode 100644 src/main/resources/data/c/tags/item/nuggets/copper.json create mode 100644 src/main/resources/data/c/tags/item/nuggets/gold.json create mode 100644 src/main/resources/data/c/tags/item/nuggets/iron.json create mode 100644 src/main/resources/data/c/tags/item/nuggets/lead.json create mode 100644 src/main/resources/data/c/tags/item/nuggets/tin.json create mode 100644 src/main/resources/data/c/tags/item/pipes.json create mode 100644 src/main/resources/data/c/tags/item/plastic.json create mode 100644 src/main/resources/data/c/tags/item/plates/copper.json create mode 100644 src/main/resources/data/c/tags/item/plates/iron.json create mode 100644 src/main/resources/data/c/tags/item/plates/steel.json create mode 100644 src/main/resources/data/c/tags/item/power_supply_units.json create mode 100644 src/main/resources/data/c/tags/item/rods.json create mode 100644 src/main/resources/data/c/tags/item/rods/copper.json create mode 100644 src/main/resources/data/c/tags/item/rods/wooden.json create mode 100644 src/main/resources/data/c/tags/item/rubber.json create mode 100644 src/main/resources/data/c/tags/item/sprockets.json create mode 100644 src/main/resources/data/c/tags/item/sprockets/steel.json create mode 100644 src/main/resources/data/c/tags/item/stone.json create mode 100644 src/main/resources/data/c/tags/item/storage_blocks/diamond.json create mode 100644 src/main/resources/data/c/tags/item/storage_blocks/steel.json create mode 100644 src/main/resources/data/forge/tags/block/stone.json rename src/main/resources/data/{forge => neoforge}/loot_modifiers/global_loot_modifiers.json (100%) create mode 100644 src/test/java/zone/moddev/mc/basepower/migration/LegacyEntityDataFixesTest.java create mode 100644 src/test/java/zone/moddev/mc/basepower/migration/NativePersistentDataTest.java create mode 100644 src/test/java/zone/moddev/mc/basepower/util/NativeBucketContentTest.java create mode 100644 test-rig/client-integration/README.md create mode 100644 test-rig/client-integration/java/zone/moddev/mc/advantageworks/integration/NativeClientIntegration.java create mode 100644 test-rig/client-integration/resources/META-INF/neoforge.mods.toml rename test-rig/client-resources/resources/META-INF/{mods.toml => neoforge.mods.toml} (78%) create mode 100644 test-rig/migration/audit_native1211neo_endurance.py create mode 100644 test-rig/migration/native1211neo.py create mode 100644 test-rig/migration/native1211neo_actors.py create mode 100644 test-rig/migration/native1211neo_broad.py create mode 100644 test-rig/migration/native1211neo_crushing.py create mode 100644 test-rig/migration/native1211neo_endurance.py create mode 100644 test-rig/migration/native1211neo_machines.py create mode 100644 test-rig/migration/native1211neo_networks.py create mode 100644 test-rig/migration/native1211neo_operations.py create mode 100644 test-rig/migration/native1211neo_preservation.py create mode 100644 test-rig/migration/native1211neo_recipes.py create mode 100644 test-rig/migration/native1211neo_upgrade.py create mode 100644 test-rig/migration/native1211neo_worldgen.py create mode 100644 test-rig/migration/neoforge_code.py create mode 100644 test-rig/migration/test_native1211neo_actor_network_adapters.py create mode 100644 test-rig/migration/test_native1211neo_identity.py create mode 100644 test-rig/migration/test_native1211neo_preservation.py create mode 100644 test-rig/migration/test_native1211neo_recipe_exports.py create mode 100644 test-rig/migration/test_native1211neo_runtime_views.py create mode 100644 test-rig/migration/test_native1211neo_worldgen.py create mode 100644 test-rig/platform-controls/neo1211/.gitignore create mode 100644 test-rig/platform-controls/neo1211/README.md create mode 100644 test-rig/platform-controls/neo1211/build.gradle create mode 100644 test-rig/platform-controls/neo1211/gradle.properties create mode 100644 test-rig/platform-controls/neo1211/settings.gradle create mode 100644 test-rig/platform-controls/neo1211/src/main/java/zone/moddev/mc/nativeplatform/NativePlatformControlMod.java create mode 100644 test-rig/platform-controls/neo1211/src/main/resources/META-INF/neoforge.mods.toml create mode 100644 test-rig/platform-controls/neo1211/src/test/java/zone/moddev/mc/nativeplatform/NativePlatformControlsTest.java create mode 100644 test-rig/platform-controls/neo1211/src/test/java/zone/moddev/mc/nativeplatform/NeoControlBootstrap.java create mode 100644 test-rig/profiles/native1211neo/power-interop.json create mode 100644 test-rig/src/main/java/zone/moddev/mc/advantageworks/CrushingInteropProbe.java create mode 100644 test-rig/src/main/java/zone/moddev/mc/advantageworks/WorksCapabilities.java create mode 100644 test-rig/src/main/java/zone/moddev/mc/advantageworks/WorksEntityUpdates.java create mode 100644 test-rig/src/main/java/zone/moddev/mc/advantageworks/WorksLevelTick.java delete mode 100644 test-rig/src/main/resources/META-INF/mods.toml create mode 100644 test-rig/src/main/resources/META-INF/neoforge.mods.toml create mode 100644 test-rig/src/main/resources/assets/advantageworkstest/native1211neo-helper-contract.json create mode 100644 test-rig/src/test/java/zone/moddev/mc/advantageworks/NativeRegistryExportTest.java create mode 100644 test-rig/unit-support/zone/moddev/mc/advantageworks/unit/NativeClassResources.java create mode 100644 test-rig/unit-support/zone/moddev/mc/advantageworks/unit/TestProject.java diff --git a/.github/NativeDependencyPins.psm1 b/.github/NativeDependencyPins.psm1 new file mode 100644 index 00000000..2b647102 --- /dev/null +++ b/.github/NativeDependencyPins.psm1 @@ -0,0 +1,111 @@ +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +function Read-NativeProperties([string]$Path) { + $properties = @{} + foreach ($line in Get-Content -LiteralPath $Path) { + if ($line -match '^\s*([^#!\s=]+)\s*=(.*)$') { + $properties[$Matches[1]] = $Matches[2].Trim() + } + } + return $properties +} + +function Read-NativeDependencyPins([string]$LockPath, [hashtable]$Properties) { + $lock = Get-Content -LiteralPath $LockPath -Raw | ConvertFrom-Json -AsHashtable + if ($lock.schemaVersion -ne 1) { throw 'Unsupported native dependency lock schema' } + if ($lock.status -ne 'HOSTED_INPUTS_READY') { + throw "BOOTSTRAP_BLOCKED: $($lock.reason)" + } + $target = $lock.target + if ($target.minecraft -ne '1.21.1' -or $target.neoforge -ne '21.1.265' -or + $target.java -ne '21' -or $target.moddev -ne '2.0.148' -or $target.gradle -ne '9.8.0' -or + $target.releaseBranch -ne 'master-1.21.1-neo') { throw 'Wrong native build target' } + if ($Properties.minecraft_version -ne $target.minecraft -or $Properties.neo_version -ne $target.neoforge -or + $Properties.java_version -ne $target.java -or $Properties.loader_name -ne 'neoforge' -or + $Properties.loader_code -ne '2') { throw 'Dependency lock differs from the project target' } + $ids = @($lock.dependencies | ForEach-Object { $_.id } | Sort-Object) + if (($ids -join ',') -ne 'basemetals,mmdlib,orespawn') { throw 'Exactly three unique native dependencies are required' } + $coordinates = @{ + basemetals = @('zone.moddev.mc.basemetals', 'BaseMetals', 'basemetals_version', 'basemetals_deobf_sha256') + mmdlib = @('zone.moddev.mc.lib', 'mmdlib', 'mmdlib_version', 'mmdlib_sha256') + orespawn = @('zone.moddev.mc.orespawn', 'OreSpawn', 'orespawn_version', 'orespawn_deobf_sha256') + } + foreach ($pin in $lock.dependencies) { + $expected = $coordinates[$pin.id] + if ($pin.state -ne 'PUBLISHED') { throw "Dependency $($pin.id) is not a published input" } + if ($pin.group -cne $expected[0] -or $pin.artifact -cne $expected[1] -or + $pin.versionProperty -cne $expected[2] -or $pin.hashProperty -cne $expected[3]) { + throw "Unexpected coordinate or project property for $($pin.id)" + } + if ($pin.version -cne $Properties[$pin.versionProperty] -or + $pin.sha256 -cne $Properties[$pin.hashProperty]) { throw "Project pin differs for $($pin.id)" } + if ($pin.sha256 -cnotmatch '^[A-F0-9]{64}$' -or + $pin.mavenVersion -notmatch '^\d+\.\d+\.\d+\.121012(?:\+Neo)?$' -or + $pin.mavenVersion -cnotin @($pin.version, ($pin.version + '+Neo')) -or + $pin.modVersion -cne $pin.mavenVersion -or + [string]::IsNullOrWhiteSpace($pin.modVersion) -or + $pin.modVersion -match '(?i)development|snapshot|unqualified') { + throw "Missing exact public native artifact identity for $($pin.id)" + } + if ($pin.ContainsKey('source')) { + $source = $pin.source + if ($source.repository -cne "MinecraftModDevelopmentMods/$($pin.artifact)" -or + $source.commit -cnotmatch '^[a-f0-9]{40}$' -or + $source.branch -notmatch '^master-1\.21\.1(?:-neo|-neoforge)?$') { + throw "Missing approved source ancestry pin for $($pin.id)" + } + $property = "$($pin.id)_source_commit" + if (!$Properties.ContainsKey($property) -or $Properties[$property] -cne $source.commit) { + throw "Project source pin differs for $($pin.id)" + } + } elseif ($pin.id -eq 'basemetals') { throw 'Base Metals hook requires an exact merged source pin' } + if ($pin.id -eq 'basemetals' -and $pin.requiredEntry -cne 'zone/moddev/mc/basemetals/migration/LegacyWorldDataHook.class') { + throw 'Base Metals migration-hook gate was removed' + } + } + return $lock +} + +function Assert-NativeSourceAncestry($Pin, [scriptblock]$Compare = { + param($Uri) + $status = & gh api $Uri --jq '.status' + if ($LASTEXITCODE -ne 0) { throw 'GitHub source comparison failed' } + return $status +}) { + if (!$Pin.ContainsKey('source')) { return } + $source = $Pin.source + $uri = "repos/$($source.repository)/compare/$($source.commit)...$($source.branch)" + $status = & $Compare $uri + if ($status -notin @('identical', 'ahead')) { + throw "Source $($source.commit) is not merged on $($source.branch): $status" + } +} + +function Assert-NativeDependencyArchive([string]$Path, $Pin) { + if ((Get-FileHash -LiteralPath $Path -Algorithm SHA256).Hash -cne $Pin.sha256) { + throw "SHA-256 mismatch for $($Pin.id)" + } + Add-Type -AssemblyName System.IO.Compression.FileSystem + $archive = [IO.Compression.ZipFile]::OpenRead($Path) + try { + $entry = $archive.GetEntry('META-INF/neoforge.mods.toml') + if (!$entry -or $archive.GetEntry('META-INF/mods.toml')) { throw "Not a native NeoForge jar: $($Pin.id)" } + $reader = [IO.StreamReader]::new($entry.Open()) + try { $metadata = $reader.ReadToEnd() } finally { $reader.Dispose() } + $header = [regex]::Match($metadata, '(?ms)^[ \t]*\[\[mods\]\][ \t]*(?:#[^\r\n]*)?\r?\n(.*?)(?=^[ \t]*\[|\z)').Groups[1].Value + $id = [regex]::Escape($Pin.id) + $version = [regex]::Escape($Pin.modVersion) + if ($metadata -match '\$\{[^}]+\}' -or + $header -notmatch "(?m)^[ \t]*modId[ \t]*=[ \t]*`"$id`"[ \t]*(?:#[^\r\n]*)?\r?$" -or + $header -notmatch "(?m)^[ \t]*version[ \t]*=[ \t]*`"$version`"[ \t]*(?:#[^\r\n]*)?\r?$" -or + $metadata -notmatch '(?m)^[ \t]*modId[ \t]*=[ \t]*"neoforge"[ \t]*(?:#[^\r\n]*)?\r?$') { + throw "Jar metadata differs for $($Pin.id)" + } + if ($Pin.ContainsKey('requiredEntry') -and !$archive.GetEntry($Pin.requiredEntry)) { + throw 'Base Metals jar does not contain the approved migration hook' + } + } finally { $archive.Dispose() } +} + +Export-ModuleMember -Function Read-NativeProperties, Read-NativeDependencyPins, Assert-NativeSourceAncestry, Assert-NativeDependencyArchive diff --git a/.github/native-dependencies.json b/.github/native-dependencies.json new file mode 100644 index 00000000..bd8c63c8 --- /dev/null +++ b/.github/native-dependencies.json @@ -0,0 +1,63 @@ +{ + "schemaVersion": 1, + "status": "HOSTED_INPUTS_READY", + "reason": "All three dependencies are public. Base Metals PR #545 is merged and its release jar matches CurseForge, Maven and GitHub downloads.", + "target": { + "minecraft": "1.21.1", + "neoforge": "21.1.265", + "java": "21", + "moddev": "2.0.148", + "gradle": "9.8.0", + "releaseBranch": "master-1.21.1-neo" + }, + "dependencies": [ + { + "id": "basemetals", + "group": "zone.moddev.mc.basemetals", + "artifact": "BaseMetals", + "versionProperty": "basemetals_version", + "hashProperty": "basemetals_deobf_sha256", + "version": "4.0.1.121012+Neo", + "mavenVersion": "4.0.1.121012+Neo", + "modVersion": "4.0.1.121012+Neo", + "sha256": "B4BB1CBCD54DFCF2EC8465ACE82715EDCCC5BF1E5C15E14C627AE7CC58E8FED1", + "state": "PUBLISHED", + "source": { + "repository": "MinecraftModDevelopmentMods/BaseMetals", + "branch": "master-1.21.1-neo", + "commit": "39b240bb0d9f80997847ab4df70a2dd23e6ea826", + "baselineCommit": "4d63af931292e5020a5e0a3ddbd73a87ab1f410f" + }, + "requiredEntry": "zone/moddev/mc/basemetals/migration/LegacyWorldDataHook.class" + }, + { + "id": "mmdlib", + "group": "zone.moddev.mc.lib", + "artifact": "mmdlib", + "versionProperty": "mmdlib_version", + "hashProperty": "mmdlib_sha256", + "version": "2.0.2.121012+Neo", + "mavenVersion": "2.0.2.121012+Neo", + "modVersion": "2.0.2.121012+Neo", + "sha256": "EE417C82D588B0050A49709B6430CF836315E71E4DB2DF4036D3735454BC5311", + "state": "PUBLISHED" + }, + { + "id": "orespawn", + "group": "zone.moddev.mc.orespawn", + "artifact": "OreSpawn", + "versionProperty": "orespawn_version", + "hashProperty": "orespawn_deobf_sha256", + "version": "4.1.1.121012", + "mavenVersion": "4.1.1.121012", + "modVersion": "4.1.1.121012", + "sha256": "BF02244E25B5FBF89CCAD45F41B2624B850D4BBCB70CF66822249BA233A00976", + "state": "PUBLISHED", + "source": { + "repository": "MinecraftModDevelopmentMods/OreSpawn", + "branch": "master-1.21.1-neo", + "commit": "f141ae56ea69e4c9f7f8ebd7697b933a91ee5001" + } + } + ] +} diff --git a/.github/pinned-native-inputs.gradle b/.github/pinned-native-inputs.gradle new file mode 100644 index 00000000..214cf9ae --- /dev/null +++ b/.github/pinned-native-inputs.gradle @@ -0,0 +1,36 @@ +import groovy.json.JsonSlurper +import java.security.MessageDigest + +allprojects { + afterEvaluate { project -> + def lock = new JsonSlurper().parse(project.file('.github/native-dependencies.json')) + if (lock.status != 'HOSTED_INPUTS_READY') { + throw new GradleException('Hosted dependency bootstrap is blocked; local hook hashes are not release pins') + } + def arguments = [basemetals: 'baseMetalsJar', mmdlib: 'mmdlibJar', orespawn: 'oreSpawnJar'] + def resolved = [:] + lock.dependencies.each { pin -> + def path = project.providers.gradleProperty(arguments[pin.id]).orNull + if (!path) throw new GradleException('Missing pinned dependency path: ' + pin.id) + File jar = project.file(path) + String actual = jar.isFile() ? MessageDigest.getInstance('SHA-256').digest(jar.bytes) + .encodeHex().toString().toUpperCase(Locale.ROOT) : '' + if (pin.state != 'PUBLISHED' || actual != pin.sha256 + || project.property(pin.versionProperty) != pin.version + || project.property(pin.hashProperty) != pin.sha256) { + throw new GradleException('Changed or unapproved hosted input: ' + pin.id) + } + resolved[pin.id] = jar + } + // Use exactly the verified files rather than independently resolving Maven bytes again. + project.configurations.configureEach { + withDependencies { dependencies -> + dependencies.removeAll { dependency -> lock.dependencies.any { pin -> + dependency.group == pin.group && dependency.name == pin.artifact + } } + } + } + project.dependencies.add('pinnedBaseMetals', project.files(resolved.basemetals)) + project.dependencies.add('implementation', project.files(resolved.mmdlib, resolved.orespawn)) + } +} diff --git a/.github/test-base-metals-pin.sh b/.github/test-base-metals-pin.sh index 8d5da556..d5ba9375 100644 --- a/.github/test-base-metals-pin.sh +++ b/.github/test-base-metals-pin.sh @@ -1,52 +1,3 @@ #!/usr/bin/env bash set -euo pipefail - -verify="$(cd "$(dirname "$0")" && pwd)/verify-base-metals-pin.sh" -temporary_root="$(cd "${TMPDIR:-/tmp}" && pwd -P)" -scratch="$(mktemp -d "$temporary_root/basepower-pin.XXXXXXXX")" -cleanup() { - local resolved - resolved="$(cd "$scratch" && pwd -P)" - case "$resolved" in - "$temporary_root"/basepower-pin.*) rm -rf -- "$resolved" ;; - *) echo 'Refusing to clear an unexpected test directory' >&2; return 1 ;; - esac -} -trap cleanup EXIT -mkdir -p "$scratch/bin" "$scratch/project" -cat > "$scratch/bin/gh" <<'MOCK' -#!/usr/bin/env bash -set -euo pipefail -[[ "$#" == 4 && "$1" == api && "$2" == "$EXPECTED_COMPARE" && "$3" == --jq && "$4" == .status ]] -printf '%s\n' "$PIN_STATUS" -MOCK -chmod +x "$scratch/bin/gh" -export PATH="$scratch/bin:$PATH" -commit=1111111111111111111111111111111111111111 -cd "$scratch/project" -for minecraft in 1.20.6 1.21.1 1.21.11; do - printf 'minecraft_version=%s\nbasemetals_source_commit=%s\n' "$minecraft" "$commit" > gradle.properties - export EXPECTED_COMPARE="repos/MinecraftModDevelopmentMods/BaseMetals/compare/$commit...master-$minecraft" - export GITHUB_OUTPUT="$scratch/output" - for PIN_STATUS in identical ahead; do - export PIN_STATUS - : > "$GITHUB_OUTPUT" - bash "$verify" - grep -qx "commit=$commit" "$GITHUB_OUTPUT" - done - for PIN_STATUS in behind diverged; do - export PIN_STATUS - : > "$GITHUB_OUTPUT" - if bash "$verify" > "$scratch/rejected.log" 2>&1; then - echo "Incorrectly accepted $minecraft / $PIN_STATUS" >&2 - exit 1 - fi - test ! -s "$GITHUB_OUTPUT" - done -done -printf 'minecraft_version=invalid\nbasemetals_source_commit=%s\n' "$commit" > gradle.properties -if bash "$verify" > "$scratch/invalid.log" 2>&1; then - echo 'Incorrectly accepted an invalid target' >&2 - exit 1 -fi -echo 'PASS: target-derived Base Metals ancestry guards and rejection controls' +exec pwsh -NoProfile -File "$(dirname "$0")/test-native-dependencies.ps1" "$@" diff --git a/.github/test-native-dependencies.ps1 b/.github/test-native-dependencies.ps1 new file mode 100644 index 00000000..eb293f12 --- /dev/null +++ b/.github/test-native-dependencies.ps1 @@ -0,0 +1,143 @@ +param([string]$EvidenceDirectory) +$ErrorActionPreference = 'Stop' +Import-Module (Join-Path $PSScriptRoot 'NativeDependencyPins.psm1') -Force +$project = Split-Path $PSScriptRoot -Parent +$properties = Read-NativeProperties (Join-Path $project 'gradle.properties') +$lockPath = Join-Path $PSScriptRoot 'native-dependencies.json' +$original = Get-Content -LiteralPath $lockPath -Raw | ConvertFrom-Json -AsHashtable +$root = if ($EvidenceDirectory) { [IO.Path]::GetFullPath($EvidenceDirectory) } + else { Join-Path ([IO.Path]::GetTempPath()) ('power-native-pin-tests-' + [guid]::NewGuid().ToString('N')) } +if (Test-Path -LiteralPath $root) { throw 'Use a new dependency-test evidence directory' } +New-Item -ItemType Directory -Path $root | Out-Null +$results = [Collections.Generic.List[object]]::new() +function Check([string]$Name, [scriptblock]$Action) { + & $Action + $results.Add(@{name=$Name; status='PASS'}) +} +function Reject([scriptblock]$Action) { + $failed = $false + try { & $Action | Out-Null } catch { $failed = $true } + if (!$failed) { throw 'Expected the unsafe input to be rejected' } +} +function Clone($Value) { return ($Value | ConvertTo-Json -Depth 20 | ConvertFrom-Json -AsHashtable) } +function Test-Lock($Value) { + $path = Join-Path $root ('lock-' + [guid]::NewGuid().ToString('N') + '.json') + $Value | ConvertTo-Json -Depth 20 | Set-Content -LiteralPath $path -Encoding utf8 + Read-NativeDependencyPins $path $properties +} +function New-TestJar($Pin, [string]$Version, [switch]$Forge, [switch]$OmitHook) { + Add-Type -AssemblyName System.IO.Compression.FileSystem + $path = Join-Path $root ([guid]::NewGuid().ToString('N') + '.jar') + $archive = [IO.Compression.ZipFile]::Open($path, [IO.Compression.ZipArchiveMode]::Create) + try { + $name = if ($Forge) { 'META-INF/mods.toml' } else { 'META-INF/neoforge.mods.toml' } + $writer = [IO.StreamWriter]::new($archive.CreateEntry($name).Open()) + try { + $writer.Write("modLoader=`"javafml`" # native loader`nloaderVersion=`"[4,)`"`n[[mods]] # mandatory header`nmodId=`"$($Pin.id)`" # identity`nversion=`"$Version`" # exact version`n[[dependencies.$($Pin.id)]]`n modId=`"neoforge`" # native dependency`n type=`"required`"`n") + } finally { $writer.Dispose() } + if ($Pin.ContainsKey('requiredEntry') -and !$OmitHook) { + $stream = $archive.CreateEntry($Pin.requiredEntry).Open() + $stream.Dispose() + } + } finally { $archive.Dispose() } + return $path +} +try { + Check 'current bootstrap cannot claim hosted qualification' { + if ($original.status -eq 'BOOTSTRAP_LOCAL_ONLY') { + Reject { Read-NativeDependencyPins $lockPath $properties } + } else { Read-NativeDependencyPins $lockPath $properties | Out-Null } + } + $valid = Clone $original + $valid.status = 'HOSTED_INPUTS_READY' + $bm = $valid.dependencies | Where-Object id -eq 'basemetals' + $bm.state = 'PUBLISHED' + $bm.mavenVersion = $bm.version + $bm.modVersion = $bm.mavenVersion + $bm.sha256 = $properties.basemetals_deobf_sha256 + $bm.source.commit = $properties.basemetals_source_commit + $bm.source.branch = 'master-1.21.1-neo' + Check 'synthetic complete public pin structure is accepted' { Test-Lock $valid | Out-Null } + foreach ($id in 'basemetals','mmdlib','orespawn') { + Check "$id hash drift is rejected" { + $mutant = Clone $valid + ($mutant.dependencies | Where-Object id -eq $id).sha256 = '0' * 64 + Reject { Test-Lock $mutant } + } + Check "$id unpublished state is rejected" { + $mutant = Clone $valid + ($mutant.dependencies | Where-Object id -eq $id).state = 'LOCAL_SOURCE_UNCOMMITTED' + Reject { Test-Lock $mutant } + } + Check "$id cannot be omitted" { + $mutant = Clone $valid + $mutant.dependencies = @($mutant.dependencies | Where-Object id -ne $id) + Reject { Test-Lock $mutant } + } + } + Check 'public BM 4.0.0 cannot substitute for the 4.0.1 hook candidate' { + $mutant = Clone $valid + ($mutant.dependencies | Where-Object id -eq 'basemetals').version = '4.0.0.121012' + Reject { Test-Lock $mutant } + } + Check 'an uncommitted BM source cannot qualify by its old baseline commit' { + $mutant = Clone $valid + ($mutant.dependencies | Where-Object id -eq 'basemetals').source.commit = $null + Reject { Test-Lock $mutant } + } + Check 'duplicate dependency cannot replace a missing dependency' { + $mutant = Clone $valid + $mutant.dependencies[1] = Clone $mutant.dependencies[0] + Reject { Test-Lock $mutant } + } + Check 'wrong native platform target is rejected' { + $mutant = Clone $valid + $mutant.target.neoforge = '52.1.0' + Reject { Test-Lock $mutant } + } + foreach ($status in 'identical','ahead','behind','diverged','unknown') { + Check "source ancestry status $status is handled strictly" { + $expected = "repos/$($bm.source.repository)/compare/$($bm.source.commit)...$($bm.source.branch)" + $expectedStatus = $status + $compare = { param($uri) + if ($uri -cne $expected) { throw "Wrong source ancestry query: got '$uri', expected '$expected'" } + return $expectedStatus + }.GetNewClosure() + if ($status -in @('identical','ahead')) { Assert-NativeSourceAncestry $bm $compare } + else { Reject { Assert-NativeSourceAncestry $bm $compare } } + } + } + foreach ($id in 'basemetals','mmdlib','orespawn') { + $pin = Clone ($valid.dependencies | Where-Object id -eq $id) + $jar = New-TestJar $pin $pin.modVersion + $pin.sha256 = (Get-FileHash -LiteralPath $jar -Algorithm SHA256).Hash + Check "$id native metadata and exact bytes are accepted" { Assert-NativeDependencyArchive $jar $pin } + Check "$id modified jar hash is rejected" { + $bad = Clone $pin + $bad.sha256 = '0' * 64 + Reject { Assert-NativeDependencyArchive $jar $bad } + } + Check "$id Forge jar is rejected even with its matching checksum" { + $badJar = New-TestJar $pin $pin.modVersion -Forge + $bad = Clone $pin + $bad.sha256 = (Get-FileHash -LiteralPath $badJar -Algorithm SHA256).Hash + Reject { Assert-NativeDependencyArchive $badJar $bad } + } + Check "$id wrong mod version is rejected even with its matching checksum" { + $badJar = New-TestJar $pin '0.0.0' + $bad = Clone $pin + $bad.sha256 = (Get-FileHash -LiteralPath $badJar -Algorithm SHA256).Hash + Reject { Assert-NativeDependencyArchive $badJar $bad } + } + } + Check 'native BM jar without the migration hook is rejected' { + $badJar = New-TestJar $bm $bm.modVersion -OmitHook + $bad = Clone $bm + $bad.sha256 = (Get-FileHash -LiteralPath $badJar -Algorithm SHA256).Hash + Reject { Assert-NativeDependencyArchive $badJar $bad } + } +} finally { + @{scope='OFFLINE_GUARD_TESTS_NOT_JAVA_OR_RELEASE_QUALIFICATION'; results=@($results.ToArray())} | + ConvertTo-Json -Depth 8 | Set-Content -LiteralPath (Join-Path $root 'results.json') -Encoding utf8 +} +Write-Output "PASS: $($results.Count) offline native dependency guard checks. No network, Java or Gradle run. Evidence: $root" diff --git a/.github/verify-base-metals-pin.sh b/.github/verify-base-metals-pin.sh index e526e396..5be20de0 100644 --- a/.github/verify-base-metals-pin.sh +++ b/.github/verify-base-metals-pin.sh @@ -1,24 +1,4 @@ #!/usr/bin/env bash set -euo pipefail - -commit="$(sed -n 's/^basemetals_source_commit=//p' gradle.properties)" -if [[ ! "$commit" =~ ^[0-9a-f]{40}$ ]]; then - echo "::error::Expected a full Base Metals source commit in gradle.properties" - exit 1 -fi - -minecraft="$(sed -n 's/^minecraft_version=//p' gradle.properties)" -if [[ ! "$minecraft" =~ ^1\.[0-9]+\.[0-9]+$ ]]; then - echo "::error::Expected a complete Minecraft target version in gradle.properties" - exit 1 -fi -branch="master-$minecraft" -if ! status="$(gh api "repos/MinecraftModDevelopmentMods/BaseMetals/compare/$commit...$branch" --jq '.status')"; then - echo "::error::Could not verify Base Metals $commit on upstream $branch" - exit 1 -fi -case "$status" in - identical|ahead) printf 'commit=%s\n' "$commit" >> "$GITHUB_OUTPUT" ;; - *) echo "::error::Base Metals $commit is not on upstream $branch ($status). Local-only pins cannot qualify hosted CI." - exit 1 ;; -esac +# Historical entry point now enforces the entire native dependency lock. +exec pwsh -NoProfile -File "$(dirname "$0")/verify-native-dependencies.ps1" "$@" diff --git a/.github/verify-native-dependencies.ps1 b/.github/verify-native-dependencies.ps1 new file mode 100644 index 00000000..333a2f6d --- /dev/null +++ b/.github/verify-native-dependencies.ps1 @@ -0,0 +1,31 @@ +param([string]$DownloadDirectory, [switch]$ValidateOnly) +$ErrorActionPreference = 'Stop' +$project = Split-Path $PSScriptRoot -Parent +Import-Module (Join-Path $PSScriptRoot 'NativeDependencyPins.psm1') -Force +$properties = Read-NativeProperties (Join-Path $project 'gradle.properties') +$lock = Read-NativeDependencyPins (Join-Path $PSScriptRoot 'native-dependencies.json') $properties +if ($ValidateOnly) { + Write-Output 'Hosted pin structure is valid; remote source and jar checks NOT RUN.' + return +} +if (!$DownloadDirectory) { throw 'Supply a dedicated -DownloadDirectory for the three pinned public jars' } +$directory = [IO.Path]::GetFullPath($DownloadDirectory) +if (Test-Path -LiteralPath $directory) { throw 'Use a new native dependency download directory' } +New-Item -ItemType Directory -Path $directory | Out-Null +$records = @() +foreach ($pin in $lock.dependencies) { + Assert-NativeSourceAncestry $pin + $segments = @($pin.group.Split('.')) + @($pin.artifact, $pin.mavenVersion, "$($pin.artifact)-$($pin.mavenVersion).jar") + $url = 'https://maven.moddev.zone/releases/' + (($segments | ForEach-Object { [Uri]::EscapeDataString($_) }) -join '/') + $path = Join-Path $directory "$($pin.artifact)-$($pin.mavenVersion).jar" + Invoke-WebRequest -Uri $url -OutFile $path -MaximumRetryCount 3 + Assert-NativeDependencyArchive $path $pin + $records += [ordered]@{ id=$pin.id; version=$pin.modVersion; path=$path; sha256=$pin.sha256; url=$url } + if ($env:GITHUB_ENV) { + $name = @{ basemetals='BASE_METALS_JAR'; mmdlib='MMDLIB_JAR'; orespawn='ORESPAWN_JAR' }[$pin.id] + "$name=$path" | Add-Content -LiteralPath $env:GITHUB_ENV -Encoding utf8 + } +} +$records | ConvertTo-Json -Depth 6 | Set-Content -LiteralPath (Join-Path $directory 'verified-inputs.json') -Encoding utf8 +if ($env:GITHUB_ENV) { "POWER_VERSION=$($properties.mod_version)" | Add-Content -LiteralPath $env:GITHUB_ENV -Encoding utf8 } +Write-Output 'Verified all three native dependency jars and required source ancestry. This is not Power gameplay or release approval.' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7e311bb..5d505597 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,118 +1,82 @@ -name: basePower 1.21.1 CI +name: basePower NeoForge 1.21.1 CI on: push: - branches: [master-1.21.1, 'feature/**'] + branches: [master-1.21.1-neo, 'feature/**'] pull_request: - branches: [master-1.21.1] + branches: [master-1.21.1-neo] permissions: contents: read concurrency: - group: basepower-1.21.1-${{ github.workflow }}-${{ github.ref }} + group: basepower-1211-neo-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: name: Build, test, and audit runs-on: ubuntu-latest - timeout-minutes: 90 + timeout-minutes: 30 steps: - - name: Check out PowerAdvantage + - name: Check out Power source uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - - name: Test target-derived dependency guards - run: bash .github/test-base-metals-pin.sh - - name: Require the Base Metals pin on upstream master-1.21.1 - id: base-metals-pin - env: - GH_TOKEN: ${{ github.token }} - run: bash .github/verify-base-metals-pin.sh + with: + fetch-depth: 0 - name: Use canonical LF dependency inputs run: git config --global core.autocrlf false - - name: Check out pinned OreSpawn - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - with: - repository: MinecraftModDevelopmentMods/OreSpawn - ref: 62c08169c71f4d4fd8f107289e63fd2a4c7c655c - path: .ci-dependencies/OreSpawn - - name: Check out pinned Base Metals - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - with: - repository: MinecraftModDevelopmentMods/BaseMetals - ref: 327c197bcdd0bb5e883d844bb6a6c8791bc580b7 - path: .ci-dependencies/BaseMetals - - name: Install pinned Java 25 Mavenizer runtime - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 - with: - distribution: temurin - java-version: '25.0.3+9.0.LTS' - - name: Install Java 8 launcher helper - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 - with: - distribution: temurin - java-version: '8.0.502+7' + - name: Test native dependency guards + shell: pwsh + run: ./.github/test-native-dependencies.ps1 + - name: Require approved public native dependency pins + shell: pwsh + env: + GH_TOKEN: ${{ github.token }} + run: ./.github/verify-native-dependencies.ps1 -DownloadDirectory "$env:RUNNER_TEMP/power-native-inputs" - name: Install Java 21 for Gradle and production uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 with: distribution: temurin java-version: '21.0.7+6.0.LTS' - - name: Use pinned build toolchains - # These are Gradle project properties, not JVM system properties. - shell: bash + - name: Use pinned build toolchain run: >- - echo "MMD_GRADLE_TOOLCHAINS=-Porg.gradle.java.installations.paths=$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64 + echo "MMD_GRADLE_TOOLCHAINS=-Porg.gradle.java.installations.paths=$JAVA_HOME -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.auto-download=false" >> "$GITHUB_ENV" - name: Set up Gradle uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6 - - name: Build pinned development dependencies - id: dependencies - shell: bash + - name: Build and audit native candidate run: | - set -euo pipefail - orespawn="$GITHUB_WORKSPACE/.ci-dependencies/OreSpawn" - basemetals="$GITHUB_WORKSPACE/.ci-dependencies/BaseMetals" - mavenizer="$orespawn/ci-fixtures/tools/minecraft-mavenizer-0.5.21-orespawn-compat.jar" - mirror="$RUNNER_TEMP/orespawn-mirror" - (cd "$basemetals" && bash gradle/stage-orespawn-release.sh "$mirror") - (cd "$orespawn" && bash gradlew $MMD_GRADLE_TOOLCHAINS jar --no-daemon --stacktrace) - (cd "$basemetals" && bash gradlew $MMD_GRADLE_TOOLCHAINS jar -PorespawnVerificationRepository="$mirror" --no-daemon --stacktrace) - osjar="$orespawn/build/libs/OreSpawn-4.1.0.121011.jar" - bmjar="$basemetals/build/libs/BaseMetals-3.1.2.121011.jar" - test -f "$osjar" && test -f "$bmjar" - echo "orespawn=$osjar" >> "$GITHUB_OUTPUT" - echo "basemetals=$bmjar" >> "$GITHUB_OUTPUT" - echo "mavenizer=$mavenizer" >> "$GITHUB_OUTPUT" - - name: Build and audit release artifacts - run: >- - ./gradlew $MMD_GRADLE_TOOLCHAINS clean check build javadoc verifyReleaseDependencies verifyReleaseArtifacts - writeReleaseChecksums verifyEclipseProductionClasspath - -PbaseMetalsDeobfJar=${{ steps.dependencies.outputs.basemetals }} - -PoreSpawnDeobfJar=${{ steps.dependencies.outputs.orespawn }} - -Pforge52MavenizerJar=${{ steps.dependencies.outputs.mavenizer }} - --no-daemon --stacktrace - - name: Upload audited release candidate + chmod +x gradlew + ./gradlew $MMD_GRADLE_TOOLCHAINS -I .github/pinned-native-inputs.gradle \ + clean check build javadoc verifyReleaseDependencies verifyReleaseArtifacts \ + writeReleaseChecksums verifyEclipseProductionClasspath \ + "-PbaseMetalsJar=$BASE_METALS_JAR" "-PmmdlibJar=$MMDLIB_JAR" "-PoreSpawnJar=$ORESPAWN_JAR" \ + --no-daemon --stacktrace + - name: Upload CI build, not release approval uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - name: basePower-1.21.1-${{ github.sha }} + name: basePower-1.21.1-neo-${{ github.sha }}-unapproved if-no-files-found: error retention-days: 30 path: | - build/libs/basePower-2.4.14.121011.jar - build/libs/basePower-2.4.14.121011-sources.jar - build/libs/basePower-2.4.14.121011-javadoc.jar + build/libs/basePower-${{ env.POWER_VERSION }}.jar + build/libs/basePower-${{ env.POWER_VERSION }}-sources.jar + build/libs/basePower-${{ env.POWER_VERSION }}-javadoc.jar build/release/SHA256SUMS CHANGELOG.txt - name: Upload diagnostics on failure if: failure() uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - name: basePower-1.21.1-diagnostics-${{ github.sha }} + name: basePower-1211-neo-diagnostics-${{ github.sha }} if-no-files-found: ignore retention-days: 14 path: | build/test-results/** build/reports/** - build/*-run/logs/** - build/problems/** + - name: Record remaining local delivery gates + if: always() + shell: pwsh + run: | + 'Dependency inputs are public and hash-pinned. Hosted checks do not replace packaged gameplay, migration, endurance, rendered-client checks or manual acceptance.' | Add-Content $env:GITHUB_STEP_SUMMARY diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 95af822a..1eb46a71 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -2,9 +2,9 @@ name: CodeQL on: push: - branches: [master-1.21.1, 'feature/**'] + branches: [master-1.21.1-neo, 'feature/**'] pull_request: - branches: [master-1.21.1] + branches: [master-1.21.1-neo] schedule: - cron: '47 7 * * 4' @@ -13,86 +13,53 @@ permissions: contents: read security-events: write +concurrency: + group: basepower-1211-neo-codeql-${{ github.ref }} + cancel-in-progress: true + jobs: analyze: name: Analyze Java runs-on: ubuntu-latest - timeout-minutes: 75 + timeout-minutes: 30 steps: - - name: Check out PowerAdvantage + - name: Check out Power source uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - - name: Test target-derived dependency guards - run: bash .github/test-base-metals-pin.sh - - name: Require the Base Metals pin on upstream master-1.21.1 - id: base-metals-pin - env: - GH_TOKEN: ${{ github.token }} - run: bash .github/verify-base-metals-pin.sh + with: + fetch-depth: 0 - name: Use canonical LF dependency inputs run: git config --global core.autocrlf false - - name: Check out pinned OreSpawn - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - with: - repository: MinecraftModDevelopmentMods/OreSpawn - ref: 62c08169c71f4d4fd8f107289e63fd2a4c7c655c - path: .ci-dependencies/OreSpawn - - name: Check out pinned Base Metals - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - with: - repository: MinecraftModDevelopmentMods/BaseMetals - ref: 327c197bcdd0bb5e883d844bb6a6c8791bc580b7 - path: .ci-dependencies/BaseMetals - - name: Install pinned Java 25 Mavenizer runtime - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 - with: - distribution: temurin - java-version: '25.0.3+9.0.LTS' - - name: Install Java 8 launcher helper - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 - with: - distribution: temurin - java-version: '8.0.502+7' + - name: Test native dependency guards + shell: pwsh + run: ./.github/test-native-dependencies.ps1 + - name: Require approved public native dependency pins + shell: pwsh + env: + GH_TOKEN: ${{ github.token }} + run: ./.github/verify-native-dependencies.ps1 -DownloadDirectory "$env:RUNNER_TEMP/power-native-inputs" - name: Install Java 21 for Gradle and production uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 with: distribution: temurin java-version: '21.0.7+6.0.LTS' - - name: Use pinned build toolchains - # These are Gradle project properties, not JVM system properties. - shell: bash + - name: Use pinned build toolchain run: >- - echo "MMD_GRADLE_TOOLCHAINS=-Porg.gradle.java.installations.paths=$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64 + echo "MMD_GRADLE_TOOLCHAINS=-Porg.gradle.java.installations.paths=$JAVA_HOME -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.auto-download=false" >> "$GITHUB_ENV" - name: Set up Gradle uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6 - - name: Build pinned development dependencies - id: dependencies - shell: bash - run: | - set -euo pipefail - orespawn="$GITHUB_WORKSPACE/.ci-dependencies/OreSpawn" - basemetals="$GITHUB_WORKSPACE/.ci-dependencies/BaseMetals" - mavenizer="$orespawn/ci-fixtures/tools/minecraft-mavenizer-0.5.21-orespawn-compat.jar" - mirror="$RUNNER_TEMP/orespawn-mirror" - (cd "$basemetals" && bash gradle/stage-orespawn-release.sh "$mirror") - chmod +x "$orespawn/gradlew" "$basemetals/gradlew" - (cd "$orespawn" && ./gradlew $MMD_GRADLE_TOOLCHAINS jar --no-daemon --stacktrace) - (cd "$basemetals" && ./gradlew $MMD_GRADLE_TOOLCHAINS jar -PorespawnVerificationRepository="$mirror" --no-daemon --stacktrace) - echo "orespawn=$orespawn/build/libs/OreSpawn-4.1.0.121011.jar" >> "$GITHUB_OUTPUT" - echo "basemetals=$basemetals/build/libs/BaseMetals-3.1.2.121011.jar" >> "$GITHUB_OUTPUT" - echo "mavenizer=$mavenizer" >> "$GITHUB_OUTPUT" - name: Initialize CodeQL uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4 with: languages: java-kotlin build-mode: manual - - name: Compile production code + - name: Compile native production code run: | - chmod +x ./gradlew - ./gradlew $MMD_GRADLE_TOOLCHAINS clean classes verifyReleaseDependencies --rerun-tasks --no-build-cache --no-daemon --stacktrace \ - -PbaseMetalsDeobfJar=${{ steps.dependencies.outputs.basemetals }} \ - -PoreSpawnDeobfJar=${{ steps.dependencies.outputs.orespawn }} \ - -Pforge52MavenizerJar=${{ steps.dependencies.outputs.mavenizer }} + chmod +x gradlew + ./gradlew $MMD_GRADLE_TOOLCHAINS -I .github/pinned-native-inputs.gradle \ + clean classes verifyReleaseDependencies \ + "-PbaseMetalsJar=$BASE_METALS_JAR" "-PmmdlibJar=$MMDLIB_JAR" "-PoreSpawnJar=$ORESPAWN_JAR" \ + --no-daemon --stacktrace - name: Analyze uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4 diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml index 3ca3a8d7..fca7994c 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -32,6 +32,8 @@ jobs: run: | set -euo pipefail + pwsh -NoProfile -File .github/verify-native-dependencies.ps1 -ValidateOnly + value() { sed -n "s/^$1=//p" gradle.properties; } release_version="$(value mod_version)" minecraft_version="$(value minecraft_version)" @@ -49,7 +51,7 @@ jobs: exit 1 fi case "$loader_name:$loader_code" in - forge:1|neoforge:2) ;; + neoforge:2) ;; *) echo "Invalid loader metadata $loader_name/$loader_code" >&2; exit 1 ;; esac printf -v minor_padded '%02d' "$((10#$mc_minor))" @@ -65,12 +67,18 @@ jobs: exit 1 fi + release_hash="$(value release_player_sha256)" + if [[ ! "$release_hash" =~ ^[A-F0-9]{64}$ ]]; then + echo "No frozen, approved player artifact digest. Diagnostic source bindings are not release pins." >&2 + exit 1 + fi + release_branch="master-$minecraft_version-neo" successful_ci="$(gh api --method GET \ "repos/$GITHUB_REPOSITORY/actions/workflows/ci.yml/runs" \ - -f head_sha="$GITHUB_SHA" -f branch="master-$minecraft_version" \ + -f head_sha="$GITHUB_SHA" -f branch="$release_branch" \ -f event=push -f status=success --jq '.total_count')" if [[ "$successful_ci" -lt 1 ]]; then - echo "The tagged commit has no successful push CI on master-$minecraft_version" >&2 + echo "The tagged commit has no successful push CI on $release_branch" >&2 exit 1 fi @@ -79,12 +87,13 @@ jobs: RELEASE_WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/workflows/deploy-release.yml run: | { - echo "## Release candidate validated" + echo "## Tag and hosted CI identity validated" echo echo "Tag \`$GITHUB_REF_NAME\` matches this target and has successful push CI on its release branch." echo echo "**Nothing has been published.**" echo - echo "Live publication requires \`deploy-release.yml\` on the repository default branch." + echo "This is not gameplay, migration, client-pixel or manual acceptance." + echo "Live publication still requires the guarded default-branch dispatcher and explicit artifact approval." echo "After the exact CI artifact is approved and registered, continue at: $RELEASE_WORKFLOW_URL" } >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/validate-gradle-build.yml b/.github/workflows/validate-gradle-build.yml index 2f2c732b..27014289 100644 --- a/.github/workflows/validate-gradle-build.yml +++ b/.github/workflows/validate-gradle-build.yml @@ -3,11 +3,11 @@ name: Validate Gradle Wrapper on: push: branches: - - master-1.21.1 + - master-1.21.1-neo - 'feature/**' pull_request: branches: - - master-1.21.1 + - master-1.21.1-neo permissions: contents: read diff --git a/.gitignore b/.gitignore index 1566f495..0d1b97df 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ /eclipse/ /run/ /run-data/ +/config/ /run.* /$run/ /eula.txt diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7a2db808..13e9c9dd 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,16 @@ +basePower 2.4.19.121012 (Minecraft 1.21.1 / NeoForge) + +- Port the shared APIs, menus, rendering, capabilities, networking and migration hooks to NeoForge 21.1.265 and Java 21. +- Build with native ModDevGradle 2.0.148 and the pinned Gradle 9.8.0 wrapper. +- Keep Eclipse refreshes from adding duplicate resource folders, and check repeated refreshes during validation. +- Keep copied-world test setup out of Eclipse sync; test worlds still require explicit selection before a test launch. +- Use MMDLib crushing recipes and common c tags without replacing machinery or changing balance; respect recipe deletion. +- Keep registry identities and saved payloads, including engine-owned ForgeData to NeoForgeData migration, locks and fluid components. +- Keep salvaged parts available in dungeon and mineshaft chests in Apocalyptic mode, using NeoForge's loot-modifier index. +- Keep oil buckets bound to source fluids and refresh machine capabilities after unloading and reloading chunks. +- Require the published Base Metals 4.0.1.121012+Neo, MMDLib 2.0.2.121012+Neo and OreSpawn 4.1.1.121012 releases. +- Pin the reviewed migration hook and public dependency hashes so local builds and CI use the same inputs. + basePower 2.4.14.121011 (Minecraft 1.21.1) - Bring basePower to Forge 52 and Java 21, keeping existing blocks, items and machine data. diff --git a/README.md b/README.md index 02392ed9..4ad9dc0d 100644 --- a/README.md +++ b/README.md @@ -1,134 +1,122 @@ # basePower -**Minecraft 1.21.1 (Forge), version 2.4.14.121011.** - -This version keeps the existing machines and saved-world data while updating -to Forge 52 and Java 21. See the [1.21.1 test results](docs/1.21.1/TEST-RESULTS.md) -for the checked upgrade routes, machine tests and remaining modpack limits. - -For the combined Eclipse test, use `runClientAllAdvantage.launch` in this -project. It loads the matching baseSteam and baseElectric candidates. The -[port record](docs/1.21.1/PORT-STATUS.md) separates the automated checks from -the remaining manual gameplay and visual checks. +**Minecraft 1.21.1 / NeoForge 21.1.265, version 2.4.19.121012.** basePower continues DrCyano's Power Advantage. It provides shared power, -fluids and item transport for baseSteam and baseElectric. - -## Playing On 1.21.1 - -- Install [MMD OreSpawn 4.1.0.121011](https://www.curseforge.com/minecraft/mc-mods/mmd-orespawn/files/9189594) on both client and server. -- Base Metals is optional for a new basePower world. For a world that already - uses Base Metals, keep it installed and use the matching Forge 1.21.1 build - `3.1.2.121011` or a later compatible Forge 52 release. Older Base Metals - builds do not have the shared upgrade hook. -- baseSteam and baseElectric are separate mods. Use only their matching - 1.21.1 builds. Additional Loot Tables is not needed for the built-in loot. - -**Back up the entire world before upgrading. Test only disposable copies.** -The port keeps existing registry names and machine data. The upgrade checks -use disposable copies of original Advantage and released base* saves, including -connected machines, and check them again after a full restart. Check that the -other mods in your world support 1.21.1 before you upgrade. -The accepted [1.14 results](docs/1.14/BROADER-QUALIFICATION.md) are historical -evidence, not qualification of this port or a whole modpack. - -Recipe-book discovery now follows relevant ingredients. See the [all-Advantage material checklist and automated discovery tests](docs/1.13/RECIPE-DISCOVERY.md). To regenerate the checked-in unlock JSON after changing recipes, run `node tools/generate-recipe-unlocks.js`; `check` rejects missing or stale ingredient criteria. - -The [manufacturing progression audit](docs/1.13/MANUFACTURING-PROGRESSION.md) traces survival parts from raw resources, including configured material aliases, processing, loot-only parts and automated restart checks. - -## Building Minecraft 1.21.1 - -The build uses Forge 52.1.0, official `1.21.1` mappings, -MCP `20240808.132146`, ForgeGradle 7.0.34 and Gradle 9.6.1. -Use Java 21 for Gradle, compilation and Minecraft. Mavenizer also -needs Java 25; the development launcher helper uses Java 8. Pass the installed homes using -`-Porg.gradle.java.installations.paths=,,` and disable -automatic discovery and downloads for a reproducibility check. - -Use the pinned Base Metals `3.1.2.121011` and OreSpawn `4.1.0.121011` jars. -The source pins and checksums are in `gradle.properties`. -Forge 52 also needs the Mavenizer compatibility jar in the pinned OreSpawn -checkout's `ci-fixtures/tools/` directory. It fixes decompiled Forge sources -on a clean build and uses Java 25. It is not part of the mod or game runtime. -Set `-Pforge52MavenizerJar=` when that checkout is in another location. -If Base Metals is installed, use the pinned 3.1.2 build when testing an upgrade. It lets -both mods preserve old items and machines before Minecraft converts the -chunk. An older Base Metals jar is not a substitute for this upgrade path. - -Then run from the repository root: - -```text -gradlew.bat clean check build javadoc genEclipseRuns eclipse isolateEclipseProductionRuns verifyReleaseDependencies verifyReleaseArtifacts writeReleaseChecksums verifyEclipseProductionClasspath -``` +fluid handling and item transport for baseSteam and baseElectric. The historical +`cyano.poweradvantage.api` package and existing registry identities remain in use. -The default dependency jars are: +This is the native NeoForge edition. Do not mix it with Forge builds of the same +mods. The existing machines, recipes, world identities and legacy API remain in +place. Keep backups when upgrading worlds; a successful build alone does not +prove that an entire modpack can be upgraded safely. -```text -D:\BaseMetals\.verification-basemetals1211\Advantage shared hook\build\libs\BaseMetals-3.1.2.121011.jar -D:\MinecraftMineralogy\OS1211\OreSpawn\build\libs\OreSpawn-4.1.0.121011.jar -``` +## Required Dependencies -Other layouts can pass `-PbaseMetalsDeobfJar=` and `-PoreSpawnDeobfJar=`. -Dependencies are never embedded in PowerAdvantage artifacts. +All three dependencies are required on both client and server: -Dependency checksums and source commits are recorded in `gradle.properties`. -Unknown artifacts fail the dependency audit. The release audit also rejects a -player jar that differs from the frozen test kit. Hosted CI requires the Base -Metals pin to be on its upstream `master-1.21.1` branch; a locally tested pin -does not qualify a hosted build. +| Dependency | Input For This Port | Status | +| --- | --- | --- | +| Base Metals | `zone.moddev.mc.basemetals:BaseMetals:4.0.1.121012+Neo` | Published release with the reviewed shared migration hook | +| MMDLib | `zone.moddev.mc.lib:mmdlib:2.0.2.121012+Neo` | Published input; SHA-256 recorded in `gradle.properties` | +| OreSpawn | `zone.moddev.mc.orespawn:OreSpawn:4.1.1.121012` | Published input; SHA-256 recorded in `gradle.properties` | -Release jars are written to `build/libs`. Forge 52 uses the same mod jar for play -and development; `deobfJar` is kept as a task alias for older build scripts. +Base Metals **4.0.0.121012+Neo is not a substitute**. It lacks the migration +extension used to preserve old Advantage machine and player data. -For Eclipse, import this repository as an existing Gradle project and run: +The coordinated expansion candidates are baseSteam and baseElectric +**2.2.20.121012**. They remain separate mod jars; dependencies are not embedded. +MMDLib supplies the shared crushing recipe contract, not replacement machinery. +Recipe removal remains authoritative and drill mining keeps normal block drops. -```text -gradlew.bat cleanEclipse verifyEclipseProductionClasspath -``` +For recipe discovery, collect vanilla copper ingots as well as Base Metals steel, +lead, brass and tin. The published Base Metals copper tags use vanilla copper; +an old Base Metals copper item alone may not trigger that ingredient's unlock. -Refresh the project in Eclipse, allow its Java build to finish, and launch the generated `runClient.launch`. Eclipse launches discover the mod from `bin/main`; command-line Gradle launches use `build/forge-run-mod-classes/main`. The Eclipse audit checks that discovery points at the same production output Eclipse compiles into, preventing a client that starts without PowerAdvantage. +## Local Build -Eclipse copies production resources from `build/resources/main`, not directly from `src/main/resources`. This prevents its builder from overwriting the expanded `mods.toml` with raw `${version}` placeholders. After updating this setup, use **Gradle > Refresh Gradle Project**, then **Project > Clean** before relaunching. After editing resources or version properties, run `processResources` or refresh the Gradle project before the Eclipse build. See the [metadata regression notes](docs/1.13/ECLIPSE-METADATA.md). +Use Java 21, ModDevGradle **2.0.148** and the SHA-pinned Gradle **9.8.0** wrapper. +Java 8, Java 25, ForgeGradle, NeoGradle and the old Mavenizer are not part of this +native build. Dependencies resolve from MMD Maven and are checked against their +published SHA-256 values. A verified local copy may be selected with +`-PbaseMetalsJar=`; it must have the same hash. -To prepare a combined client, build the baseSteam and baseElectric `2.2.15.121011` jars, -run `gradlew.bat prepareCombinedEclipseLaunch`, refresh Eclipse, then launch -`runClientAllAdvantage.launch`. Inputs must match -`test-rig/profiles/native1211/dev-core.json`; alternative layouts can pass -`-PsteamAdvantageDeobfJar=` and `-PelectricAdvantageDeobfJar=`. -The ordinary `runClient.launch` remains Power-only. Both use the `run` directory; -preparing a launch does not copy, open or qualify a save. - -`check` and the Eclipse audit verify that Java files are in the directories -matching their packages. They also read every development runtime jar entry -and check its size and CRC to catch damaged cached dependencies. - -Keep Eclipse's access-restriction checks enabled and use Java 21 for its project -JRE and Minecraft launches. Check visuals, menus and recipe discovery against the -same jars used for the automated machine tests. +```powershell +$env:JAVA_HOME='C:/Users/johnb/.jdks/temurin-21.0.7+6' +$env:GRADLE_USER_HOME='D:/PowerAdvantage/.gradle-power1211neo' +./gradlew.bat check build javadoc verifyReleaseDependencies verifyReleaseArtifacts ` + writeReleaseChecksums +``` -## Compatibility +Do not start a second Power Gradle process while that cache is in use. This +command is documentation, not evidence that the current candidate passed it. +The local artifact checks bind all three dependency hashes to `gradle.properties`. +Keep failed +receipts, disposable worlds and frozen inputs; avoid routine `clean` during a +qualification campaign. Outputs are under `build/libs`. + +## Eclipse And Client + +Import this existing checkout as a Gradle project with Java 21. Use the Gradle +Tasks view for native `runClient` and `runServer`; old Forge `.launch` files and +their launcher helper are not applicable. `runClientAllAdvantage` uses the two +separate expansion jars, selected by `-PsteamAdvantageDeobfJar=` and +`-PelectricAdvantageDeobfJar=`. Always select a fresh disposable run directory +with `-PpowerAdvantageRunDirectory=` when testing. + +Run `verifyEclipseProductionClasspath verifyEclipseEcj` to check the generated +project with Eclipse's own compiler, including separate production/test outputs +and deliberately broken isolation controls. The checks also reject duplicate +classpath entries and exercise three consecutive classpath merges, as happens +during repeated Buildship refreshes. Use a new `-PeclipseEcjRunId=` +for each run so earlier diagnostics are retained. The combined Gradle launch +stages the expansions as separate mods; tests are not part of the player jars. +The audits also run NeoForge's actual IDE synchronization tasks without opting +into a disposable test world. Copied-world integration tests run only through +their explicitly configured Gradle command, not during an Eclipse refresh. + +The [client-resource probe](test-rig/client-resources/README.md) retains independent +full-gauge sprite comparisons, caption pixels and negative controls. Its Java +compilation and static preservation checks are not rendered-client acceptance. +Native recipe-book fixtures require a server registry-handshake export; historical +Forge registry snapshots cannot stand in for it. + +## Hosted CI Bootstrap + +CI and CodeQL use native ModDevGradle with one Java 21 toolchain. They read +[the three-dependency lock](.github/native-dependencies.json), verify approved +source ancestry where recorded, download exact public jars, check SHA-256 and +NeoForge metadata, and require the BM migration-hook entry. The build consumes +those verified files instead of resolving replacement copies independently. + +The lock records the merged Base Metals source and the exact public Maven +artifacts. `HOSTED_INPUTS_READY` means those dependency inputs can be reproduced; +it is not gameplay or release approval. The offline guard tests are: + +```powershell +./.github/test-native-dependencies.ps1 +./.github/verify-native-dependencies.ps1 -ValidateOnly +``` -The implementation namespace is `zone.moddev.mc.basepower`. The historical -`cyano.poweradvantage.api` package remains available. The port keeps basePower's -registry names and saved machine data and maps the older Power Advantage names. -The test record distinguishes state preservation, real operation and changes -made by Minecraft itself. +Both commands must pass before hosted builds. Heavy +packaged gameplay and historic-world qualification stay local. Release-tag +validation additionally rejects `release_player_sha256=UNQUALIFIED`; publication +still requires explicit approval and the guarded default-branch release workflow. -The upgrade path prepares stored items before vanilla flattening and converts -entities individually, so a mod entity cannot prevent a nearby pet's UUID and -ownership from being migrated. Old vanilla registry names are remapped explicitly; -unknown mod mappings still require their own compatible mod rather than being -silently discarded. -Legacy Forge swimming speed, name-tag distance, gravity and player reach use -their native registry names without discarding saved values or modifiers. +## Saved Worlds -The port uses native dimension registry keys, block-entity factories and tickers, -capabilities and menus. Config-dependent material aliases are additive server -data-pack tags. The shared pre-flattening migration hook remains necessary; -its presence is not proof that an upgrade is safe. +Back up the entire save and work only on disposable copies. Keeping names, NBT, +inventory data and migration hooks is necessary, not proof that a route is safe. +The native port translates engine-owned `ForgeData` into `NeoForgeData` while +preserving its payload, including nested block-entity item data. Attribute remaps, +fluid components, locks and capability lifetimes require the same frozen candidate +as the packaged and restart tests. Unknown third-party registry mappings require +their owning compatible mod rather than silent deletion. -The [legacy migration guide](docs/1.13/MIGRATION.md) describes the earlier protocols. -The [Advantage Works 1.20.1 guide](test-rig/NATIVE1201.md) describes the prior -qualification and the checks carried into 1.21.1. +The older [migration guide](docs/1.13/MIGRATION.md) and +[Forge 1.21.1 results](docs/1.21.1/TEST-RESULTS.md) are historical context only. +They are not acceptance receipts for this checkout or an entire modpack. -The historical 1.10 handbook remains on the [1.10.2 branch](https://github.com/MinecraftModDevelopmentMods/PowerAdvantage/blob/master-1.10.2/docs/1.10/README.md). +See the [NeoForge test and manual-check notes](docs/1.21.1-neoforge/TEST-RESULTS.md) +for this candidate. Heavy tests run locally; no publication or manual acceptance +is implied by a successful build. diff --git a/build.gradle b/build.gradle index 5fecf6ca..176bc9c2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,1076 +1,298 @@ import groovy.json.JsonSlurper -import java.nio.charset.StandardCharsets import java.security.MessageDigest -import java.util.jar.Manifest import java.util.zip.ZipFile -import java.util.zip.CRC32 import org.apache.tools.ant.filters.FixCrLfFilter plugins { - id 'java' + id 'java-library' id 'eclipse' id 'idea' id 'maven-publish' - id 'net.minecraftforge.gradle' version '7.0.34' + id 'net.neoforged.moddev' version '2.0.148' } - -apply from: 'gradle/forge52-mavenizer.gradle' - -group = project.mod_group -version = project.mod_version +group = mod_group +version = mod_version base.archivesName = 'basePower' - -def versionParts = project.mod_version.toString().tokenize('.') -if (versionParts.size() != 4 || !versionParts.every { it ==~ /\d+/ }) { - throw new GradleException("mod_version must use Major.Minor.Bug.Target numeric form: ${project.mod_version}") -} -def minecraftVersionParts = project.minecraft_version.toString().tokenize('.') -if (minecraftVersionParts.size() < 2 || minecraftVersionParts.size() > 3 - || !minecraftVersionParts.every { it ==~ /\d+/ }) { - throw new GradleException("minecraft_version must use major.minor or major.minor.patch numeric form: " - + project.minecraft_version) -} -def minecraftPatch = minecraftVersionParts.size() == 3 ? minecraftVersionParts[2] : '0' -def expectedTargetVersion = "${minecraftVersionParts[0]}" \ - + "${minecraftVersionParts[1].padLeft(2, '0')}" \ - + "${minecraftPatch.padLeft(2, '0')}" \ - + project.loader_code -if (versionParts[3] != expectedTargetVersion) { - throw new GradleException("mod_version target ${versionParts[3]} does not match " - + "Minecraft ${project.minecraft_version} ${project.loader_name} target ${expectedTargetVersion}") -} - -ext.functional_version = versionParts[0..2].join('.') -ext.display_version = project.mod_version -ext.release_tag = project.mod_version - java { - toolchain { - languageVersion = JavaLanguageVersion.of(21) - vendor = JvmVendorSpec.ADOPTIUM - } + toolchain.languageVersion = JavaLanguageVersion.of(21) withSourcesJar() withJavadocJar() } - tasks.withType(JavaCompile).configureEach { - javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(21) - vendor = JvmVendorSpec.ADOPTIUM - } - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 options.encoding = 'UTF-8' + options.release = 21 options.compilerArgs.addAll(['-Xmaxerrs', '1000']) } - tasks.withType(Javadoc).configureEach { - failOnError = false + failOnError = true options.encoding = 'UTF-8' options.addStringOption('Xdoclint:none', '-quiet') options.addBooleanOption('notimestamp', true) } - tasks.withType(AbstractArchiveTask).configureEach { preserveFileTimestamps = false reproducibleFileOrder = true includeEmptyDirs = false } - -def archiveTextSuffixes = [ - '.cfg', '.css', '.html', '.info', '.java', '.js', '.json', '.lang', - '.mcmeta', '.md', '.properties', '.toml', '.txt', '.xml' +repositories { + mavenCentral() + maven { url = 'https://maven.moddev.zone/releases' } +} +configurations { + pinnedBaseMetals { canBeConsumed = false; transitive = false } + implementation.extendsFrom pinnedBaseMetals +} +def baseMetalsOverride = providers.gradleProperty('baseMetalsJar') +def baseMetalsJar = providers.provider { configurations.pinnedBaseMetals.singleFile } +def expansionJars = [ + basesteam: file(providers.gradleProperty('steamAdvantageDeobfJar') + .getOrElse('../SteamAdvantage/SteamAdvantage/build/libs/baseSteam-2.2.20.121012.jar')), + baseelectric: file(providers.gradleProperty('electricAdvantageDeobfJar') + .getOrElse('../ElectricAdvantage/ElectricAdvantage/build/libs/baseElectric-2.2.20.121012.jar')) ] -def archiveTextPatterns = archiveTextSuffixes.collect { "**/*${it}".toString() } -archiveTextPatterns.addAll(['**/element-list', '**/package-list']) -def normalizeArchiveLineEndings = { details -> - details.filter(FixCrLfFilter, - eol: FixCrLfFilter.CrLf.newInstance('lf'), - eof: FixCrLfFilter.AddAsisRemove.newInstance('asis')) -} - -minecraft { - mappings channel: project.mapping_channel, version: project.mapping_version - accessTransformer = 'META-INF/accesstransformer.cfg' - String configuredRunDirectory = providers.gradleProperty('powerAdvantageRunDirectory') - .getOrElse('run') - def forgeRunModClassesDirectory = layout.buildDirectory.dir('forge-run-mod-classes/main') - def forgeMainOutputPath = forgeRunModClassesDirectory.get().asFile.absolutePath - def mainModClasses = "${mod_id}%%${forgeMainOutputPath}${File.pathSeparator}${mod_id}%%${forgeMainOutputPath}" - def forge37RunTargets = [client: 'fmluserdevclient', server: 'fmluserdevserver', data: 'fmluserdevdata'] - runs { - configureEach { - jvmArgs '--add-opens', 'java.base/java.lang.invoke=ALL-UNNAMED' - workingDir.convention layout.projectDirectory.dir(configuredRunDirectory) - systemProperty 'forge.logging.markers', 'REGISTRIES' - systemProperty 'forge.logging.console.level', 'info' - mods { basepower { source sourceSets.main } } - environment 'target', forge37RunTargets[name] - environment 'MCP_MAPPINGS', "${mapping_channel}_${mapping_version}" - environment 'MCP_VERSION', mcp_version - environment 'FORGE_VERSION', forge_version - environment 'FORGE_GROUP', 'net.minecraftforge' - environment 'MC_VERSION', minecraft_version - environment 'MOD_CLASSES', mainModClasses - } - register('client') - register('server') { - args '--nogui' - } - register('data') { - workingDir.convention layout.projectDirectory.dir('run-data') - args '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/'), - '--existing', file('src/main/resources/') - } +dependencies { + if (baseMetalsOverride.isPresent()) { + pinnedBaseMetals files(baseMetalsOverride.get()) + } else { + pinnedBaseMetals 'zone.moddev.mc.basemetals:BaseMetals:' + basemetals_version } + implementation 'zone.moddev.mc.lib:mmdlib:' + mmdlib_version + implementation 'zone.moddev.mc.orespawn:OreSpawn:' + orespawn_version + testImplementation 'junit:junit:4.13.2' + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.11.4' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } - -sourceSets.main.resources { - srcDir 'src/generated/resources' - exclude '.cache/**' -} - -def forgeRunModClassesDirectory = layout.buildDirectory.dir('forge-run-mod-classes/main') -def prepareForgeRunModClasses = tasks.register('prepareForgeRunModClasses', Sync) { - group = 'ide' - description = 'Merges classes and processed resources for Forge 1.21.1 launches.' - dependsOn tasks.named('classes') - from sourceSets.main.output - into forgeRunModClassesDirectory -} -tasks.withType(JavaExec).configureEach { - if (name in ['runClient', 'runServer', 'runData']) { - dependsOn prepareForgeRunModClasses - } +sourceSets { + main.resources { srcDir 'src/generated/resources'; exclude '.cache/**' } + test.java.srcDir 'test-rig/unit-support' } - -repositories { - minecraft.mavenizer(it) - maven fg.forgeMaven - maven fg.minecraftLibsMaven - - exclusiveContent { - forRepository { - maven { - name = 'Sponge' - url = 'https://repo.spongepowered.org/repository/maven-public' - } +neoForge { + version = neo_version + accessTransformers.from(file('src/main/resources/META-INF/accesstransformer.cfg')) + runs { + client { + client() + gameDirectory = file(providers.gradleProperty('powerAdvantageRunDirectory').getOrElse('run')) + } + server { + server() + programArgument '--nogui' + gameDirectory = file(providers.gradleProperty('powerAdvantageRunDirectory').getOrElse('run-server')) + } + clientAllAdvantage { + client() + gameDirectory = file(providers.gradleProperty('powerAdvantageRunDirectory').getOrElse('run-all-advantage')) + } + clientResourceCheck { + client() + gameDirectory = file(providers.gradleProperty('clientResourceRunDirectory').getOrElse('build/client-resources/native')) + jvmArguments.addAll '-Dadvantageworks.clientResources=true', '-Dadvantageworks.requireExtensions=true', + '-Dadvantageworks.machineGuiLayouts=true', '-Dadvantageworks.childRendererGeometry=true', + '-XX:ActiveProcessorCount=4' + } + data { + data() + gameDirectory = file('run-data') + programArguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources').absolutePath, + '--existing', file('src/main/resources').absolutePath } - filter { includeGroupAndSubgroups('org.spongepowered') } } - mavenCentral() - maven { - name = 'MinecraftLibraries' - url = 'https://libraries.minecraft.net/' + mods { basepower { sourceSet sourceSets.main } } + unitTest { + enable() + testedMod = mods.basepower } } - -// The default paths mirror the local MMD checkout layout without tying the -// build to a drive letter. CI and other layouts can override either path. -def baseMetalsDeobfJar = file(providers.gradleProperty('baseMetalsJar') - .orElse(providers.gradleProperty('baseMetalsDeobfJar')) - .getOrElse('../../../BaseMetals/.verification-basemetals1211/Advantage shared hook/build/libs/' - + "BaseMetals-${project.basemetals_version}.jar")) -def oreSpawnDeobfJar = file(providers.gradleProperty('oreSpawnJar') - .orElse(providers.gradleProperty('oreSpawnDeobfJar')) - .getOrElse('../../../MinecraftMineralogy/OS1211/OreSpawn/build/libs/' - + "OreSpawn-${project.orespawn_version}.jar")) - -dependencies { - implementation minecraft.dependency( - "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}") - - compileOnly files(baseMetalsDeobfJar, oreSpawnDeobfJar) - runtimeOnly files(baseMetalsDeobfJar, oreSpawnDeobfJar) - testImplementation 'junit:junit:4.13.2' +neoForge.addModdingDependenciesTo(sourceSets.test) +tasks.named('test', Test) { + useJUnitPlatform() + maxHeapSize = '2G' + maxParallelForks = 1 + workingDir projectDir + doFirst { workingDir projectDir } + systemProperty 'advantage.test.projectDir', projectDir.absolutePath + jvmArgs '-XX:ActiveProcessorCount=4' + testLogging { events 'failed', 'skipped'; exceptionFormat = 'full' } } - -sourceSets.test.java.srcDir 'test-rig/unit-support' - -def compileUnitBootstrap = tasks.register('compileUnitBootstrap', JavaCompile) { - source fileTree('test-rig/unit-bootstrap') - classpath = files() - destinationDirectory = layout.buildDirectory.dir('unit-bootstrap/classes') -} -def unitBootstrapJar = tasks.register('unitBootstrapJar', Jar) { - dependsOn compileUnitBootstrap - archiveFileName = 'forge-native-unit-bootstrap.jar' - destinationDirectory = layout.buildDirectory.dir('unit-bootstrap') - from compileUnitBootstrap.flatMap { it.destinationDirectory } - manifest.attributes('Premain-Class': 'zone.moddev.mc.advantageworks.unit.ForgeCapabilityBootstrap') -} -tasks.withType(Test).configureEach { - dependsOn unitBootstrapJar - doFirst { jvmArgs "-javaagent:${unitBootstrapJar.get().archiveFile.get().asFile}" } -} - tasks.named('processResources', ProcessResources) { - filteringCharset = 'UTF-8' - inputs.properties([ - version: project.version, - minecraft_version_range: project.minecraft_version_range, - forge_version_range: project.forge_version_range, - loader_version_range: project.loader_version_range - ]) - filesMatching('META-INF/mods.toml') { - expand version: project.version, - minecraft_version_range: project.minecraft_version_range, - forge_version_range: project.forge_version_range, - loader_version_range: project.loader_version_range + inputs.properties(version: project.version, neo_version: project.neo_version) + filesMatching('META-INF/neoforge.mods.toml') { + expand version: project.version, neo_version: project.neo_version } - filesMatching(archiveTextPatterns, normalizeArchiveLineEndings) -} - -def prepareEclipseResources = tasks.register('prepareEclipseResources') { - group = 'ide' - description = 'Copies Gradle-processed resources into Eclipse production output.' - dependsOn tasks.named('processResources') - doLast { - project.copy { - from(layout.buildDirectory.dir('resources/main')) - into(layout.projectDirectory.dir('bin/main')) - } + filesMatching(['**/*.json','**/*.toml','**/*.cfg','**/*.js','**/*.properties']) { + filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('lf')) } } - tasks.named('jar', Jar) { - archiveClassifier = null - destinationDirectory = layout.buildDirectory.dir('libs') - exclude 'fernflower_abstract_parameter_names.txt' - manifest { - attributes([ - 'Maven-Artifact' : "${project.group}:${base.archivesName.get()}:${project.version}", - 'Specification-Title' : project.mod_id, - 'Specification-Vendor' : project.mod_authors, - 'Specification-Version' : '1', - 'Implementation-Title' : base.archivesName.get(), - 'Implementation-Version': project.version, - 'Implementation-Vendor' : project.mod_authors, - 'Built-On-Java' : project.java_version, - 'Built-On' : "${project.minecraft_version}-${project.forge_version}" - ]) - } -} - -// Forge 52 uses the official names at runtime, so the same jar serves both uses. -def releaseJar = tasks.named('jar', Jar) - -tasks.register('deobfJar') { - group = 'build' - description = 'Builds the Forge-native jar under build/libs for development.' - dependsOn tasks.named('jar') + manifest.attributes( + 'Implementation-Title': 'basePower', + 'Implementation-Version': project.version, + 'Built-On-Java': '21', + 'Built-On': minecraft_version + '-NeoForge-' + neo_version) } tasks.named('sourcesJar', Jar) { - filteringCharset = 'UTF-8' - includeEmptyDirs = false - archiveClassifier = 'sources' - filesMatching(archiveTextPatterns, normalizeArchiveLineEndings) - manifest { - attributes([ - 'Maven-Artifact' : "${project.group}:${base.archivesName.get()}:${project.version}:sources", - 'Implementation-Title' : "${base.archivesName.get()}-sources", - 'Implementation-Version': project.version - ]) - } -} - -tasks.named('javadocJar', Jar) { - filteringCharset = 'UTF-8' - archiveClassifier = 'javadoc' - filesMatching(archiveTextPatterns, normalizeArchiveLineEndings) - manifest { - attributes([ - 'Maven-Artifact' : "${project.group}:${base.archivesName.get()}:${project.version}:javadoc", - 'Implementation-Title' : "${base.archivesName.get()}-javadoc", - 'Implementation-Version': project.version - ]) + filesMatching(['**/*.java', '**/*.json', '**/*.toml', '**/*.cfg', '**/*.properties', '**/*.mcmeta', '**/*.js']) { + filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('lf')) } } - -tasks.named('assemble') { - dependsOn releaseJar - dependsOn tasks.named('sourcesJar') - dependsOn tasks.named('javadocJar') -} - -def expectedReleaseFiles = providers.provider { - def prefix = "${base.archivesName.get()}-${project.version}" - ["${prefix}.jar", "${prefix}-sources.jar", "${prefix}-javadoc.jar"] -} -def preparedReleaseDir = providers.gradleProperty('preparedReleaseDir') - -tasks.register('verifyReleaseConfiguration') { - group = 'verification' - description = 'Validates release identity, target metadata, and optional integration policy.' - doLast { - def pack = new JsonSlurper().parse(file('src/main/resources/pack.mcmeta')).pack - if (pack.pack_format != 34 || pack.supported_formats != [min_inclusive: 34, max_inclusive: 48]) { - throw new GradleException('Minecraft 1.21.1 requires resource format 34 and data format 48') - } - if (project.mod_version != '2.4.14.121011') { - throw new GradleException("Unexpected PowerAdvantage release version: ${project.mod_version}") - } - if (project.minecraft_version != '1.21.1' - || project.forge_version != '52.1.0' - || project.mapping_channel != 'official' - || project.mapping_version != '1.21.1' - || project.mcp_version != '20240808.132146') { - throw new GradleException('Unexpected Minecraft, Forge, or mappings target') - } - if (project.loader_name != 'forge' || project.loader_code != '1' - || project.java_version != '21' - || project.java_toolchain_version != '21.0.7+6' - || project.gradle_java_version != '21') { - throw new GradleException('Unexpected release dispatcher target metadata') - } - if (project.mod_id != 'basepower' - || project.group.toString() != 'zone.moddev.mc.basepower' - || base.archivesName.get() != 'basePower' - || project.curseforge_project_id != '1780140') { - throw new GradleException('Unexpected Forge, Maven, archive, or CurseForge identity') - } - if (project.cf_requirements != 'base-metals,mmd-orespawn' - || project.cf_optionals != 'additional-loot-tables' - || project.cf_versions != '1.21.1') { - throw new GradleException('Unexpected CurseForge dependency or game-version metadata') - } - if (project.basemetals_version != '3.1.2.121011' - || project.orespawn_version != '4.1.0.121011' - || !(project.basemetals_source_commit ==~ /[a-f0-9]{40}/) - || project.orespawn_source_commit != '62c08169c71f4d4fd8f107289e63fd2a4c7c655c') { - throw new GradleException('Unexpected Base Metals or OreSpawn dependency identity') - } - String mainSource = file( - 'src/main/java/zone/moddev/mc/basepower/PowerAdvantage.java').getText('UTF-8') - if (!mainSource.contains('MODID = "basepower"') - || !mainSource.contains('VERSION = "2.4.14.121011"') - || !mainSource.contains('@Mod(PowerAdvantage.MODID)')) { - throw new GradleException('PowerAdvantage source identity changed') - } - if (!file('src/main/java/cyano/poweradvantage/api/PoweredEntity.java').isFile()) { - throw new GradleException('Legacy cyano.poweradvantage.api compatibility surface is missing') - } - String entitySource = file( - 'src/main/java/zone/moddev/mc/basepower/init/Entities.java').getText('UTF-8') - [ - 'tileentity.pipe_terminal', 'tileentity.fluid_drain', - 'tileentity.fluid_discharge', 'tileentity.fluid_storage_tank', - 'tileentity.fluid_metal_tank', 'tileentity.still', 'item_conveyor', - 'item_filter_block', 'item_filter_food', 'item_filter_fuel', - 'item_filter_inventory', 'item_filter_ore', 'item_filter_plant', - 'item_filter_smelt', 'item_filter_overflow', 'infinite_energy_source' - ].each { id -> - if (!entitySource.contains('"' + id + '"')) { - throw new GradleException("Persistent tile entity id changed or disappeared: ${id}") - } - } - String modsToml = file('src/main/resources/META-INF/mods.toml').getText('UTF-8').replace('\r\n', '\n') - ['modId="basepower"', 'modId="basemetals"', 'modId="orespawn"', - 'mandatory=true'].each { required -> - if (!modsToml.contains(required)) { - throw new GradleException("Source mods.toml is missing ${required}") - } - } - if (!modsToml.contains('modId="basemetals"\nmandatory=false')) { - throw new GradleException('Base Metals must remain Forge-optional; CurseForge installs it for players') - } - String steelBarsTag = file( - 'src/main/resources/data/forge/tags/item/bars/steel.json').getText('UTF-8') - if (!steelBarsTag.contains('"required": false') || !steelBarsTag.contains('"basemetals:steel_bars"')) { - throw new GradleException('Steel bars must use Forge optional tag entries when Base Metals is absent') - } - [ - 'dusts/coal', 'dusts/lead', 'dusts/redstone', 'dusts/silver', 'dusts/tin', - 'gems/diamond', 'gems/emerald', - 'ingots/brass', 'ingots/copper', 'ingots/gold', 'ingots/iron', - 'ingots/lead', 'ingots/nickel', 'ingots/steel', 'ingots/zinc', - 'nuggets/bronze', 'nuggets/copper', 'nuggets/gold', 'nuggets/iron', - 'nuggets/lead', 'nuggets/tin', - 'plates/copper', 'plates/iron', 'plates/steel', - 'rods/copper', 'rods/wooden', 'stone', - 'storage_blocks/diamond', 'storage_blocks/steel' - ].each { tagPath -> - if (!file("src/main/resources/data/forge/tags/item/${tagPath}.json").isFile()) { - throw new GradleException("Missing decoupled Forge item tag declaration: ${tagPath}") - } - } - Map provider = new JsonSlurper().parse(file( - 'src/main/resources/data/basepower/orespawn/provider.json')) as Map - Map desertOil = provider.fluid_deposits[ - 'basepower:fluid_deposit/desert_crude_oil'].dimensions['minecraft:overworld'] as Map - if (desertOil.biome_dictionary != ['SANDY'] - || (desertOil.excluded_biome_dictionary as Set) != (['BEACH', 'MESA'] as Set)) { - throw new GradleException( - 'Desert crude oil must use Forge SANDY biomes while excluding BEACH and MESA') - } - if ((desertOil.host_families as Set) != ([ - 'sedimentary', 'metamorphic', 'igneous_intrusive', 'igneous_volcanic'] as Set)) { - throw new GradleException( - 'Desert crude oil must remain compatible with OreSpawn geology-family hosts') - } - } -} - +tasks.register('deobfJar') { dependsOn tasks.named('jar') } +def sha256 = { File f -> MessageDigest.getInstance('SHA-256').digest(f.bytes).encodeHex().toString().toUpperCase(Locale.ROOT) } tasks.register('verifyReleaseDependencies') { - group = 'verification' - description = 'Resolves and audits Forge plus the exact optional compile APIs.' - dependsOn tasks.named('verifyReleaseConfiguration') doLast { - [(baseMetalsDeobfJar): project.basemetals_deobf_sha256, - (oreSpawnDeobfJar): project.orespawn_deobf_sha256].each { File dependencyJar, String expectedHash -> - if (!dependencyJar.isFile()) { - throw new GradleException("Missing pinned dependency jar: ${dependencyJar}") - } - String actualHash = MessageDigest.getInstance('SHA-256') - .digest(dependencyJar.bytes).encodeHex().toString().toUpperCase() - Set acceptedHashes = [expectedHash] as Set - if (!acceptedHashes.contains(actualHash)) { - throw new GradleException("${dependencyJar.name} SHA-256 is ${actualHash}, expected ${acceptedHashes}") - } - } - Set compileFiles = configurations.compileClasspath.files.collect { it.canonicalFile } as Set - if (!compileFiles.contains(baseMetalsDeobfJar.canonicalFile) - || !compileFiles.contains(oreSpawnDeobfJar.canonicalFile)) { - throw new GradleException('Pinned Base Metals or OreSpawn API is missing from compileClasspath') - } - Set runtimeFiles = configurations.runtimeClasspath.files.collect { it.canonicalFile } as Set - if (!runtimeFiles.contains(baseMetalsDeobfJar.canonicalFile) - || !runtimeFiles.contains(oreSpawnDeobfJar.canonicalFile)) { - throw new GradleException('Pinned Base Metals or OreSpawn is missing from development runtime') - } - List obsoleteRuntimeMods = runtimeFiles.collect { it.name.toLowerCase(Locale.ROOT) } - .findAll { name -> - name.contains('rf-api') || name.contains('redstoneflux') - || name.contains('tesla') || name.contains('reborncore') - } - if (!obsoleteRuntimeMods.isEmpty()) { - throw new GradleException("Obsolete energy APIs leaked onto runtimeClasspath: ${obsoleteRuntimeMods}") - } + if (!baseMetalsJar.get().isFile()) throw new GradleException('Missing pinned Base Metals jar: ' + baseMetalsJar.get()) + if (!project.basemetals_deobf_sha256.matches('[A-Fa-f0-9]{64}') + || sha256(baseMetalsJar.get()) != project.basemetals_deobf_sha256.toUpperCase(Locale.ROOT)) + throw new GradleException('Base Metals must match its recorded public SHA-256') + def archives = configurations.runtimeClasspath.files.findAll { it.name.endsWith('.jar') } + [mmdlib: project.mmdlib_sha256, OreSpawn: project.orespawn_deobf_sha256].each { name, hash -> + def matches = archives.findAll { it.name.startsWith(name + '-') } + if (matches.size() != 1 || sha256(matches[0]) != hash.toUpperCase(Locale.ROOT)) + throw new GradleException('Missing or changed pinned runtime: ' + name) + } + if (archives.any { it.name.toLowerCase(Locale.ROOT).matches('.*(reborncore|rf-api|tesla|forge-1\\.21).*') }) + throw new GradleException('Obsolete Forge dependencies leaked into NeoForge runtime') } } - -// IDE synchronization and plain compileJava must audit the same pins as a release build. -tasks.named('compileJava') { - dependsOn tasks.named('verifyReleaseDependencies') -} - -tasks.register('verifyDevelopmentRuntimeArchives') { - group = 'verification' - description = 'Reads every development runtime jar entry and verifies its CRC before launching Minecraft.' - dependsOn tasks.named('verifyReleaseDependencies') +tasks.register('verifyReleaseConfiguration') { doLast { - configurations.runtimeClasspath.files.findAll { it.name.endsWith('.jar') }.each { File archive -> - new ZipFile(archive).withCloseable { zip -> - zip.entries().each { entry -> - if (entry.directory) return - CRC32 crc = new CRC32() - long size = 0 - try { - zip.getInputStream(entry).withCloseable { input -> - byte[] buffer = new byte[8192] - int count - while ((count = input.read(buffer)) != -1) { - crc.update(buffer, 0, count) - size += count - } - } - } catch (IOException failure) { - throw new GradleException("Unreadable development runtime entry: ${archive}!/${entry.name}", failure) - } - if (size != entry.size || crc.value != entry.crc) { - throw new GradleException("Corrupt development runtime entry: ${archive}!/${entry.name}") - } - } - } + if (project.minecraft_version != '1.21.1' || project.loader_name != 'neoforge' + || project.loader_code != '2' || !project.mod_version.endsWith('.121012')) + throw new GradleException('Incorrect NeoForge 1.21.1 release identity') + def pack = new JsonSlurper().parse(file('src/main/resources/pack.mcmeta')).pack + if (pack.pack_format != 34) throw new GradleException('Incorrect 1.21.1 pack format') + def forbidden = fileTree('src/main/java').matching { include '**/*.java' }.files.findAll { + it.text.contains('net.minecraftforge.') } + if (forbidden) throw new GradleException('Forge imports remain: ' + forbidden) } } - tasks.register('verifyReleaseArtifacts') { - group = 'verification' - description = 'Audits the exact three distributable jars and release-critical contents.' - dependsOn tasks.named('verifyReleaseDependencies') - dependsOn tasks.named('assemble') + dependsOn tasks.named('assemble'), tasks.named('verifyReleaseDependencies'), tasks.named('verifyReleaseConfiguration') doLast { - File libs = layout.buildDirectory.dir('libs').get().asFile - List jars = (libs.listFiles() ?: [] as File[]) - .findAll { it.name.endsWith('.jar') }.sort { it.name } - List expected = expectedReleaseFiles.get().sort() - if (jars.collect { it.name } != expected) { - throw new GradleException("Expected exactly ${expected}, found ${jars.collect { it.name }}") - } - // Empty source directories survive branch changes but are absent in fresh clones. - (jars + [tasks.named('jar', Jar).get().archiveFile.get().asFile]).each { candidate -> - new ZipFile(candidate).withCloseable { zip -> - List entries = zip.entries().toList() - entries.findAll { it.isDirectory() }.each { directory -> - if (!entries.any { !it.isDirectory() && it.name.startsWith(directory.name) }) { - throw new GradleException("${candidate.name} contains empty directory ${directory.name}") - } - } - } - } - jars.each { candidate -> - if (candidate.length() == 0L) { - throw new GradleException("Empty release artifact: ${candidate.name}") - } - new ZipFile(candidate).withCloseable { candidateZip -> - candidateZip.entries().findAll { entry -> - !entry.isDirectory() - && (archiveTextSuffixes.any { entry.name.endsWith(it) } - || entry.name.endsWith('/element-list') - || entry.name.endsWith('/package-list')) - }.each { entry -> - boolean containsCarriageReturn = candidateZip.getInputStream(entry).withCloseable { input -> - input.bytes.any { value -> value == 13 } - } - if (containsCarriageReturn) { - throw new GradleException( - "${candidate.name}!/${entry.name} does not use canonical LF line endings") - } - } - } - } - - File mainJar = new File(libs, expectedReleaseFiles.get()[0]) - String mainHash = MessageDigest.getInstance('SHA-256').digest(mainJar.bytes).encodeHex().toString() - if (!mainHash.equalsIgnoreCase(project.release_player_sha256 as String)) { - throw new GradleException("${mainJar.name} SHA-256 is ${mainHash}, " - + "expected frozen player jar ${project.release_player_sha256}") - } - new ZipFile(mainJar).withCloseable { zip -> - List names = zip.entries().collect { it.name } - ['META-INF/mods.toml', 'META-INF/accesstransformer.cfg', 'pack.mcmeta', - 'coremods/poweradvantage_118_migration.js', - 'zone/moddev/mc/basepower/PowerAdvantage.class', - 'cyano/poweradvantage/api/PoweredEntity.class', - 'cyano/poweradvantage/api/fluid/FluidNetworkApi.class', - 'assets/basepower/lang/en_us.json', - 'data/basepower/recipe/fluid_drain.json', - 'data/basepower/advancement/recipes/sprocket_rod_normal.json'].each { required -> - if (!names.contains(required)) { - throw new GradleException("Release jar is missing ${required}") - } - } - ['agent-notes/', '.codex/', 'src/test/', 'fernflower_abstract_parameter_names.txt', - 'cofh/api/', 'reborncore/api/', 'cyano/basemetals/', 'com/mcmoddev/lib/', - 'zone/moddev/mc/basemetals/', 'zone/moddev/mc/orespawn/', - 'zone/moddev/mc/advantageworks/', 'com/mojang/serialization/', - 'net/minecraft/', 'net/minecraftforge/'].each { forbidden -> - if (names.any { it.contains(forbidden) }) { - throw new GradleException("Release jar contains forbidden entry matching ${forbidden}") - } - } - List accessRules = zip.getInputStream(zip.getEntry('META-INF/accesstransformer.cfg')) - .getText('UTF-8').readLines().collect { it.trim() } - .findAll { it && !it.startsWith('#') } - if (accessRules != ['public-f net.minecraft.util.datafix.fixes.BlockStateData MAP']) { - throw new GradleException('Packaged pre-flattening table access rule is incorrect') - } - String modsToml = zip.getInputStream(zip.getEntry('META-INF/mods.toml')) - .getText(StandardCharsets.UTF_8.name()) - if (!modsToml.contains('modId="basepower"') - || !modsToml.contains("version=\"${project.mod_version}\"") - || !modsToml.contains('modId="basemetals"') - || !modsToml.contains('modId="orespawn"')) { - throw new GradleException('Packaged mods.toml identity, version, or dependencies are incorrect') - } - def manifest = new Manifest(zip.getInputStream(zip.getEntry('META-INF/MANIFEST.MF'))).mainAttributes - if (manifest.getValue('Implementation-Version') != project.mod_version - || manifest.getValue('Built-On-Java') != project.java_version - || manifest.getValue('Implementation-Timestamp') != null - || manifest.getValue('Timestamp') != null) { - throw new GradleException('Release manifest identity is incorrect or volatile') - } + def expected = ['', '-sources', '-javadoc'].collect { 'basePower-' + version + it + '.jar' }.sort() + def actual = fileTree('build/libs').matching { include '*.jar' }.files.collect { it.name }.sort() + if (actual != expected) throw new GradleException('Unexpected release archives: ' + actual) + new ZipFile(file('build/libs/basePower-' + version + '.jar')).withCloseable { zip -> + def names = zip.entries().collect { it.name } + if (!names.contains('META-INF/neoforge.mods.toml') + || !names.contains('cyano/poweradvantage/api/fluid/FluidNetworkApi.class')) + throw new GradleException('Release metadata or legacy public API missing') + def rejected = names.findAll { + it.startsWith('net/') || it.startsWith('zone/moddev/mc/lib/') + || it.startsWith('zone/moddev/mc/basemetals/') || it.startsWith('zone/moddev/mc/orespawn/') + || it.contains('advantageworks') || it.contains('agent-notes') || it.endsWith('AGENTS.md') + || it.startsWith('build/') || it.endsWith('.launch') || it.contains('/.cache/') + || it.startsWith('data/forge/loot_modifiers/') + } + if (rejected) throw new GradleException('Forbidden archive contents: ' + rejected) zip.entries().findAll { it.name.endsWith('.class') }.each { entry -> - byte[] header = new byte[8] - zip.getInputStream(entry).withCloseable { input -> - if (input.read(header) != header.length) { - throw new GradleException("Cannot inspect bytecode header for ${entry.name}") - } - } - int major = ((header[6] & 0xff) << 8) | (header[7] & 0xff) - if (major != 65) { - throw new GradleException("${entry.name} uses Java class major ${major}, expected 65") - } - } - } - - new ZipFile(new File(libs, expectedReleaseFiles.get()[1])).withCloseable { sourceZip -> - if (sourceZip.getEntry('zone/moddev/mc/basepower/PowerAdvantage.java') == null - || sourceZip.getEntry('cyano/poweradvantage/api/PoweredEntity.java') == null) { - throw new GradleException('Sources jar is missing implementation or legacy API sources') - } - } - new ZipFile(new File(libs, expectedReleaseFiles.get()[2])).withCloseable { javadocZip -> - if (javadocZip.getEntry('index.html') == null) { - throw new GradleException('Javadoc jar is missing index.html') + byte[] bytes = zip.getInputStream(entry).readNBytes(8) + if (bytes.length != 8 || ((bytes[6] & 255) << 8 | (bytes[7] & 255)) != 65) + throw new GradleException('Non-Java21 class: ' + entry.name) } } } } - tasks.register('writeReleaseChecksums') { - group = 'verification' - description = 'Writes SHA-256 checksums for the audited release jars.' dependsOn tasks.named('verifyReleaseArtifacts') - def outputFile = layout.buildDirectory.file('release/SHA256SUMS') - inputs.files(provider { expectedReleaseFiles.get().collect { layout.buildDirectory.file("libs/${it}").get().asFile } }) - outputs.file(outputFile) - doLast { - File output = outputFile.get().asFile - output.parentFile.mkdirs() - File libs = layout.buildDirectory.dir('libs').get().asFile - String contents = expectedReleaseFiles.get().sort().collect { name -> - MessageDigest digest = MessageDigest.getInstance('SHA-256') - new File(libs, name).withInputStream { input -> - byte[] buffer = new byte[8192] - for (int read = input.read(buffer); read >= 0; read = input.read(buffer)) { - if (read > 0) digest.update(buffer, 0, read) - } - } - "${digest.digest().encodeHex().toString().toUpperCase()} ${name}" - }.join('\n') + '\n' - output.setText(contents, 'UTF-8') - } -} - -tasks.register('verifyPreparedReleaseArtifacts') { - group = 'verification' - description = 'Audits an immutable release bundle before Maven publication.' doLast { - if (!preparedReleaseDir.isPresent()) { - throw new GradleException('preparedReleaseDir is required for prepared artifact publication') - } - File prepared = file(preparedReleaseDir.get()) - List expected = expectedReleaseFiles.get().sort() - List jars = (prepared.listFiles() ?: [] as File[]) - .findAll { it.name.endsWith('.jar') }.sort { it.name } - if (!prepared.isDirectory() || jars.collect { it.name } != expected - || jars.any { it.length() == 0L }) { - throw new GradleException("Prepared release must contain exactly the non-empty jars ${expected}") - } - File checksums = new File(prepared, 'SHA256SUMS') - File changelog = new File(prepared, 'CHANGELOG.txt') - if (!checksums.isFile() || !changelog.isFile()) { - throw new GradleException('Prepared release is missing SHA256SUMS or CHANGELOG.txt') - } - List actualChecksums = jars.collect { candidate -> - MessageDigest digest = MessageDigest.getInstance('SHA-256') - candidate.withInputStream { input -> - byte[] buffer = new byte[8192] - for (int read = input.read(buffer); read >= 0; read = input.read(buffer)) { - if (read > 0) digest.update(buffer, 0, read) - } - } - "${digest.digest().encodeHex().toString().toUpperCase()} ${candidate.name}" - }.sort() - List declaredChecksums = checksums.readLines('UTF-8') - .findAll { !it.trim().isEmpty() }.sort() - if (actualChecksums != declaredChecksums) { - throw new GradleException('Prepared release checksums do not match the immutable jars') - } - } -} - -def mavenUploadUrl = providers.environmentVariable('MAVEN_UPLOAD_URL') - .orElse('https://invalid.invalid/missing-maven-upload-url') -def mavenUploadUsername = providers.environmentVariable('MAVEN_UPLOAD_USERNAME') -def mavenUploadPassword = providers.environmentVariable('MAVEN_UPLOAD_PASSWORD') - -publishing { - publications { - mavenJava(MavenPublication) { - groupId = project.group.toString() - artifactId = base.archivesName.get() - version = project.version.toString() - if (preparedReleaseDir.isPresent()) { - File prepared = file(preparedReleaseDir.get()) - artifact(new File(prepared, expectedReleaseFiles.get()[0])) - artifact(new File(prepared, expectedReleaseFiles.get()[1])) { classifier = 'sources' } - artifact(new File(prepared, expectedReleaseFiles.get()[2])) { classifier = 'javadoc' } - } else { - artifact(releaseJar) - artifact(tasks.named('sourcesJar')) - artifact(tasks.named('javadocJar')) - } - pom { - name = 'basePower' - description = project.mod_description - url = 'https://github.com/MinecraftModDevelopmentMods/basePower' - licenses { - license { - name = 'GNU Lesser General Public License, Version 3' - url = 'https://www.gnu.org/licenses/lgpl-3.0.txt' - } - } - scm { - connection = 'scm:git:https://github.com/MinecraftModDevelopmentMods/basePower.git' - developerConnection = 'scm:git:ssh://git@github.com/MinecraftModDevelopmentMods/basePower.git' - url = 'https://github.com/MinecraftModDevelopmentMods/basePower' - } - } - } - } - repositories { - maven { - name = 'release' - url = uri(mavenUploadUrl.get()) - credentials { - username = mavenUploadUsername.orNull ?: '' - password = mavenUploadPassword.orNull ?: '' - } - } + def jars = fileTree('build/libs').matching { include '*.jar' }.files.sort { it.name } + String sums = jars.collect { sha256(it) + ' ' + it.name + '\n' }.join('') + file('build/libs/SHA256SUMS').text = sums + file('build/release').mkdirs() + file('build/release/SHA256SUMS').text = sums } } - -tasks.register('validateMavenReleaseCredentials') { - group = 'publishing' - description = 'Prevents Maven publication from using a local or incomplete destination.' +tasks.register('verifyJavaPackageLayout') { doLast { - if (!providers.environmentVariable('MAVEN_UPLOAD_URL').isPresent() - || !mavenUploadUsername.isPresent() || !mavenUploadPassword.isPresent()) { - throw new GradleException( - 'MAVEN_UPLOAD_URL, MAVEN_UPLOAD_USERNAME, and MAVEN_UPLOAD_PASSWORD are required') - } - if (providers.environmentVariable('MAVEN_UPLOAD_URL').get().startsWith('file:')) { - throw new GradleException('Maven release publication must use a remote repository') + fileTree('src').matching { include '**/java/**/*.java' }.files.each { f -> + def match = f.text =~ /(?m)^package\s+([\w.]+);/ + if (!match.find() || !f.path.replace('\\','/').endsWith('/' + match.group(1).replace('.','/') + '/' + f.name)) + throw new GradleException('Source package/path mismatch: ' + f) } } } - -tasks.withType(PublishToMavenRepository).configureEach { - dependsOn tasks.named('validateMavenReleaseCredentials') - dependsOn preparedReleaseDir.isPresent() - ? tasks.named('verifyPreparedReleaseArtifacts') - : tasks.named('verifyReleaseArtifacts') -} - -idea { - module { - downloadSources = true - downloadJavadoc = true - } -} - -def obsoleteForgeGradle2EclipseLaunches = [ - 'PowerAdvantage_Client.launch': 'GradleStart', - 'PowerAdvantage_Server.launch': 'GradleStartServer' -] - eclipse { project { + name = 'PowerAdvantage' buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder' natures 'org.eclipse.buildship.core.gradleprojectnature' } classpath { - downloadSources = true - downloadJavadoc = true - file.whenMerged { model -> - // Eclipse must not overwrite expanded metadata with src/main/resources templates. - def rawResources = sourceSets.main.resources.srcDirs.collect { relativePath(it).replace('\\', '/') } - model.entries.removeAll { entry -> - entry instanceof org.gradle.plugins.ide.eclipse.model.SourceFolder - && (rawResources.contains(entry.path) || entry.path == 'build/resources/main') + defaultOutputDir = file('bin/main') + file.whenMerged { cp -> + // Buildship merges the existing .classpath on every refresh. + cp.entries.removeAll { it instanceof org.gradle.plugins.ide.eclipse.model.SourceFolder + && it.path in ['src/main/resources', 'src/generated/resources', 'build/resources/main'] } + cp.entries.add(new org.gradle.plugins.ide.eclipse.model.SourceFolder('build/resources/main', 'bin/main')) + cp.entries.findAll { it.kind == 'src' }.each { entry -> + boolean tests = entry.path.startsWith('src/test/') || entry.path.startsWith('test-rig/unit-support') + entry.output = tests ? 'bin/test' : 'bin/main' + if (tests) entry.entryAttributes['test'] = 'true' } - def processed = new org.gradle.plugins.ide.eclipse.model.SourceFolder('build/resources/main', 'bin/main') - processed.entryAttributes['gradle_scope'] = 'main' - processed.entryAttributes['gradle_used_by_scope'] = 'main,test' - model.entries.add(processed) } } - synchronizationTasks 'isolateEclipseProductionRuns' } +def prepareEclipseResources = tasks.register('prepareEclipseResources', Copy) { + dependsOn tasks.named('processResources') + from layout.buildDirectory.dir('resources/main') + into 'bin/main' +} +neoForge.ideSyncTask prepareEclipseResources tasks.named('eclipseClasspath') { dependsOn tasks.named('processResources') } - tasks.register('configureEclipseBuildship') { - group = 'ide' - description = 'Creates Buildship preferences for ForgeGradle 7 Eclipse imports.' doLast { - File preferencesFile = file('.settings/org.eclipse.buildship.core.prefs') - Properties preferences = new Properties() - [ - 'eclipse.preferences.version' : '1', - 'connection.gradle.distribution': 'GRADLE_DISTRIBUTION(WRAPPER)', - 'connection.gradle.user.home' : gradle.gradleUserHomeDir.canonicalPath, - 'connection.project.dir' : '', - 'gradle.user.home' : gradle.gradleUserHomeDir.canonicalPath, - 'override.workspace.settings' : 'true' - ].each { key, value -> preferences.setProperty(key, value) } - preferencesFile.parentFile.mkdirs() - preferencesFile.withOutputStream { - preferences.store(it, - 'Generated by configureEclipseBuildship; keep Eclipse and command-line caches aligned.') - } + File prefs = file('.settings/org.eclipse.buildship.core.prefs') + prefs.parentFile.mkdirs() + Properties settings = new Properties() + ['eclipse.preferences.version': '1', + 'connection.gradle.distribution': 'GRADLE_DISTRIBUTION(WRAPPER)', + 'connection.gradle.user.home': gradle.gradleUserHomeDir.canonicalPath, + 'gradle.user.home': gradle.gradleUserHomeDir.canonicalPath, + 'java.home': javaToolchains.launcherFor(java.toolchain).get().metadata.installationPath.asFile.canonicalPath, + 'override.workspace.settings': 'true', 'connection.project.dir': ''].each { key, value -> settings.setProperty(key, value) } + prefs.withOutputStream { settings.store(it, 'Generated by configureEclipseBuildship') } } } - -tasks.register('isolateEclipseProductionRuns') { - group = 'ide' - description = 'Normalizes ForgeGradle Eclipse launches for production-only execution.' - dependsOn tasks.named('genEclipseRuns') - dependsOn tasks.named('configureEclipseBuildship') - dependsOn prepareEclipseResources +tasks.named('eclipse') { dependsOn 'configureEclipseBuildship', prepareEclipseResources } +tasks.register('verifyEclipseProductionClasspath') { + dependsOn tasks.named('eclipse'), tasks.named('verifyJavaPackageLayout') doLast { - obsoleteForgeGradle2EclipseLaunches.each { String name, String mainClass -> - File launch = file(name) - if (launch.isFile()) { - String contents = launch.getText('UTF-8') - String obsoleteMainType = - "org.eclipse.jdt.launching.MAIN_TYPE\" value=\"${mainClass}\"" - if (contents.contains(obsoleteMainType) && !launch.delete()) { - throw new GradleException("Could not remove obsolete ForgeGradle 2 launch ${name}") - } - } - } - // ForgeGradle 7's legacy 1.12 generator leaves this token unresolved, - // so write the target version into every generated launch explicitly. - fileTree(project.projectDir) { - include 'run*.launch' - }.files.each { File launch -> - String contents = launch.getText('UTF-8') - contents = contents.replace( - 'key="MC_VERSION" value="${MC_VERSION}"', - "key=\"MC_VERSION\" value=\"${project.minecraft_version}\"") - if (launch.name in ['runClient.launch', 'runServer.launch', 'runData.launch']) { - // Eclipse compiles into bin/main, not Gradle's merged run output. - def launchXml = new groovy.xml.XmlParser().parseText(contents) - def modClasses = launchXml.mapAttribute.find { - it.@key == 'org.eclipse.debug.core.environmentVariables' - }.mapEntry.findAll { it.@key == 'MOD_CLASSES' } - if (modClasses.size() != 1) { - throw new GradleException("${launch.name} must define one MOD_CLASSES entry") - } - String mainOutput = file('bin/main').absolutePath - String eclipseModClasses = "${project.mod_id}%%${mainOutput}" + - "${File.pathSeparator}${project.mod_id}%%${mainOutput}" - modClasses[0].@value = eclipseModClasses - contents = groovy.xml.XmlUtil.serialize(launchXml) - } - launch.setText(contents.replace('\r\n', '\n'), 'UTF-8') - } - ['runClient.launch', 'runServer.launch'].each { name -> - File launch = file(name) - if (!launch.isFile()) { - throw new GradleException("ForgeGradle did not generate ${name}") - } - String contents = launch.getText('UTF-8') - if (!contents.contains('org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE')) { - String marker = '' - String attribute = - ' ' - contents = contents.replace(marker, attribute + '\n' + marker) - } - - // Buildship exposes compileOnly dependencies through its project - // container. Replace that container in production launches with - // Gradle's actual runtime classpath so API-only jars cannot be - // discovered by FML as installed mods. - Set mainOutputs = sourceSets.main.output.files.collect { - it.canonicalFile - } as Set - List productionRuntime = configurations.runtimeClasspath.files.collect { - it.canonicalFile - }.findAll { File runtimeFile -> - !mainOutputs.contains(runtimeFile) - } - def parser = new groovy.xml.XmlParser() - def launchXml = parser.parseText(contents) - def classpath = launchXml.listAttribute.find { it.@key == 'org.eclipse.jdt.launching.CLASSPATH' } - if (classpath == null) { - throw new GradleException("${name} is missing its explicit classpath") - } - // A refresh can reuse an already isolated launch. Replace its old runtime - // archives too, but keep ForgeGradle's separate Slime Launcher entry. - def previousRuntime = classpath.listEntry.findAll { entry -> - def runtime = parser.parseText(entry.@value) - String archive = runtime.@externalArchive - runtime.@containerPath == 'org.eclipse.buildship.core.gradleclasspathcontainer' - || (archive && !file(archive).name.startsWith('slime-launcher-')) - } - if (previousRuntime.isEmpty()) { - throw new GradleException("${name} is missing its production runtime entries") - } - int runtimeIndex = classpath.children().indexOf(previousRuntime.first()) - previousRuntime.each { classpath.remove(it) } - def runtimeEntries = productionRuntime.collect { File runtimeFile -> - def archive = new Node(null, 'runtimeClasspathEntry', - [externalArchive: runtimeFile.path, type: '2', path: '5']) - new Node(null, 'listEntry', [value: groovy.xml.XmlUtil.serialize(archive)]) - } - classpath.children().addAll(runtimeIndex, runtimeEntries) - contents = groovy.xml.XmlUtil.serialize(launchXml) - - ['--cache', '--metadata', '--to-srg', '--to-obf'].each { option -> - String prefix = option + ' ' - int valueStart = contents.indexOf(prefix) - if (valueStart < 0) { - throw new GradleException("${name} is missing Slime Launcher argument ${option}") - } - valueStart += prefix.length() - int valueEnd = contents.indexOf(' --', valueStart) - if (valueEnd < 0) { - throw new GradleException("${name} has malformed Slime Launcher argument ${option}") - } - String value = contents.substring(valueStart, valueEnd) - if (value.find(/\s/) != null && !value.startsWith('"')) { - contents = (contents.substring(0, valueStart) - + '"' + value + '"' + contents.substring(valueEnd)) - } - } - launch.setText(contents.replace('\r\n', '\n'), 'UTF-8') - } + def xml = new groovy.xml.XmlSlurper().parse(file('.classpath')) + if (!xml.classpathentry.any { it.@kind.text() == 'src' && it.@path.text() == 'src/main/java' }) + throw new GradleException('Eclipse production source root missing') + if (xml.classpathentry.any { it.@path == 'src/main/resources' } + || !xml.classpathentry.any { it.@path == 'build/resources/main' && it.@output == 'bin/main' }) + throw new GradleException('Eclipse must use processed production resources') + xml.classpathentry.findAll { it.@kind == 'src' }.each { + boolean tests = it.@path.text().startsWith('src/test/') || it.@path.text().startsWith('test-rig/unit-support') + if (it.@output.text() != (tests ? 'bin/test' : 'bin/main')) + throw new GradleException('Mixed Eclipse production/test output') + } + xml.classpathentry.findAll { it.@kind == 'lib' }.each { + if (!file(it.@path.text()).isFile()) throw new GradleException('Missing Eclipse dependency: ' + it.@path) + } + String metadata = file('bin/main/META-INF/neoforge.mods.toml').text + if (!metadata.contains('version="' + project.mod_version + '"') || metadata.contains('${')) + throw new GradleException('Eclipse metadata was not expanded') + if (!xml.classpathentry.any { it.@path.text().contains('JavaSE-21') }) + throw new GradleException('Eclipse must use Java 21') } } - -def verifyJavaPackageLayout = tasks.register('verifyJavaPackageLayout') { - group = 'verification' - description = 'Checks that Java packages match their paths for Eclipse source lookup.' - doLast { - sourceSets.each { sourceSet -> - sourceSet.java.srcDirs.each { root -> - fileTree(root).matching { include '**/*.java' }.files.sort().each { source -> - def declaration = source.getText('UTF-8') =~ /(?m)^\s*package\s+([\w.$]+)\s*;/ - String declared = declaration.find() ? declaration.group(1) : '' - String expected = root.toPath().relativize(source.parentFile.toPath()) - .toString().replace(File.separator, '.') - if (declared != expected) { - throw new GradleException("${relativePath(source)} declares package '${declared}', " - + "but the ${sourceSet.name} source root expects '${expected}'") - } - } - } - } - } +tasks.register('prepareCombinedEclipseLaunch') { + dependsOn tasks.named('verifyEclipseProductionClasspath') + doLast { expansionJars.each { id, f -> if (!f.isFile()) throw new GradleException('Build expansion first: ' + id) } } } - -tasks.register('verifyEclipseProductionClasspath') { - group = 'verification' - description = 'Verifies the generated Eclipse project and production launches.' - dependsOn tasks.named('eclipse') - dependsOn tasks.named('verifyDevelopmentRuntimeArchives') - dependsOn tasks.named('isolateEclipseProductionRuns') - dependsOn verifyJavaPackageLayout - doLast { - File preferencesFile = file('.settings/org.eclipse.buildship.core.prefs') - Properties preferences = new Properties() - preferencesFile.withInputStream { preferences.load(it) } - if (preferences.getProperty('connection.gradle.distribution') != 'GRADLE_DISTRIBUTION(WRAPPER)' - || file(preferences.getProperty('connection.gradle.user.home', '')).canonicalFile - != gradle.gradleUserHomeDir.canonicalFile) { - throw new GradleException('Eclipse Buildship does not use this wrapper and Gradle home') - } - String projectMetadata = file('.project').getText('UTF-8') - if (!projectMetadata.contains('org.eclipse.buildship.core.gradleprojectnature') - || !projectMetadata.contains('org.eclipse.buildship.core.gradleprojectbuilder')) { - throw new GradleException('Eclipse project metadata is missing its Buildship nature or builder') - } - File eclipseModMetadata = file('bin/main/META-INF/mods.toml') - String eclipseMetadata = eclipseModMetadata.getText('UTF-8') - if (!eclipseMetadata.contains("modId=\"${project.mod_id}\"") - || !eclipseMetadata.contains("version=\"${project.mod_version}\"")) { - throw new GradleException('Eclipse output contains incorrect mod metadata') - } - def eclipseClasspath = new groovy.xml.XmlSlurper().parse(file('.classpath')) - def processedResources = eclipseClasspath.classpathentry.findAll { - it.@kind.text() == 'src' && it.@path.text() == 'build/resources/main' - } - def rawResourcePaths = sourceSets.main.resources.srcDirs.collect { relativePath(it).replace('\\', '/') } - if (processedResources.size() != 1 || processedResources[0].@output.text() != 'bin/main' - || eclipseClasspath.classpathentry.any { - it.@kind.text() == 'src' && rawResourcePaths.contains(it.@path.text()) - }) { - throw new GradleException('Eclipse must copy processed resources, never raw mod metadata templates') - } - String mainOutput = eclipseClasspath.classpathentry.find { - it.@kind.text() == 'src' && it.@path.text() == 'src/main/java' - }.@output.text() - if (file(mainOutput).canonicalFile != file('bin/main').canonicalFile) { - throw new GradleException('Eclipse production classes must use bin/main') - } - String expectedModClasses = "${project.mod_id}%%${file(mainOutput).absolutePath}" + - "${File.pathSeparator}${project.mod_id}%%${file(mainOutput).absolutePath}" - ['runClient.launch', 'runServer.launch', 'runData.launch'].each { name -> - def launch = new groovy.xml.XmlSlurper().parse(file(name)) - String modClasses = launch.mapAttribute.find { - it.@key.text() == 'org.eclipse.debug.core.environmentVariables' - }.mapEntry.find { it.@key.text() == 'MOD_CLASSES' }.@value.text() - if (modClasses != expectedModClasses) { - throw new GradleException("${name} does not discover the Eclipse production mod in bin/main") - } - } - ['runClient.launch', 'runServer.launch'].each { name -> - def launch = new groovy.xml.XmlSlurper().parse(file(name)) - String contents = file(name).getText('UTF-8').replace('\\', '/') - String main = launch.stringAttribute.find { - it.@key.text() == 'org.eclipse.jdt.launching.MAIN_TYPE' - }.@value.text() - String program = launch.stringAttribute.find { - it.@key.text() == 'org.eclipse.jdt.launching.PROGRAM_ARGUMENTS' - }.@value.text() - String target = name == 'runClient.launch' ? 'forge_userdev_client' : 'forge_userdev_server' - if (main != 'net.minecraftforge.launcher.Main' - || !program.startsWith('--main net.minecraftforge.bootstrap.ForgeBootstrap ') - || !program.contains(" -- --launchTarget ${target} ")) { - throw new GradleException("${name} does not start the Forge 52 bootstrap") - } - ['--cache', '--metadata', '--to-srg', '--to-obf'].each { option -> - def argument = program =~ /(?:^|\s)${option}\s+(?:"([^"]+)"|([^"\s]+))(?=\s+--|$)/ - if (!argument.find()) { - throw new GradleException("${name} must keep ${option} as one Slime Launcher argument") - } - File path = file(argument.group(1) ?: argument.group(2)) - if (option != '--cache' && !path.isFile()) { - throw new GradleException("${name} ${option} points to a missing file: ${path}") - } - } - if (launch.booleanAttribute.find { - it.@key.text() == 'org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE' - }.@value.text() != 'true' - || contents.contains('src/test') || contents.contains('bin/test')) { - throw new GradleException("${name} does not isolate production code") - } - if (launch.stringAttribute.find { - it.@key.text() == 'org.eclipse.jdt.launching.PROJECT_ATTR' - }.@value.text() != 'PowerAdvantage') { - throw new GradleException("${name} targets the wrong Eclipse project") - } - if (contents.contains('org.eclipse.buildship.core.gradleclasspathcontainer')) { - throw new GradleException("${name} exposes compileOnly dependencies at runtime") - } - ['RF-API.jar', 'RebornCore-1.12.2'].each { forbiddenDependency -> - if (contents.toLowerCase(Locale.ROOT).contains(forbiddenDependency.toLowerCase(Locale.ROOT))) { - throw new GradleException( - "${name} includes compile-only dependency ${forbiddenDependency}") - } - } - if (!contents.contains("forge-${project.minecraft_version}-${project.forge_version}")) { - throw new GradleException("${name} is missing the Forge development runtime") - } - List bootstrapArtifacts = [ - "forge-${project.minecraft_version}-${project.forge_version}", - "client-extra-${project.minecraft_version}", - "mappings_${project.mapping_channel}-${project.minecraft_version}" - ] - List bootstrapPositions = bootstrapArtifacts.collect { artifact -> - contents.indexOf(artifact) - } - if (bootstrapPositions.any { it < 0 } - || bootstrapPositions != bootstrapPositions.sort(false)) { - throw new GradleException( - "${name} does not preserve the Forge bootstrap classpath order") - } - if (contents.contains('${MC_VERSION}') || launch.mapAttribute.find { - it.@key.text() == 'org.eclipse.debug.core.environmentVariables' - }.mapEntry.find { it.@key.text() == 'MC_VERSION' }.@value.text() != project.minecraft_version) { - throw new GradleException("${name} does not define a literal Minecraft version") - } - } - } +publishing { + publications { mavenJava(MavenPublication) { + from components.java + artifactId = 'basePower' + pom { name = 'basePower'; description = project.mod_description + licenses { license { name = 'LGPL-3.0-only'; url = 'https://www.gnu.org/licenses/lgpl-3.0.html' } } } + } } } - tasks.register('verifyModelAssets') { group = 'verification' description = 'Verifies that PowerAdvantage model references resolve to packaged assets.' @@ -1083,7 +305,7 @@ tasks.register('verifyModelAssets') { doLast { Set vanillaAssets = [] as Set configurations.runtimeClasspath.files.findAll { - it.name.startsWith('client-extra-') && it.name.endsWith('.jar') + it.name.contains('client-extra') && it.name.endsWith('.jar') }.each { File archive -> new ZipFile(archive).withCloseable { zip -> zip.entries().each { entry -> vanillaAssets.add(entry.name) } @@ -1159,7 +381,7 @@ tasks.register('verifyModelAssets') { tasks.register('verifyRecipeTagGuards') { group = 'verification' - description = 'Rejects recipes that can collapse when a Forge material tag is empty.' + description = 'Rejects recipes that can collapse when a shared material tag is empty.' File recipeRoot = file("src/main/resources/data/${project.mod_id}/recipe") inputs.dir(recipeRoot) doLast { @@ -1167,8 +389,8 @@ tasks.register('verifyRecipeTagGuards') { collectTags = { Object node, Set tags -> if (node instanceof Map) { node.each { key, value -> - if (key == 'forge:condition' || key == 'result') return - if (key == 'tag' && value instanceof String && value.startsWith('forge:')) { + if (key == 'neoforge:conditions' || key == 'result') return + if (key == 'tag' && value instanceof String && (value.startsWith('c:') || value.startsWith('forge:'))) { tags.add(value) } else { collectTags(value, tags) @@ -1181,9 +403,9 @@ tasks.register('verifyRecipeTagGuards') { Closure requiredConditions requiredConditions = { Object node, String path -> if (!(node instanceof Map) || !(node.type instanceof String)) { - throw new GradleException("${path} contains an invalid Forge recipe condition") + throw new GradleException("${path} contains an invalid NeoForge recipe condition") } - if (node.type != 'forge:and') return [node] + if (node.type != 'neoforge:and') return [node] if (!(node.values instanceof Collection) || node.values.isEmpty()) { throw new GradleException("${path} contains an empty Forge conjunction") } @@ -1193,11 +415,11 @@ tasks.register('verifyRecipeTagGuards') { Map recipe = new JsonSlurper().parse(recipeFile) as Map Set tags = [] as Set collectTags(recipe, tags) - if (recipe.containsKey('conditions')) { + if (recipe.containsKey('conditions') || recipe.containsKey('forge:condition')) { throw new GradleException("${recipeFile.path} uses legacy recipe conditions") } - List conditions = recipe.containsKey('forge:condition') - ? requiredConditions(recipe['forge:condition'], recipeFile.path) : [] + List conditions = recipe.containsKey('neoforge:conditions') + ? recipe['neoforge:conditions'].collectMany { requiredConditions(it, recipeFile.path) } : [] Set guards = conditions .findAll { it instanceof Map && it.type == 'basepower:tag_not_empty' } .collect { it.tag as String } as Set @@ -1214,87 +436,43 @@ tasks.register('verifyRecipeTagGuards') { } } + tasks.named('check') { - dependsOn verifyJavaPackageLayout - dependsOn tasks.named('verifyReleaseConfiguration') - dependsOn tasks.named('verifyDevelopmentRuntimeArchives') - dependsOn tasks.named('verifyModelAssets') - dependsOn tasks.named('verifyRecipeTagGuards') + dependsOn tasks.named('verifyReleaseConfiguration'), tasks.named('verifyJavaPackageLayout'), + tasks.named('verifyModelAssets'), tasks.named('verifyRecipeTagGuards') } - def compileClientResourceProbe = tasks.register('compileClientResourceProbe', JavaCompile) { - group = 'verification' - description = 'Compiles the build-only client model and translation probe.' dependsOn tasks.named('classes') source fileTree('test-rig/client-resources/java') classpath = files(sourceSets.main.output, sourceSets.main.compileClasspath) destinationDirectory = layout.buildDirectory.dir('client-resource-probe/classes') } - tasks.register('clientResourceProbeJar', Jar) { - group = 'verification' - description = 'Builds a test-only client probe; never part of a release or normal launch.' dependsOn compileClientResourceProbe archiveFileName = 'advantageclientresources-deobf.jar' destinationDirectory = layout.buildDirectory.dir('client-resource-probe') from compileClientResourceProbe.flatMap { it.destinationDirectory } from 'test-rig/client-resources/resources' } - -// Optional coordinated play-test launch. The ordinary launch stays Power-only; -// The expansion jars are runtime inputs, never release contents or compile dependencies. -def advantageExtensionJars = [ - basesteam: file(providers.gradleProperty('steamAdvantageDeobfJar').getOrElse( - '../SteamAdvantage/SteamAdvantage/build/libs/baseSteam-2.2.15.121011.jar')), - baseelectric: file(providers.gradleProperty('electricAdvantageDeobfJar').getOrElse( - '../ElectricAdvantage/ElectricAdvantage/build/libs/baseElectric-2.2.15.121011.jar')) -] - -tasks.register('prepareCombinedEclipseLaunch') { - group = 'ide' - description = 'Creates an additional production-only Eclipse client launch with all three Advantage mods.' - dependsOn tasks.named('verifyEclipseProductionClasspath') - dependsOn tasks.named('deobfJar') - doLast { - File inputProfile = file(providers.gradleProperty('advantageDevelopmentProfile').getOrElse( - 'test-rig/profiles/native1211/dev-core.json')) - def profile = new JsonSlurper().parse(inputProfile) - if (profile.powerDeobfSha256) { - File powerJar = tasks.named('jar', Jar).get().archiveFile.get().asFile - String powerHash = MessageDigest.getInstance('SHA-256').digest(powerJar.bytes).encodeHex().toString() - if (!powerHash.equalsIgnoreCase(profile.powerDeobfSha256 as String)) { - throw new GradleException("PowerAdvantage does not match the dependency pin in ${inputProfile}: ${powerJar}") - } - } - advantageExtensionJars.each { String id, File jar -> - def pin = profile.mods.find { it.id == id } - if (!jar.isFile()) throw new GradleException("Build ${id} first, or override its *AdvantageDeobfJar property: ${jar}") - String hash = MessageDigest.getInstance('SHA-256').digest(jar.bytes).encodeHex().toString() - if (pin == null || !hash.equalsIgnoreCase(pin.sha256 as String)) { - throw new GradleException("${id} does not match the dependency pin in ${inputProfile}: ${jar}") - } - } - def launch = new groovy.xml.XmlParser().parse(file('runClient.launch')) - def classpath = launch.listAttribute.find { it.@key == 'org.eclipse.jdt.launching.CLASSPATH' } - if (classpath == null) throw new GradleException('Base client launch has no explicit production classpath') - advantageExtensionJars.values().each { File jar -> - String entry = groovy.xml.XmlUtil.serialize(new Node(null, 'runtimeClasspathEntry', - [externalArchive: jar.canonicalPath, type: '2', path: '5'])) - classpath.appendNode('listEntry', [value: entry]) +def stageDevelopmentMods = { String name, run, boolean probe -> + tasks.register(name, Copy) { + if (probe) dependsOn tasks.named('clientResourceProbeJar') + from expansionJars.values() + if (probe) from tasks.named('clientResourceProbeJar', Jar).flatMap { it.archiveFile } + into run.gameDirectory.dir('mods') + doFirst { + expansionJars.each { id, jar -> if (!jar.isFile()) throw new GradleException('Build expansion first: ' + id) } + Set managed = expansionJars.values().collect { it.name } as Set + if (probe) managed.add('advantageclientresources-deobf.jar') + def unexpected = fileTree(run.gameDirectory.dir('mods')).matching { include '*.jar' }.files + .findAll { !managed.contains(it.name) } + if (unexpected) throw new GradleException('Unmanaged development mods; choose a fresh run directory: ' + unexpected) } - File combined = file('runClientAllAdvantage.launch') - combined.setText(groovy.xml.XmlUtil.serialize(launch), 'UTF-8') - def parsed = new groovy.xml.XmlSlurper().parse(combined) - def archivePaths = parsed.listAttribute.find { - it.@key.text() == 'org.eclipse.jdt.launching.CLASSPATH' - }.listEntry.collect { new groovy.xml.XmlSlurper().parseText(it.@value.text()).@externalArchive.text() } - advantageExtensionJars.values().each { File jar -> - if (archivePaths.count(jar.canonicalPath) != 1) throw new GradleException("Missing or repeated extension: ${jar}") - } - if (combined.text.contains('advantageworkstest') || combined.text.contains('client-resource-probe') - || combined.text.contains('bin/test') || combined.text.contains('buildship.core.gradleclasspathcontainer')) { - throw new GradleException('Combined launch leaked test code or an unfiltered classpath') - } - logger.lifecycle("Prepared ${combined.name}; uses the same run directory and saves as runClient.launch.") } } +neoForge.runs.clientAllAdvantage.taskBefore(stageDevelopmentMods('stageCombinedDevelopmentMods', neoForge.runs.clientAllAdvantage, false)) +neoForge.runs.clientResourceCheck.taskBefore(stageDevelopmentMods('stageClientResourceMods', neoForge.runs.clientResourceCheck, true)) + +apply from: 'gradle/verify-eclipse-ecj.gradle' + +apply from: 'gradle/client-integration.gradle' diff --git a/docs/1.21.1-neoforge/TEST-RESULTS.md b/docs/1.21.1-neoforge/TEST-RESULTS.md new file mode 100644 index 00000000..e1615195 --- /dev/null +++ b/docs/1.21.1-neoforge/TEST-RESULTS.md @@ -0,0 +1,181 @@ +# NeoForge 1.21.1 Test Notes + +Manual testing of the native port was accepted. The public dependency stack is +being requalified on 15 November 2026 before release: NeoForge 21.1.265, Base +Metals 4.0.1.121012+Neo, MMDLib 2.0.2.121012+Neo and OreSpawn 4.1.1.121012. +Nothing is published merely because a build or an individual check passes. + +The figures below record the earlier 13 November candidate and its local Base +Metals dependency. They are historical evidence, not qualification of the new +published stack. The final release checks will replace this summary once the +current run is complete. + +## What Changed + +The three mods use NeoForge 21.1.247, Java 21 and ModDevGradle 2.0.148. Mod IDs, +registry names, machine data and the historical `cyano.poweradvantage.api` +namespace remain in place. The machines still use the Advantage network code. +They now share MMDLib's `mmdlib:crushing` recipes with Base Metals' crackhammers. +Removing or replacing one of those recipes affects the hammer and both crushers. + +The port also repairs issues found during testing: + +- Invalidated machine capabilities are rebuilt when chunks return, including + consumers which previously cached a missing capability. +- Oil buckets resolve to their source fluid, not a flowing variant. +- Muskets use the common blackpowder ammunition tag. +- The chest-parts modifier uses NeoForge's data namespace. This keeps + Apocalyptic progression possible without overriding a player's chest loot. +- Engine-owned `ForgeData` is translated to `NeoForgeData`, without rewriting + similarly named fields inside arbitrary item custom data. + +## Candidate Jars + +| Mod | Version | SHA-256 | +| --- | --- | --- | +| basePower | 2.4.19.121012 | `FEB4F3E1C3671E7E9A75A6114BD5173051A68AE9C6E688FA9B4739AC6C71720C` | +| baseSteam | 2.2.20.121012 | `9DCBD13FA3592DF07950EE86CD7C89CEA600F4D0CF50D7AAB0DCB1CA27D8D9EB` | +| baseElectric | 2.2.20.121012 | `36368F94F6441317156BE8CD799A3B84AE1BC88E35FDAAFE6EDA8B22D37AF31E` | + +Use Base Metals `4.0.1.121012-development` with the local migration hook, +MMDLib `2.0.1.121012+Neo` and OreSpawn `4.1.1.121012`. The public Base Metals +4.0.0 jar is not the tested dependency. Neither the Base Metals patch nor these +three ports has been pushed or published as part of this work. + +## Qualification + +The current candidate passed the operating and restart matrix below. The exact +local receipt index is `final-qualification.json` in the campaign directory. + +| Gate | Result | +| --- | --- | +| Power / Steam / Electric JUnit | 236 / 228 / 106 passed | +| Harness JUnit / Python regression tests | 339 / 2,337 passed | +| Base Metals hook / independent native controls | 24 / 3 passed | +| Steam / Electric GameTests | 10 / 21 passed | +| Finite machine jobs and stopped-save restart checks | 132 passed | +| Recipe unlock boots / live progression cases | 5 / 18 passed | +| Harvest and drop checks | 270 passed | +| Fresh and migrated endurance | 30 minutes each, restart and resumed processing passed | +| Independent endurance replay | 33 checkpoints and 528 station snapshots per world passed | +| Real integrated-client tank menu | Two full processes, matching menu IDs and 1,375 mB retained | +| Eclipse ECJ and independent-cache/path-with-spaces builds | Passed; all nine player/sources/Javadoc archive hashes reproduced | + +The matrix covers finite machine jobs with stopped-save inspection, full process +restarts, partial network unloads, bridge unloads, moving drills in all six +directions, harvesting, oil transport, portable-tank pickup, sided capabilities, +locked inventories and Forge Energy converters. Recipe tests cover Normal, Tech +Progression and Apocalyptic modes, with and without rubber, plus data reloads and +cold restarts. Shared crushing tests use actual MMDLib hammer interactions and +both naturally ticking crushers, including recipe replacement and removal. + +World-upgrade fixtures cover original Cyano 1.10, released base* 1.10 and 1.12, +and a maintained Forge 1.21.1 world. They compare saved state before running the +machines, run the connected equipment without replacing it, then compare again +after a complete restart. Separate player, Nether and End fixtures cover stored +items, wear, enchantments, attributes, passengers, ownership and entity storage. + +Fresh and migrated Works worlds each receive a measured 30-minute run, followed +by a complete restart and another minute of processing. A separate replay checks +every retained station snapshot, item/fluid conservation and measured tick rate. +An animation or a lit power indicator is not a sufficient result. + +Generation checks preserve provider choices, user overrides and imported old +OreSpawn files through cold restarts. Default sulfur ownership switches to +Mineralogy when it is present, with the Electric alternative still visible and +disabled. A positive normal-world sample on seed 24680 found 190 Power oil blocks +with the family alone. With Mineralogy it found 204 Power oil blocks, 2,032 +Mineralogy oil blocks and 3,415 Mineralogy sulfur blocks, with no Electric sulfur. +Both samples retained their counts after restart and had zero oil-biome +violations. An earlier seed produced no Power oil; those failed samples remain +recorded. No frequency, radius, jar or expected count was changed to obtain the +positive sample. + +The graphical checks rendered all 39 machine screens at nine window/scale/fill +combinations. They check 351 required caption cases and reject 355 deliberately +broken cases. Tank gauges are compared against independent fluid-sprite renders. +The client also checks all 94 items, 905 block states, 87 creative entries and +three recipe-book packet sets. Additional mutation controls protect those +oracles from weakened thresholds and missing checks. + +Compilation is checked with both Gradle and Eclipse's own Java compiler, with +production/test isolation controls. Separate source snapshots in paths with +spaces and independent Gradle caches check reproducible player, sources and +Javadoc jars. These checks do not replace opening Eclipse or playing the game. A +separate native client helper also opened a real menu over the actual +client/server connection, saved normally, exited Minecraft, and reopened the +same copied world in another process without reseeding its tank. That check is +separate from the worldless rendering probe and the packaged server harness. + +## Eclipse Refresh Repair + +Manual Eclipse testing found duplicate `build/resources/main` entries in Power's +classpath. Electric had the same generator problem. A normal Gradle build and +the earlier ECJ compilation did not reject those duplicates, so the previous +checks were incomplete for repeated IDE refreshes. + +The resource-root replacement now removes the previous processed root before +adding it back. All three projects reject duplicate entries and exercise three +successive merge/save/load cycles as part of `check` and the Eclipse audits. +The new check failed on Power's original duplicated classpath before the repair. +Independent Tooling API requests also returned stable, unique source roots on +three successive requests for each project. + +After the repair, all 570 unit tests, builds and production/test ECJ compilations +passed. All nine player, sources and Javadoc archive hashes still match the +qualified candidate. Gameplay and endurance checks were not rerun for this +build-only repair. Eclipse's cached error markers may need a Gradle refresh and +project clean before they disappear. + +A subsequent Buildship refresh exposed a second issue: the copied-world client +probe was attached to `prepareClientIntegrationRun`, which ModDevGradle also +executes during IDE sync. That correctly failed without an explicit disposable +world, but ordinary project refreshes should never reach that setup. Preparation +now belongs only to the actual test launch. The diagnostic run is not offered +as an IDE launch, and the explicit-world safety guard is unchanged. + +The new `verifyEclipseSynchronization` gate reproduced this failure before the +repair and now executes NeoForge's synchronization tasks during `check` and the +Eclipse audits. Separate phased Tooling API checks use Eclipse detection, request +the synchronization tasks before execution, then query the project model after +execution. Three full requests passed for each project. An integration launch +without world-selection properties still fails at its safety guard before +Minecraft starts. The build, unit tests and ECJ checks passed again; the nine +qualified archive hashes remain unchanged. + +## Native Entity Behaviour + +Minecraft 1.21.1's own data fixer changes the old tamed-wolf fixture from health +8/maximum 20 to health 16/maximum 40. Independent NeoForge controls reproduce +this with no Advantage, Base Metals, MMDLib or OreSpawn classes, no server and no +entity ticks. The original strict comparison remains recorded as failed. A +separate assessment accepts only those exact values with the original UUID and +owner; any other loss or change still fails. + +Native non-saving leash-knot helpers are checked through their real holder +lifecycle, not invented saved records. Their independent control is bound to the +actual NeoForge engine-class hashes. Historical Forge controls remain unchanged. + +## Manual Checks + +Import the three existing Gradle projects under `D:/PowerAdvantage/PA1211NEO` +into a separate Eclipse workspace using Java 21. From Power's Gradle Tasks view, +run `runClientAllAdvantage`. It stages the two expansion jars into +`run-all-advantage/mods` and uses the tested dependency pins. Do not add a second +copy of Power or the test harness to that directory. + +Check ordinary recipe discovery, screen tooltips and slots, drill animation, +live turbine orientation/spin and the usual connected builds. A real player +login, multiplayer menu interaction, resource packs and third-party modpacks +remain manual checks. Automated geometry checks explicitly leave live turbine +motion for this stage. + +Use disposable copies of worlds. The migration fixtures are not proof that +unported third-party blocks can survive removal of their owning mods. No original +Sylvester save is opened or modified by this campaign. The Metal Fluid Tank +still drops empty; the Portable Fluid Tank retains its fluid in Survival. + +Local jars, failed attempts, source manifests and raw reports are kept under +`D:/PowerAdvantage/_verification/base-1211neo-port-20261113`, the ignored rig +`build` directory and the local logs directory. They do not belong in release +jars or Git commits. Publication and manual acceptance are separate steps. diff --git a/gradle.properties b/gradle.properties index 69296fad..28514aa6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,20 +3,16 @@ org.gradle.daemon=false org.gradle.configuration-cache=false org.gradle.caching=true org.gradle.parallel=false -net.minecraftforge.gradle.merge-source-sets=false minecraft_version=1.21.1 minecraft_version_range=[1.21.1] -forge_version=52.1.0 -forge_installer_sha256=F1B620F2879AD6A5BBE15DABA4D8F81EAB9F5E08004967604960B98996BDEBC4 -forge_version_range=[52.1.0,53) -loader_version_range=[52,) -mapping_channel=official -mapping_version=1.21.1 -mcp_version=20240808.132146 +loader_version_range=[4,) -loader_name=forge -loader_code=1 +loader_name=neoforge +loader_code=2 +neo_version=21.1.265 +mmdlib_version=2.0.2.121012+Neo +mmdlib_sha256=EE417C82D588B0050A49709B6430CF836315E71E4DB2DF4036D3735454BC5311 java_version=21 java_toolchain_version=21.0.7+6 java_setup_version=21.0.7+6 @@ -26,22 +22,22 @@ curseforge_project_id=1780140 mod_id=basepower mod_name=basePower mod_license=LGPL-3.0-only -mod_version=2.4.14.121011 -release_player_sha256=F91A613EB5FAA218AAD2DC3C881DEC7B897A5EE874215282A439E34B915C1AE6 +mod_version=2.4.19.121012 +release_player_sha256=UNQUALIFIED mod_group=zone.moddev.mc.basepower mod_authors=DrCyano (aka Cyanobacterium) mod_description=API and shared machines for pressure, electricity, quantum power, fluids, and item transport. -cf_requirements=base-metals,mmd-orespawn +cf_requirements=base-metals,mmdlib,mmd-orespawn cf_optionals=additional-loot-tables cf_versions=1.21.1 -basemetals_version=3.1.2.121011 -basemetals_source_commit=327c197bcdd0bb5e883d844bb6a6c8791bc580b7 +basemetals_version=4.0.1.121012+Neo +basemetals_source_commit=39b240bb0d9f80997847ab4df70a2dd23e6ea826 basemetals_curse_project_id=240967 -basemetals_deobf_sha256=7C0B961A8D4991C9B69379518AAD700A71C1E4B2076CF5DEF292C58029408A07 +basemetals_deobf_sha256=B4BB1CBCD54DFCF2EC8465ACE82715EDCCC5BF1E5C15E14C627AE7CC58E8FED1 -orespawn_version=4.1.0.121011 -orespawn_source_commit=62c08169c71f4d4fd8f107289e63fd2a4c7c655c +orespawn_version=4.1.1.121012 +orespawn_source_commit=f141ae56ea69e4c9f7f8ebd7697b933a91ee5001 orespawn_curse_project_id=245586 -orespawn_deobf_sha256=EB369B7D7CE6D6C453658347A420C2F0783B7F4D1AC7383C87176AC05192B5A0 +orespawn_deobf_sha256=BF02244E25B5FBF89CCAD45F41B2624B850D4BBCB70CF66822249BA233A00976 diff --git a/gradle/client-integration.gradle b/gradle/client-integration.gradle new file mode 100644 index 00000000..e5f01076 --- /dev/null +++ b/gradle/client-integration.gradle @@ -0,0 +1,96 @@ +import groovy.json.JsonOutput +import groovy.json.JsonSlurper +import java.security.MessageDigest +import java.nio.channels.FileChannel +import java.nio.file.StandardOpenOption + +// Test-only source/output; never attached to production archives or the resource probe. +def integrationRoot = providers.gradleProperty('clientIntegrationDirectory') + .orElse('build/client-integration/UNSELECTED').map { file(it) } +def compileIntegration = tasks.register('compileNativeClientIntegration', JavaCompile) { + dependsOn tasks.named('classes') + source fileTree('test-rig/client-integration/java') { include '**/*.java' } + classpath = files(sourceSets.main.output, sourceSets.main.compileClasspath) + destinationDirectory = layout.buildDirectory.dir('client-integration-helper/classes') + options.release = 21 + options.encoding = 'UTF-8' +} +def integrationJar = tasks.register('nativeClientIntegrationJar', Jar) { + dependsOn compileIntegration + archiveFileName = 'native-client-integration.jar' + destinationDirectory = layout.buildDirectory.dir('client-integration-helper') + from compileIntegration.flatMap { it.destinationDirectory } + from 'test-rig/client-integration/resources' +} +neoForge.runs.create('clientIntegration') { + client() + // This copied-world probe needs explicit Gradle properties, not an IDE launch. + disableIdeRun() + gameDirectory = layout.dir(integrationRoot) + systemProperty 'advantageworks.clientIntegration', 'true' + jvmArguments.addAll '-XX:ActiveProcessorCount=4', '-Xmx3G' +} +def prepareIntegration = tasks.register('prepareNativeClientIntegration') { + dependsOn integrationJar + doLast { + if (!providers.gradleProperty('clientIntegrationDirectory').isPresent()) throw new GradleException('Select an explicit disposable clientIntegrationDirectory') + File root = integrationRoot.get().canonicalFile + File allowed = layout.buildDirectory.dir('client-integration').get().asFile.canonicalFile + if (!root.toPath().startsWith(allowed.toPath()) || root == allowed) throw new GradleException('Use a marked subdirectory of build/client-integration') + String phase = providers.gradleProperty('clientIntegrationPhase').getOrElse('initial') + if (!(phase in ['initial', 'reload'])) throw new GradleException('Invalid client integration phase') + def hash = { File input -> MessageDigest.getInstance('SHA-256').digest(input.bytes).encodeHex().toString() } + File markerFile = new File(root, 'client-integration.allow.json') + Map marker + if (phase == 'initial') { + if (root.exists()) throw new GradleException('Retain prior integration evidence; choose a fresh directory') + File source = file(providers.gradleProperty('clientIntegrationSourceWorld').get()).canonicalFile + if (source.parentFile.name != 'release-20261115-operations-a' || source.name != 'AdvantageWorksMigration') throw new GradleException('Only the closed release-operations copied world is approved by this adapter') + File report = new File(source.parentFile, 'native1211neo-machine-operation-results.json') + Map qualification = new JsonSlurper().parse(report) as Map + if (qualification.status != 'PASS') throw new GradleException('Source operations world did not pass') + FileChannel.open(new File(source, 'session.lock').toPath(), StandardOpenOption.READ, StandardOpenOption.WRITE).withCloseable { channel -> + def lock = channel.tryLock() + if (lock == null) throw new GradleException('Source world is live; refusing to copy it') + try { + Map sourceHashes = fileTree(source) { exclude 'session.lock' }.files.collectEntries { [(it.canonicalPath): hash(it)] } + copy { from source; exclude 'session.lock'; into new File(root, 'saves/ClientIntegrationWorld') } + copy { from new File(source.parentFile, 'config'); into new File(root, 'config') } + sourceHashes.each { path, sha -> if (hash(new File(path)) != sha) throw new GradleException('Source world changed during copy') } + marker = [schema: 1, disposable: true, sourceWorld: source.canonicalPath, + sourceWorldSha256: sourceHashes, sourceReportSha256: hash(report), inputSha256: [:]] + new File(root, 'options.txt').setText('onboardAccessibility:false\npauseOnLostFocus:false\n', 'UTF-8') + } finally { lock.release() } + } + } else { + marker = new JsonSlurper().parse(markerFile) as Map + File previous = new File(root, 'client-integration-initial.json') + if (!previous.isFile() || new JsonSlurper().parse(previous).status != 'PASS') throw new GradleException('Initial full-process proof is required before reload') + } + if (new File(root, 'client-integration-' + phase + '.json').exists()) throw new GradleException('Refusing to overwrite a phase receipt') + File mods = new File(root, 'mods') + mods.mkdirs() + def expansionFiles = [file('../SteamAdvantage/SteamAdvantage/build/libs/baseSteam-2.2.20.121012.jar'), + file('../ElectricAdvantage/ElectricAdvantage/build/libs/baseElectric-2.2.20.121012.jar'), integrationJar.get().archiveFile.get().asFile] + def managed = expansionFiles.collect { it.name }.toSet() + if (fileTree(mods).files.any { !managed.contains(it.name) }) throw new GradleException('Unexpected integration mods') + expansionFiles.each { input -> copy { from input; into mods } } + Map inputs = (sourceSets.main.output.files.findAll { it.isDirectory() }.collectMany { fileTree(it).files } + + sourceSets.main.runtimeClasspath.files.findAll { it.isFile() } + expansionFiles + fileTree(mods).files).unique().collectEntries { [(it.canonicalPath): hash(it)] } + if (phase == 'reload' && marker.inputSha256 != inputs) throw new GradleException('Runtime inputs changed between full client processes') + marker.inputSha256 = inputs + marker.phase = phase + markerFile.setText(JsonOutput.prettyPrint(JsonOutput.toJson(marker)) + '\n', 'UTF-8') + } +} +neoForge.runs.clientIntegration.taskBefore prepareIntegration +// ModDevGradle uses prepareClientIntegrationRun during sync to write arguments. +// World copying belongs only on the actual launch through taskBefore above. +tasks.named('runClientIntegration') { + doLast { + File root = integrationRoot.get() + String phase = providers.gradleProperty('clientIntegrationPhase').getOrElse('initial') + File receipt = new File(root, 'client-integration-' + phase + '.json') + if (!receipt.isFile() || new JsonSlurper().parse(receipt).status != 'PASS') throw new GradleException('Native integrated-client phase did not qualify; retain all evidence') + } +} diff --git a/gradle/verify-eclipse-ecj.gradle b/gradle/verify-eclipse-ecj.gradle new file mode 100644 index 00000000..b60cb5b4 --- /dev/null +++ b/gradle/verify-eclipse-ecj.gradle @@ -0,0 +1,282 @@ +import groovy.json.JsonOutput +import java.nio.file.Files +import java.security.MessageDigest +import java.util.jar.JarFile + +def assertUniqueEclipseEntries = { List entries -> + def duplicates = entries.groupBy { [it.kind, it.path] }.findAll { key, rows -> rows.size() > 1 } + if (duplicates) throw new GradleException('Duplicate Eclipse classpath entries: ' + duplicates.keySet()) +} + +def verifyEclipseClasspathMerging = tasks.register('verifyEclipseClasspathMerging') { + group = 'verification' + description = 'Rejects duplicate Eclipse entries and tests repeated Gradle/Buildship classpath merging.' + dependsOn tasks.named('eclipseClasspath') + doLast { + def rows = { model -> model.entries.collect { [kind: it.kind, path: it.path] } } + def model = new org.gradle.plugins.ide.eclipse.model.Classpath(eclipse.classpath.fileReferenceFactory) + file('.classpath').withInputStream { model.load(it) } + assertUniqueEclipseEntries(rows(model)) + def original = rows(model) + boolean rejected = false + try { + assertUniqueEclipseEntries(original + [original.first()]) + } catch (GradleException expected) { + if (!expected.message.startsWith('Duplicate Eclipse classpath entries:')) throw expected + rejected = true + } + if (!rejected) throw new GradleException('Duplicate classpath negative control was not rejected') + def passes = [] + 3.times { index -> + // Exercise the same merger as eclipseClasspath and the Tooling API, + // including loading the file produced by the previous refresh. + eclipse.classpath.mergeXmlClasspath(model) + assertUniqueEclipseEntries(rows(model)) + if (rows(model).toSet() != original.toSet()) + throw new GradleException('Eclipse classpath entries changed on refresh ' + (index + 1)) + passes.add([refresh: index + 1, entries: model.entries.size()]) + def output = new ByteArrayOutputStream() + model.store(output) + model = new org.gradle.plugins.ide.eclipse.model.Classpath(eclipse.classpath.fileReferenceFactory) + model.load(new ByteArrayInputStream(output.toByteArray())) + assertUniqueEclipseEntries(rows(model)) + } + File report = layout.buildDirectory.file('reports/eclipse-classpath-merging.json').get().asFile + report.parentFile.mkdirs() + report.setText(JsonOutput.prettyPrint(JsonOutput.toJson([ + status: 'PASS', duplicateControlRejected: rejected, refreshes: passes])) + '\n', 'UTF-8') + logger.lifecycle('Eclipse classpath PASS: 3 repeated merges; duplicate-entry control rejected.') + } +} +def verifyEclipseSynchronization = tasks.register('verifyEclipseSynchronization') { + group = 'verification' + description = 'Runs the actual NeoForge IDE sync tasks without opting into a test world or Minecraft launch.' + dependsOn tasks.named('neoForgeIdeSync') + doLast { + Set dependencies = new LinkedHashSet<>() + def collect + collect = { Task task -> + if (dependencies.add(task)) task.taskDependencies.getDependencies(task).each { collect(it) } + } + collect(tasks.named('neoForgeIdeSync').get()) + def unsafe = dependencies.findAll { it.name == 'prepareNativeClientIntegration' || it.name.startsWith('runClient') + || it.name.startsWith('runServer') || it.name.startsWith('runGameTest') } + if (unsafe) throw new GradleException('IDE sync must not launch Minecraft or prepare a copied world: ' + unsafe*.path) + File report = layout.buildDirectory.file('reports/eclipse-synchronization.json').get().asFile + report.parentFile.mkdirs() + report.setText(JsonOutput.prettyPrint(JsonOutput.toJson([ + status: 'PASS', synchronizationTasks: dependencies*.path.sort()])) + '\n', 'UTF-8') + logger.lifecycle('Eclipse synchronization PASS: native sync completed without test-world preparation or game launches.') + } +} +tasks.named('check') { dependsOn verifyEclipseClasspathMerging, verifyEclipseSynchronization } +tasks.matching { it.name == 'verifyEclipseProductionClasspath' }.configureEach { + dependsOn verifyEclipseClasspathMerging, verifyEclipseSynchronization +} + +// Apply after the Java/Eclipse plugins in Power, Steam or Electric. This gate +// compiles the generated Eclipse model, not Gradle's javac class outputs. +def ecjVersion = '3.40.0' +def ecjSha256 = '05cc22a24e7982970f63a405fc6c820bc80b806f27f3c5a6236fc475f8f7152b' +def ecjCompiler = configurations.create('eclipseEcjCompiler') { + canBeConsumed = false + canBeResolved = true + transitive = false +} +dependencies.add(ecjCompiler.name, "org.eclipse.jdt:ecj:${ecjVersion}") +def ecjJava = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(21) } + +tasks.register('verifyEclipseEcj') { + group = 'verification' + description = 'Compiles native production and all test-marked Eclipse sources with pinned Java 21 ECJ.' + dependsOn verifyEclipseClasspathMerging, verifyEclipseSynchronization + outputs.upToDateWhen { false } + doLast { + def fail = { String message -> throw new GradleException(message) } + def hash = { File input -> MessageDigest.getInstance('SHA-256').digest(input.bytes).encodeHex().toString() } + def attributes = { node -> + def values = [:] + node.attributes.attribute.each { + String key = it.@name.text() + if (values.containsKey(key)) fail('Duplicate Eclipse classpath attribute: ' + key) + values[key] = it.@value.text() + } + values + } + def xml = { File input, boolean compilerLog = false -> + def parser = new groovy.xml.XmlSlurper(false, false, compilerLog) + parser.setFeature('http://apache.org/xml/features/disallow-doctype-decl', !compilerLog) + parser.setFeature('http://xml.org/sax/features/external-general-entities', false) + parser.setFeature('http://xml.org/sax/features/external-parameter-entities', false) + parser.setFeature('http://apache.org/xml/features/nonvalidating/load-external-dtd', false) + parser.setEntityResolver({ String publicId, String systemId -> + new org.xml.sax.InputSource(new StringReader('')) + } as org.xml.sax.EntityResolver) + parser.parse(input) + } + def resolve = { String path -> file(path).canonicalFile } + String runId = providers.gradleProperty('eclipseEcjRunId').getOrElse( + new Date().format('yyyyMMdd-HHmmss') + '-' + UUID.randomUUID().toString()) + if (!(runId ==~ /[A-Za-z0-9_-]+/)) fail('Unsafe eclipseEcjRunId') + File reports = layout.buildDirectory.dir('ecj-reports/' + runId).get().asFile.canonicalFile + File production = layout.buildDirectory.dir('ecj-production/' + runId).get().asFile.canonicalFile + File tests = layout.buildDirectory.dir('ecj-test/' + runId).get().asFile.canonicalFile + [reports, production, tests].each { + if (!it.toPath().startsWith(layout.buildDirectory.get().asFile.canonicalFile.toPath()) || it.exists()) { + fail('Use fresh, contained ECJ outputs; retain prior evidence: ' + it) + } + Files.createDirectories(it.toPath()) + } + File classpathFile = file('.classpath') + def report = [status: 'RUNNING', project: projectDir.canonicalPath, + scope: 'ECJ compilation only; no Minecraft launch or JUnit execution', + compiler: [coordinate: "org.eclipse.jdt:ecj:${ecjVersion}", sha256: ecjSha256], + compilations: [:], controls: [:], inputs: [:]] + try { + File compiler = ecjCompiler.singleFile + if (hash(compiler) != ecjSha256) fail('ECJ compiler SHA-256 mismatch') + def launcher = ecjJava.get() + File java = launcher.executablePath.asFile + if (launcher.metadata.languageVersion.asInt() != 21) fail('ECJ requires an actual Java 21 launcher') + report.java = [home: launcher.metadata.installationPath.asFile.canonicalPath, sha256: hash(java)] + if (!classpathFile.isFile()) fail('Generate the resolved Eclipse .classpath first') + def model = xml(classpathFile) + def entries = model.classpathentry.toList() + assertUniqueEclipseEntries(entries.collect { [kind: it.@kind.text(), path: it.@path.text()] }) + def containers = entries.findAll { it.@kind.text() == 'con' } + def jres = containers.findAll { it.@path.text().startsWith('org.eclipse.jdt.launching.JRE_CONTAINER/') } + def buildship = containers.findAll { it.@path.text() == 'org.eclipse.buildship.core.gradleclasspathcontainer' } + if (jres.size() != 1 || !jres[0].@path.text().contains('/JavaSE-21/') + || containers.size() != jres.size() + buildship.size() || buildship.size() > 1) + fail('Eclipse must select Java 21 and no unknown classpath containers') + // Buildship may retain its marker after a refresh. ECJ still uses the + // explicit, existence-checked library entries below, not that marker. + if (entries.any { !(it.@kind.text() in ['src', 'lib', 'con', 'output']) }) { + fail('Unresolved Eclipse project/variable/container entry; do not flatten it silently') + } + def roots = entries.findAll { it.@kind.text() == 'src' }.collect { node -> + def attrs = attributes(node) + boolean test = attrs.test == 'true' + if (attrs.gradle_scope && attrs.gradle_scope != 'main' && !test) fail('Test source root lacks the Eclipse test flag: ' + node.@path) + File root = resolve(node.@path.text()) + if (!root.toPath().startsWith(projectDir.canonicalFile.toPath()) || !root.isDirectory()) fail('Missing/external Eclipse source root: ' + root) + String output = node.@output.text() ?: entries.find { it.@kind.text() == 'output' }?.@path?.text() + if (!output) fail('Eclipse source root lacks an output: ' + root) + def tree = fileTree(root) + if (node.@including.text()) tree.include(node.@including.text().split(/\|/).toList()) + if (node.@excluding.text()) tree.exclude(node.@excluding.text().split(/\|/).toList()) + [root: root, output: resolve(output), test: test, + sources: tree.files.findAll { it.name.endsWith('.java') }.sort { it.canonicalPath }] + } + def mainOutputs = roots.findAll { !it.test }.collect { it.output }.toSet() + if (roots.any { it.test && mainOutputs.contains(it.output) }) fail('Eclipse production/test outputs overlap') + def blocked = roots.collect { it.output } + blocked.addAll(entries.findAll { it.@kind.text() == 'output' }.collect { resolve(it.@path.text()) }) + sourceSets.each { blocked.addAll(it.output.files.collect { output -> output.canonicalFile }) } + blocked.addAll([production, tests]) + def libraries = entries.findAll { it.@kind.text() == 'lib' }.collect { node -> + File library = resolve(node.@path.text()) + if (!library.isFile() || !library.name.endsWith('.jar')) fail('Missing/non-archive Eclipse library: ' + library) + if (blocked.any { library.toPath().startsWith(it.toPath()) }) fail('Existing IDE/javac output on ECJ classpath: ' + library) + def attrs = attributes(node) + def scopes = (attrs.gradle_used_by_scope ?: '').tokenize(',') + boolean test = attrs.test == 'true' || (scopes && !scopes.contains('main')) + if (attrs.test == 'true' && scopes.contains('main')) fail('Test-only library marked as a production dependency: ' + library) + if (attrs.module == 'true' || !node.accessrules.accessrule.isEmpty()) fail('Explicit Eclipse module/access rules require a dedicated adapter: ' + library) + new JarFile(library).withCloseable { jar -> + if (jar.manifest?.mainAttributes?.getValue('Class-Path')?.trim()) fail('Hidden manifest Class-Path is forbidden: ' + library) + String ownPackage = 'zone/moddev/mc/' + project.property('mod_id') + '/' + if (jar.entries().any { it.name.startsWith(ownPackage) && it.name.endsWith('.class') }) fail('Own compiled mod cannot satisfy its ECJ compilation: ' + library) + if (jar.getEntry('net/minecraftforge/common/MinecraftForge.class')) fail('Legacy Forge APIs on native Eclipse classpath: ' + library) + } + [file: library, test: test] + } + if (!libraries.any { it.file.name == 'neoforge-' + project.neo_version + '.jar' }) fail('Pinned native NeoForge development jar missing') + def mainSources = roots.findAll { !it.test }.collectMany { it.sources }.unique().sort { it.canonicalPath } + def testSources = roots.findAll { it.test }.collectMany { it.sources }.unique().sort { it.canonicalPath } + if (!mainSources || !testSources) fail('Both production and test Eclipse source inventories must be nonempty') + if ((mainSources + testSources).any { it.name == 'module-info.java' }) fail('Named source modules require a module-path adapter, not classpath compilation') + if (mainSources.intersect(testSources)) fail('A Java source belongs to both production and tests') + def mainLibraries = libraries.findAll { !it.test }.collect { it.file } + def testLibraries = libraries.collect { it.file } + def inputs = ([classpathFile] + libraries.collect { it.file } + mainSources + testSources).unique() + inputs.each { report.inputs[it.canonicalPath] = hash(it) } + report.eclipse = [sha256: hash(classpathFile), sourceRoots: roots.collect { + [path: it.root.canonicalPath, test: it.test, ideOutput: it.output.canonicalPath, sources: it.sources.size()] }, + productionLibraries: mainLibraries.collect { it.canonicalPath }, testLibraries: testLibraries.collect { it.canonicalPath }] + File emptySources = new File(reports, 'empty-sourcepath') + emptySources.mkdirs() + def quote = { Object value -> + String text = value.toString().replace('\\', '/') + if (text.contains('"') || text.contains('\n') || text.contains('\r') || text.contains('[') || text.contains(']')) fail('Unsafe ECJ argument: ' + text) + '"' + text + '"' + } + def compile = { String name, List sources, List cp, File destination, String rejectedType -> + destination.mkdirs() + File argsFile = new File(reports, name + '.args') + File diagnostics = new File(reports, name + '.xml') + def arguments = ['--release', '21', '-proc:none', '-encoding', 'UTF-8', '-err:+forbidden,discouraged', + '-sourcepath', emptySources.canonicalPath, '-classpath', cp.collect { it.canonicalPath }.join(File.pathSeparator), + '-d', destination.canonicalPath, '-log', diagnostics.canonicalPath] + sources.collect { it.canonicalPath } + argsFile.setText(arguments.collect(quote).join('\n') + '\n', 'UTF-8') + def execution = providers.exec { + commandLine java.absolutePath, '-Xmx2G', '-jar', compiler.absolutePath, '@' + argsFile.absolutePath + ignoreExitValue = true + } + int code = execution.result.get().exitValue + String stdout = execution.standardOutput.asText.get() + String stderr = execution.standardError.asText.get() + new File(reports, name + '.stdout.log').setText(stdout, 'UTF-8') + new File(reports, name + '.stderr.log').setText(stderr, 'UTF-8') + if (!diagnostics.isFile()) fail('ECJ did not emit XML diagnostics: ' + name) + def problems = xml(diagnostics, true).depthFirst().findAll { it.@severity.text() } + int errors = problems.count { it.@severity.text().equalsIgnoreCase('ERROR') } + int warnings = problems.count { it.@severity.text().equalsIgnoreCase('WARNING') } + def result = [exitCode: code, errors: errors, warnings: warnings, sources: sources.size(), + argumentsSha256: hash(argsFile), output: destination.canonicalPath] + if (rejectedType != null) { + result.rejected = code != 0 && errors > 0 && (stdout + stderr).contains(rejectedType) + report.controls[name] = result + if (!result.rejected) fail('ECJ negative control did not reject its intended type: ' + name) + } else { + report.compilations[name] = result + if (code != 0 || errors != 0) fail('ECJ compilation failed: ' + name + '; inspect ' + reports) + def classes = fileTree(destination).matching { include '**/*.class' }.files + if (!classes) fail('ECJ emitted no classes: ' + name) + classes.each { + byte[] bytes = it.bytes + if (bytes.length < 8 || (bytes[0] & 255) != 202 || (bytes[1] & 255) != 254 + || (bytes[2] & 255) != 186 || (bytes[3] & 255) != 190 + || (((bytes[6] & 255) << 8) | (bytes[7] & 255)) != 65) fail('Invalid/non-Java-21 ECJ class: ' + it) + } + result.classes = classes.size() + } + } + File controls = new File(reports, 'control-sources/eclipse/ecj/control') + controls.mkdirs() + File marker = new File(controls, 'TestOnlyMarker.java') + marker.setText('package eclipse.ecj.control; public final class TestOnlyMarker {}\n', 'UTF-8') + compile('production', mainSources, mainLibraries, new File(production, 'classes'), null) + compile('test', testSources + [marker], [new File(production, 'classes')] + testLibraries, new File(tests, 'classes'), null) + report.compilations.test.controlSources = 1 + [ + 'test-output-leak': ['MainMustNotSeeTestOutput', 'eclipse.ecj.control.TestOnlyMarker', 'TestOnlyMarker'], + 'junit-leak': ['MainMustNotUseJUnit', 'org.junit.Test', 'org.junit'], + 'restricted-jdk': ['MainMustNotUseInternalJdk', 'sun.security.x509.X500Name', 'X500Name'] + ].each { name, spec -> + File source = new File(controls, spec[0] + '.java') + source.setText('public class ' + spec[0] + ' { ' + spec[1] + ' value; }\n', 'UTF-8') + compile(name, [source], mainLibraries, new File(reports, name + '-classes'), spec[2]) + } + report.inputs.each { path, before -> if (hash(new File(path)) != before) fail('ECJ input changed during compilation: ' + path) } + report.status = 'PASS' + logger.lifecycle('ECJ PASS: {} production sources, {} test sources, 3 isolation/module controls. Evidence: {}', mainSources.size(), testSources.size(), reports) + } catch (Exception failure) { + report.status = 'FAIL' + report.error = failure.toString() + throw failure + } finally { + new File(reports, 'report.json').setText(JsonOutput.prettyPrint(JsonOutput.toJson(report)) + '\n', 'UTF-8') + } + } +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 0d4a9516871afd710a9d84d89e31ba77745607bd..5097068a8d375f5bf0d15693fb5b3615c972a801 100644 GIT binary patch literal 47623 zcma&OV|b<8x-FWDF=CC_wpmHVwr$(CZKGl*m84=-Y}*5VkOc=LR^1>+<7vNb*sQ{hqyB|kZ#=V4>|F3hs? zP;VhzX-omhd6H-SJNS%RA+u&zrGQ;ES{A*xVl&f{_S#`bWT!pFHE3ZC`8(W+aEMlg zq;;HOp(Mr){BX1B`uPB2@BEcOpH~U4)&hK~Cze-$9CY4c022e#Q0Y? zzx9(=iiSZEOmrk;;SEI4_)JJm2&{mvoApSQ1z-Gm6aq;~}O64+-CXaV47C?23TlF z!&XQ|_waWAathP1fPns`Q|lZTf_DIm;!EoR?L2#}77P{i$wIEErkzT4Rmj2JQYP&? zR8RX2d>fXh+nAz!$|IUHAki8_tB4VppUuEjD4U7HIvb^v7V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GAhZ*Z%`+-T+_# diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2c68b418..1eca32e7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,10 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip -distributionSha256Sum=9c0f7faeeb306cb14e4279a3e084ca6b596894089a0638e68a07c945a32c9e14 +distributionSha256Sum=bafd5ce9cfaea0fbccfdc8439a1ac42fbd4cd9c89dc9a988228d8a2639a58e6c +distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.0-bin.zip +networkTimeout=10000 +retries=0 +retryBackOffMs=500 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index cccdd3d5..249efbb0 100755 --- a/gradlew +++ b/gradlew @@ -1,78 +1,128 @@ -#!/usr/bin/env sh +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# gradlew start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh gradlew +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -81,92 +131,118 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" fi +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index f9553162..3185a43f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,84 +1,112 @@ -@if "%DEBUG%" == "" @echo off +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem -@rem Gradle startup script for Windows +@rem gradlew startup script for Windows @rem @rem ########################################################################## -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions + +@rem Catch executions from older scripts and ensure they exit cleanly. +@rem This can be removed once we can be reasonably confident that few people +@rem will be migrating directly to this new wrapper. +goto afterSafetyNet +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +goto exitWithErrorLevel +:afterSafetyNet set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +1>&2 echo. +1>&2 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +1>&2 echo. +1>&2 echo Please set the JAVA_HOME variable in your environment to match the +1>&2 echo location of your Java installation. -goto fail +"%COMSPEC%" /c exit 1 +goto exitWithErrorLevel :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +1>&2 echo. +1>&2 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +1>&2 echo. +1>&2 echo Please set the JAVA_HOME variable in your environment to match the +1>&2 echo location of your Java installation. -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* +"%COMSPEC%" /c exit 1 +goto exitWithErrorLevel :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 -:mainEnd -if "%OS%"=="Windows_NT" endlocal +@rem Execute gradlew +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel & goto exitWithErrorLevel -:omega +@rem This label must not be changed. We rely on old scripts being able to jump to this point. +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/src/main/java/cyano/poweradvantage/api/FluidCategoryRegistry.java b/src/main/java/cyano/poweradvantage/api/FluidCategoryRegistry.java index 333fb963..c09c220e 100644 --- a/src/main/java/cyano/poweradvantage/api/FluidCategoryRegistry.java +++ b/src/main/java/cyano/poweradvantage/api/FluidCategoryRegistry.java @@ -1,5 +1,7 @@ package cyano.poweradvantage.api; +import net.minecraft.core.registries.BuiltInRegistries; + import java.util.Collections; import java.util.LinkedHashMap; import java.util.LinkedHashSet; @@ -46,7 +48,7 @@ public static synchronized boolean registerAlias(String category, String fluidNa /** Returns true when the fluid's registry name belongs to the category. */ public static synchronized boolean matches(String category, Fluid fluid) { if (fluid == null) return false; - ResourceLocation id = net.minecraftforge.registries.ForgeRegistries.FLUIDS.getKey(fluid); + ResourceLocation id = BuiltInRegistries.FLUID.getKey(fluid); return id != null && matches(category, id.toString()); } @@ -71,7 +73,7 @@ public static synchronized Set getAliases(String category) { /** Returns the currently registered fluids represented by a category. */ public static synchronized Set getRegisteredFluids(String category) { LinkedHashSet fluids = new LinkedHashSet<>(); - for (Fluid fluid : net.minecraftforge.registries.ForgeRegistries.FLUIDS) { + for (Fluid fluid : BuiltInRegistries.FLUID) { if (matches(category, fluid)) fluids.add(fluid); } return Collections.unmodifiableSet(fluids); diff --git a/src/main/java/cyano/poweradvantage/api/PoweredEntity.java b/src/main/java/cyano/poweradvantage/api/PoweredEntity.java index fd520078..7a2bc3b6 100644 --- a/src/main/java/cyano/poweradvantage/api/PoweredEntity.java +++ b/src/main/java/cyano/poweradvantage/api/PoweredEntity.java @@ -1,5 +1,7 @@ package cyano.poweradvantage.api; +import net.minecraft.core.registries.BuiltInRegistries; + import net.minecraft.core.HolderLookup; import zone.moddev.mc.basepower.conduitnetwork.ConduitRegistry; import net.minecraft.world.level.block.state.BlockState; @@ -32,27 +34,22 @@ public abstract class PoweredEntity extends BlockEntity implements IPowerMachine private final zone.moddev.mc.basepower.util.MachineCapabilities machineCapabilities = new zone.moddev.mc.basepower.util.MachineCapabilities(this); - @Override - public net.minecraftforge.common.util.LazyOptional getCapability( - net.minecraftforge.common.capabilities.Capability capability, net.minecraft.core.Direction face) { - if (!areCapabilitiesValid()) return net.minecraftforge.common.util.LazyOptional.empty(); - if (machineCapabilities == null) return super.getCapability(capability, face); - net.minecraftforge.common.util.LazyOptional local = machineCapabilities.get(capability, face); - return local.isPresent() ? local : super.getCapability(capability, face); + public final zone.moddev.mc.basepower.util.MachineCapabilities machineCapabilities() { + return machineCapabilities; } - @Override public void invalidateCaps() { - if (machineCapabilities != null) machineCapabilities.invalidate(); - super.invalidateCaps(); - } + public void invalidateCaps() { machineCapabilities.invalidate(); } + public void reviveCaps() { machineCapabilities.revive(); } + protected boolean areCapabilitiesValid() { return !isRemoved() && machineCapabilities.isValid(); } - @Override public void reviveCaps() { - super.reviveCaps(); - if (machineCapabilities != null) machineCapabilities.revive(); + @Override public void setRemoved() { + invalidateCaps(); + super.setRemoved(); } - protected boolean areCapabilitiesValid() { - return !isRemoved() && (machineCapabilities == null || machineCapabilities.isValid()); + @Override public void onChunkUnloaded() { + invalidateCaps(); + super.onChunkUnloaded(); } @Override public void clearRemoved() { diff --git a/src/main/java/cyano/poweradvantage/api/fluid/FluidStack.java b/src/main/java/cyano/poweradvantage/api/fluid/FluidStack.java index f24dc411..a68c6aeb 100644 --- a/src/main/java/cyano/poweradvantage/api/fluid/FluidStack.java +++ b/src/main/java/cyano/poweradvantage/api/fluid/FluidStack.java @@ -1,5 +1,7 @@ package cyano.poweradvantage.api.fluid; +import net.minecraft.core.registries.BuiltInRegistries; + import javax.annotation.Nullable; import net.minecraft.world.level.material.Fluid; @@ -37,7 +39,7 @@ public boolean isFluidEqual(@Nullable FluidStack other) { } public CompoundTag writeToNBT(CompoundTag nbt) { - ResourceLocation id = net.minecraftforge.registries.ForgeRegistries.FLUIDS.getKey(fluid); + ResourceLocation id = BuiltInRegistries.FLUID.getKey(fluid); if (id != null) nbt.putString("FluidName", id.toString()); nbt.putInt("Amount", amount); if (tag != null) nbt.put("Tag", tag.copy()); diff --git a/src/main/java/cyano/poweradvantage/api/fluid/InteractiveFluidBlock.java b/src/main/java/cyano/poweradvantage/api/fluid/InteractiveFluidBlock.java index 10225245..373dc678 100644 --- a/src/main/java/cyano/poweradvantage/api/fluid/InteractiveFluidBlock.java +++ b/src/main/java/cyano/poweradvantage/api/fluid/InteractiveFluidBlock.java @@ -26,7 +26,7 @@ public InteractiveFluidBlock(FlowingFluid fluid, Block.Properties properties, bo public InteractiveFluidBlock(Supplier fluid, Block.Properties properties, boolean flammable, BiConsumer immersionEffect) { - super(fluid, properties); + super(fluid.get(), properties); this.flammable = flammable; this.immersionEffect = immersionEffect; } diff --git a/src/main/java/cyano/poweradvantage/api/modsupport/Wrappers.java b/src/main/java/cyano/poweradvantage/api/modsupport/Wrappers.java index caec9623..421b5fa4 100644 --- a/src/main/java/cyano/poweradvantage/api/modsupport/Wrappers.java +++ b/src/main/java/cyano/poweradvantage/api/modsupport/Wrappers.java @@ -4,7 +4,7 @@ import cyano.poweradvantage.api.IPowerMachine; import cyano.poweradvantage.api.PowerConnectorContext; import cyano.poweradvantage.api.PowerRequest; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.energy.IEnergyStorage; /** Adapters between Forge Energy and the Advantage request network. */ public final class Wrappers { diff --git a/src/main/java/cyano/poweradvantage/api/modsupport/rf/TileEntityRFConverter.java b/src/main/java/cyano/poweradvantage/api/modsupport/rf/TileEntityRFConverter.java index 5c78bf6a..457eb4bf 100644 --- a/src/main/java/cyano/poweradvantage/api/modsupport/rf/TileEntityRFConverter.java +++ b/src/main/java/cyano/poweradvantage/api/modsupport/rf/TileEntityRFConverter.java @@ -8,17 +8,13 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.core.Direction; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.energy.IEnergyStorage; import zone.moddev.mc.basepower.PowerAdvantage; /** Forge Energy bridge retained behind the historical RF-labelled block IDs. */ public class TileEntityRFConverter extends TileEntityConverter implements IEnergyStorage { private final int forgeBufferSize; private final int halfBuffer; - private LazyOptional energyCapability = LazyOptional.of(() -> this); private int forgeBuffer; protected TileEntityRFConverter(BlockEntityType tileType, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, ConduitType type, @@ -35,7 +31,9 @@ public void tickUpdate(boolean server) { Direction side = Direction.values()[index]; BlockEntity neighbor = getLevel().getBlockEntity(getBlockPos().relative(side)); if (neighbor == null) return; - neighbor.getCapability(ForgeCapabilities.ENERGY, side.getOpposite()).ifPresent(storage -> { + IEnergyStorage storage = getLevel().getCapability(net.neoforged.neoforge.capabilities.Capabilities.EnergyStorage.BLOCK, + neighbor.getBlockPos(), side.getOpposite()); + if (storage != null) { int delta = forgeBuffer - halfBuffer; if (delta < 0 && storage.canExtract()) { int extracted = storage.extractEnergy(-delta, true); @@ -45,7 +43,7 @@ public void tickUpdate(boolean server) { int accepted = storage.receiveEnergy(delta, true); if (accepted > 0) storage.receiveEnergy(extractEnergy(accepted, false), false); } - }); + } } @Override public int receiveEnergy(int maxReceive, boolean simulate) { @@ -63,22 +61,6 @@ public void tickUpdate(boolean server) { @Override public boolean canExtract() { return true; } @Override public boolean canReceive() { return true; } - @Override - public LazyOptional getCapability(@Nonnull Capability capability, @Nullable Direction side) { - if (!areCapabilitiesValid()) return LazyOptional.empty(); - return energyCapability != null && capability == ForgeCapabilities.ENERGY ? energyCapability.cast() : super.getCapability(capability, side); - } - - @Override public void invalidateCaps() { - super.invalidateCaps(); - if (energyCapability != null) energyCapability.invalidate(); - } - - @Override public void reviveCaps() { - super.reviveCaps(); - if (energyCapability != null && !energyCapability.isPresent()) energyCapability = LazyOptional.of(() -> this); - } - @Override public double getOtherEnergy() { return forgeBuffer; } @Override public double getOtherEnergyCapacity() { return forgeBufferSize; } @Override public void setOtherEnergy(double value) { forgeBuffer = Math.max(0, Math.min(forgeBufferSize, (int) value)); } diff --git a/src/main/java/cyano/poweradvantage/api/simple/BlockSimpleFluidMachine.java b/src/main/java/cyano/poweradvantage/api/simple/BlockSimpleFluidMachine.java index 96333909..7e8c93d4 100644 --- a/src/main/java/cyano/poweradvantage/api/simple/BlockSimpleFluidMachine.java +++ b/src/main/java/cyano/poweradvantage/api/simple/BlockSimpleFluidMachine.java @@ -1,5 +1,7 @@ package cyano.poweradvantage.api.simple; +import net.minecraft.core.registries.BuiltInRegistries; + import zone.moddev.mc.basepower.init.Fluids; /** @@ -11,7 +13,7 @@ Block myMachineBlock = new MyBlockSimpleFluidSource(guiID,PowerAdvantage.getInstance()); myMachineBlock.setTranslationKey(MODID+"."+"my_machine"); myMachineBlock.setRegistryName(MODID, "my_machine"); -net.minecraftforge.fml.common.registry.ForgeRegistries.BLOCKS.register(myMachineBlock); +net.neoforged.fml.common.registry.BuiltInRegistries.BLOCK.register(myMachineBlock); * * @author DrCyano * diff --git a/src/main/java/cyano/poweradvantage/api/simple/BlockSimplePowerMachine.java b/src/main/java/cyano/poweradvantage/api/simple/BlockSimplePowerMachine.java index 73491499..29b91ab6 100644 --- a/src/main/java/cyano/poweradvantage/api/simple/BlockSimplePowerMachine.java +++ b/src/main/java/cyano/poweradvantage/api/simple/BlockSimplePowerMachine.java @@ -1,5 +1,7 @@ package cyano.poweradvantage.api.simple; +import net.minecraft.core.registries.BuiltInRegistries; + import cyano.poweradvantage.api.*; import zone.moddev.mc.basepower.conduitnetwork.ConduitRegistry; import net.minecraft.world.level.block.HorizontalDirectionalBlock; @@ -34,7 +36,7 @@ Block myMachineBlock = new MyBlockSimplePowerSource(guiID,PowerAdvantage.getInstance()); myMachineBlock.setTranslationKey(MODID+"."+"my_machine"); myMachineBlock.setRegistryName(MODID, "my_machine"); -net.minecraftforge.fml.common.registry.ForgeRegistries.BLOCKS.register(myMachineBlock); +net.neoforged.fml.common.registry.BuiltInRegistries.BLOCK.register(myMachineBlock); * * @author DrCyano * diff --git a/src/main/java/cyano/poweradvantage/api/simple/SimpleMachineGUI.java b/src/main/java/cyano/poweradvantage/api/simple/SimpleMachineGUI.java index 1f8d8174..fccf91cc 100644 --- a/src/main/java/cyano/poweradvantage/api/simple/SimpleMachineGUI.java +++ b/src/main/java/cyano/poweradvantage/api/simple/SimpleMachineGUI.java @@ -13,8 +13,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.network.chat.Component; diff --git a/src/main/java/zone/moddev/mc/basepower/PowerAdvantage.java b/src/main/java/zone/moddev/mc/basepower/PowerAdvantage.java index ed47dc11..5dc055a3 100644 --- a/src/main/java/zone/moddev/mc/basepower/PowerAdvantage.java +++ b/src/main/java/zone/moddev/mc/basepower/PowerAdvantage.java @@ -12,17 +12,16 @@ import cyano.poweradvantage.api.migration.LegacyConfigMigration.Mapping; import cyano.poweradvantage.api.migration.LegacyConfigMigration.ValueType; import cyano.poweradvantage.api.migration.LegacyOreSpawnConfigBridge; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.DistExecutor; - -import net.minecraftforge.fml.ModList; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.config.ModConfig; -import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import net.minecraftforge.fml.loading.FMLPaths; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.neoforge.common.NeoForge; + +import net.neoforged.fml.ModList; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.common.Mod; +import net.neoforged.fml.config.ModConfig; +import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.loading.FMLPaths; import zone.moddev.mc.basepower.config.PowerAdvantageConfig; import zone.moddev.mc.basepower.conduitnetwork.ConduitRegistry; import zone.moddev.mc.basepower.init.Fluids; @@ -42,7 +41,7 @@ public final class PowerAdvantage { public static final String MODID = "basepower"; public static final String NAME = "basePower"; - public static final String VERSION = "2.4.14.121011"; + public static final String VERSION = "2.4.19.121012"; public static final Logger LOGGER = LogManager.getLogger(MODID); private static PowerAdvantage instance; @@ -71,19 +70,20 @@ public final class PowerAdvantage { /** Retained for source compatibility; the labelled converter now uses Forge Energy. */ @Deprecated public static boolean detectedTechReborn = true; - public PowerAdvantage(FMLJavaModLoadingContext context) { + public PowerAdvantage(IEventBus modBus, ModContainer context) { instance = this; - IEventBus modBus = context.getModEventBus(); AdvantageLegacyMigrations.registerPowerAdvantage(); - zone.moddev.mc.basepower.migration.VanillaRegistryRemaps.register(); - MinecraftForge.EVENT_BUS.addListener(ConduitRegistry.getInstance()::onChunkLoad); - MinecraftForge.EVENT_BUS.addListener(ConduitRegistry.getInstance()::onChunkUnload); - MinecraftForge.EVENT_BUS.addListener(RecipeDiscovery::onPlayerLogin); - MinecraftForge.EVENT_BUS.addListener(zone.moddev.mc.basepower.init.Villages::onTrades); + modBus.addListener(net.neoforged.bus.api.EventPriority.LOWEST, + zone.moddev.mc.basepower.migration.VanillaRegistryRemaps::registerAliases); + NeoForge.EVENT_BUS.addListener(ConduitRegistry.getInstance()::onChunkLoad); + NeoForge.EVENT_BUS.addListener(ConduitRegistry.getInstance()::onChunkUnload); + NeoForge.EVENT_BUS.addListener(RecipeDiscovery::onPlayerLogin); + NeoForge.EVENT_BUS.addListener(zone.moddev.mc.basepower.init.Villages::onTrades); modBus.addListener( zone.moddev.mc.basepower.recipe.MaterialTags::registerPack); modBus.addListener(MachineGUIRegistry::registerTypes); + modBus.addListener(zone.moddev.mc.basepower.util.MachineCapabilities::register); Fluids.init(); ItemGroups.register(modBus); @@ -96,14 +96,9 @@ public PowerAdvantage(FMLJavaModLoadingContext context) { modBus.addListener(PowerAdvantageConfig::onConfigLoading); modBus.addListener(this::commonSetup); - DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> { - modBus.addListener( - (net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent event) -> - event.enqueueWork(() -> { - MachineGUIRegistry.registerScreens(); - zone.moddev.mc.basepower.client.ClientOilRenderer.configureRenderLayers(); - })); - }); + if (net.neoforged.fml.loading.FMLEnvironment.dist == Dist.CLIENT) { + zone.moddev.mc.basepower.client.ClientRegistration.register(modBus); + } } private static void migrateLegacyOreSpawnConfiguration() { diff --git a/src/main/java/zone/moddev/mc/basepower/blocks/BlockFrame.java b/src/main/java/zone/moddev/mc/basepower/blocks/BlockFrame.java index a75471ad..3baf40ab 100644 --- a/src/main/java/zone/moddev/mc/basepower/blocks/BlockFrame.java +++ b/src/main/java/zone/moddev/mc/basepower/blocks/BlockFrame.java @@ -7,8 +7,8 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; /** * This class is for blocks that should act like glass (renderring-wise), but can be harvested diff --git a/src/main/java/zone/moddev/mc/basepower/client/ClientOilRenderer.java b/src/main/java/zone/moddev/mc/basepower/client/ClientOilRenderer.java index 8726aa33..05276aa3 100644 --- a/src/main/java/zone/moddev/mc/basepower/client/ClientOilRenderer.java +++ b/src/main/java/zone/moddev/mc/basepower/client/ClientOilRenderer.java @@ -2,8 +2,8 @@ import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.ItemBlockRenderTypes; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; /** Configure the translucent render layer for the registered oils. */ @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/zone/moddev/mc/basepower/client/ClientRegistration.java b/src/main/java/zone/moddev/mc/basepower/client/ClientRegistration.java new file mode 100644 index 00000000..110bafae --- /dev/null +++ b/src/main/java/zone/moddev/mc/basepower/client/ClientRegistration.java @@ -0,0 +1,15 @@ +package zone.moddev.mc.basepower.client; + +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; +import zone.moddev.mc.basepower.registry.MachineGUIRegistry; + +/** Loaded only on the physical client. */ +public final class ClientRegistration { + private ClientRegistration() { } + + public static void register(IEventBus bus) { + bus.addListener(MachineGUIRegistry::registerScreens); + bus.addListener((FMLClientSetupEvent event) -> event.enqueueWork(ClientOilRenderer::configureRenderLayers)); + } +} diff --git a/src/main/java/zone/moddev/mc/basepower/compat/BaseMetalsCompat.java b/src/main/java/zone/moddev/mc/basepower/compat/BaseMetalsCompat.java index 07cfa88c..f431d247 100644 --- a/src/main/java/zone/moddev/mc/basepower/compat/BaseMetalsCompat.java +++ b/src/main/java/zone/moddev/mc/basepower/compat/BaseMetalsCompat.java @@ -1,11 +1,13 @@ package zone.moddev.mc.basepower.compat; +import net.minecraft.core.registries.BuiltInRegistries; + import net.minecraft.world.level.block.Block; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.fml.ModList; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.fml.ModList; +import net.minecraft.core.registries.Registries; import zone.moddev.mc.basepower.PowerAdvantage; /** @@ -26,11 +28,11 @@ public static void addCrusherRecipe(String inputTag, ItemStack output) { } public static void addCrusherRecipe(Block input, ItemStack output) { - PowerAdvantage.LOGGER.debug("Crushing recipe for {} is supplied as data", net.minecraftforge.registries.ForgeRegistries.BLOCKS.getKey(input)); + PowerAdvantage.LOGGER.debug("Crushing recipe for {} is supplied as data", BuiltInRegistries.BLOCK.getKey(input)); } public static ItemStack getSteelPlate() { - Item item = ForgeRegistries.ITEMS.getValue(ResourceLocation.fromNamespaceAndPath("basemetals", "steel_plate")); + Item item = zone.moddev.mc.basepower.util.RegistryValues.find(BuiltInRegistries.ITEM, ResourceLocation.fromNamespaceAndPath("basemetals", "steel_plate")); return item == null ? null : new ItemStack(item); } diff --git a/src/main/java/zone/moddev/mc/basepower/compat/CrushingRecipes.java b/src/main/java/zone/moddev/mc/basepower/compat/CrushingRecipes.java new file mode 100644 index 00000000..0ccae732 --- /dev/null +++ b/src/main/java/zone/moddev/mc/basepower/compat/CrushingRecipes.java @@ -0,0 +1,24 @@ +package zone.moddev.mc.basepower.compat; + +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.SingleRecipeInput; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; +import zone.moddev.mc.lib.common.recipes.CrushingRecipe; + +/** Shared, reload-aware lookup for MMDLib recipes; processing remains machine-owned. */ +public final class CrushingRecipes { + private CrushingRecipes() { } + + public static ItemStack find(Level level, ItemStack stack) { + if (level == null || level.isClientSide || stack == null || stack.isEmpty()) return null; + SingleRecipeInput input = new SingleRecipeInput(stack.copyWithCount(1)); + return level.getRecipeManager().getRecipeFor(CrushingRecipe.TYPE.get(), input, level) + .map(holder -> holder.value().assemble(input, level.registryAccess())) + .filter(result -> !result.isEmpty()).map(ItemStack::copy).orElse(null); + } + + public static ItemStack find(Level level, BlockState state) { + return state == null ? null : find(level, new ItemStack(state.getBlock())); + } +} diff --git a/src/main/java/zone/moddev/mc/basepower/conduitnetwork/ConduitRegistry.java b/src/main/java/zone/moddev/mc/basepower/conduitnetwork/ConduitRegistry.java index de835f2c..19de8e3a 100644 --- a/src/main/java/zone/moddev/mc/basepower/conduitnetwork/ConduitRegistry.java +++ b/src/main/java/zone/moddev/mc/basepower/conduitnetwork/ConduitRegistry.java @@ -15,10 +15,9 @@ import net.minecraft.core.Direction; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.event.level.ChunkEvent; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.energy.IEnergyStorage; +import net.neoforged.neoforge.event.level.ChunkEvent; import java.util.*; import java.util.concurrent.locks.Lock; @@ -130,10 +129,10 @@ private List collectRequests(Level w, List net, Condui } } else if (e != null && PowerAdvantage.forgeEnergyConversionTable.containsKey(conduitType)) { for (Direction side : Direction.values()) { - LazyOptional capability = e.getCapability(ForgeCapabilities.ENERGY, side); - if (!capability.isPresent()) continue; - capability.ifPresent(storage -> requests.add(Wrappers.wrapForgeEnergyRequest(storage, - energyType, PowerAdvantage.forgeEnergyConversionTable.get(conduitType)))); + IEnergyStorage storage = w.getCapability(Capabilities.EnergyStorage.BLOCK, e.getBlockPos(), side); + if (storage == null) continue; + requests.add(Wrappers.wrapForgeEnergyRequest(storage, + energyType, PowerAdvantage.forgeEnergyConversionTable.get(conduitType))); break; } } diff --git a/src/main/java/zone/moddev/mc/basepower/config/PowerAdvantageConfig.java b/src/main/java/zone/moddev/mc/basepower/config/PowerAdvantageConfig.java index a7a0981d..6d314a2c 100644 --- a/src/main/java/zone/moddev/mc/basepower/config/PowerAdvantageConfig.java +++ b/src/main/java/zone/moddev/mc/basepower/config/PowerAdvantageConfig.java @@ -3,8 +3,8 @@ import java.util.Arrays; import java.util.Locale; -import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.fml.config.ModConfig; +import net.neoforged.neoforge.common.ModConfigSpec; +import net.neoforged.fml.config.ModConfig; import cyano.poweradvantage.api.FluidCategoryRegistry; import zone.moddev.mc.basepower.PowerAdvantage; import zone.moddev.mc.basepower.RecipeMode; @@ -13,20 +13,20 @@ public final class PowerAdvantageConfig { private static final String DEFAULT_DISTILLATION = "2*crude_oil->1*refined_oil"; - public static final ForgeConfigSpec SPEC; - public static final ForgeConfigSpec.ConfigValue RECIPE_MODE; - public static final ForgeConfigSpec.DoubleValue CHEST_LOOT_FACTOR; - public static final ForgeConfigSpec.BooleanValue PLASTIC_IS_RUBBER; - public static final ForgeConfigSpec.BooleanValue USE_OTHER_FLUIDS; - public static final ForgeConfigSpec.ConfigValue DISTILLER_RECIPES; - public static final ForgeConfigSpec.ConfigValue ADDITIONAL_CRUDE_OIL_ALIASES; - public static final ForgeConfigSpec.ConfigValue RF_CONVERSIONS; - public static final ForgeConfigSpec.ConfigValue TECH_REBORN_CONVERSIONS; + public static final ModConfigSpec SPEC; + public static final ModConfigSpec.ConfigValue RECIPE_MODE; + public static final ModConfigSpec.DoubleValue CHEST_LOOT_FACTOR; + public static final ModConfigSpec.BooleanValue PLASTIC_IS_RUBBER; + public static final ModConfigSpec.BooleanValue USE_OTHER_FLUIDS; + public static final ModConfigSpec.ConfigValue DISTILLER_RECIPES; + public static final ModConfigSpec.ConfigValue ADDITIONAL_CRUDE_OIL_ALIASES; + public static final ModConfigSpec.ConfigValue RF_CONVERSIONS; + public static final ModConfigSpec.ConfigValue TECH_REBORN_CONVERSIONS; private static boolean loaded; static { - ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder(); + ModConfigSpec.Builder builder = new ModConfigSpec.Builder(); builder.push("options"); RECIPE_MODE = builder.comment("NORMAL, TECH_PROGRESSION, or APOCALYPTIC. Restart after changing.") .worldRestart().define("recipeMode", "NORMAL"); @@ -55,7 +55,7 @@ public final class PowerAdvantageConfig { private PowerAdvantageConfig() {} - public static void onConfigLoading(net.minecraftforge.fml.event.config.ModConfigEvent.Loading event) { + public static void onConfigLoading(net.neoforged.fml.event.config.ModConfigEvent.Loading event) { if (event.getConfig().getSpec() != SPEC) return; loaded = true; apply(); diff --git a/src/main/java/zone/moddev/mc/basepower/gui/FilteredFluidTankGUI.java b/src/main/java/zone/moddev/mc/basepower/gui/FilteredFluidTankGUI.java index 077b1b25..e257bbff 100644 --- a/src/main/java/zone/moddev/mc/basepower/gui/FilteredFluidTankGUI.java +++ b/src/main/java/zone/moddev/mc/basepower/gui/FilteredFluidTankGUI.java @@ -1,7 +1,7 @@ package zone.moddev.mc.basepower.gui; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import cyano.poweradvantage.api.fluid.FluidPoweredEntity; import cyano.poweradvantage.api.simple.SimpleMachineGUI; diff --git a/src/main/java/zone/moddev/mc/basepower/gui/FluidTankGUI.java b/src/main/java/zone/moddev/mc/basepower/gui/FluidTankGUI.java index 76ce8027..20e7951e 100644 --- a/src/main/java/zone/moddev/mc/basepower/gui/FluidTankGUI.java +++ b/src/main/java/zone/moddev/mc/basepower/gui/FluidTankGUI.java @@ -12,8 +12,8 @@ import com.mojang.blaze3d.vertex.DefaultVertexFormat; import net.minecraft.resources.ResourceLocation; import net.minecraft.client.renderer.BiomeColors; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import cyano.poweradvantage.api.fluid.FluidStack; @@ -67,7 +67,7 @@ public static void drawFluidFilledRectangle( if (fs == null || fs.getFluid() == null || width <= 0 || height <= 0) return; // The atlas supplies the current animation frame; water's sprite is grayscale. var fluidStack = zone.moddev.mc.basepower.util.ForgeFluidAdapter.toForge(fs); - var rendering = net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions.of(fs.getFluid()); + var rendering = net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions.of(fs.getFluid()); var stillTexture = rendering.getStillTexture(fluidStack); if (stillTexture == null) return; TextureAtlasSprite sprite = guiContainer.getMinecraft().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS) diff --git a/src/main/java/zone/moddev/mc/basepower/gui/StillGUI.java b/src/main/java/zone/moddev/mc/basepower/gui/StillGUI.java index 9e11f684..546928df 100644 --- a/src/main/java/zone/moddev/mc/basepower/gui/StillGUI.java +++ b/src/main/java/zone/moddev/mc/basepower/gui/StillGUI.java @@ -1,7 +1,7 @@ package zone.moddev.mc.basepower.gui; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import cyano.poweradvantage.api.simple.SimpleMachineGUI; import zone.moddev.mc.basepower.machines.fluidmachines.StillTileEntity; diff --git a/src/main/java/zone/moddev/mc/basepower/init/Blocks.java b/src/main/java/zone/moddev/mc/basepower/init/Blocks.java index 638ac2ea..2b11e3d5 100644 --- a/src/main/java/zone/moddev/mc/basepower/init/Blocks.java +++ b/src/main/java/zone/moddev/mc/basepower/init/Blocks.java @@ -17,10 +17,11 @@ import net.minecraft.world.item.BlockItem; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegisterEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.neoforged.neoforge.registries.RegisterEvent; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; import zone.moddev.mc.basepower.PowerAdvantage; import zone.moddev.mc.basepower.blocks.BlockFrame; import zone.moddev.mc.basepower.blocks.BlockPowerSwitch; @@ -44,7 +45,7 @@ import zone.moddev.mc.basepower.machines.fluidmachines.modsupport.TerminalFluidPipeBlock; /** Stable block and block-item registry for the 1.13 port. */ -@Mod.EventBusSubscriber(modid = PowerAdvantage.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) +@net.neoforged.fml.common.EventBusSubscriber(modid = PowerAdvantage.MODID, bus = net.neoforged.fml.common.EventBusSubscriber.Bus.MOD) public final class Blocks { private static final float STEEL_BLAST_RESISTANCE = 37.5f; private static final Map ALL_BLOCKS = new LinkedHashMap<>(); @@ -135,17 +136,17 @@ public static Block add(Block block, String id) { @SubscribeEvent public static void registerBlocks(RegisterEvent event) { - if (!ForgeRegistries.Keys.BLOCKS.equals(event.getRegistryKey())) return; + if (!Registries.BLOCK.equals(event.getRegistryKey())) return; init(); - event.register(ForgeRegistries.Keys.BLOCKS, helper -> ALL_BLOCKS.forEach((id, block) -> + event.register(Registries.BLOCK, helper -> ALL_BLOCKS.forEach((id, block) -> helper.register(ResourceLocation.fromNamespaceAndPath(PowerAdvantage.MODID, id), block))); } @SubscribeEvent public static void registerBlockItems(RegisterEvent event) { - if (!ForgeRegistries.Keys.ITEMS.equals(event.getRegistryKey())) return; + if (!Registries.ITEM.equals(event.getRegistryKey())) return; init(); - event.register(ForgeRegistries.Keys.ITEMS, helper -> ALL_BLOCKS.forEach((id, block) -> { + event.register(Registries.ITEM, helper -> ALL_BLOCKS.forEach((id, block) -> { BlockItem item = new BlockItem(block, new Item.Properties()); if (!"fluid_pipe_terminal".equals(id) && !(block instanceof LiquidBlock)) { ItemGroups.show(item); diff --git a/src/main/java/zone/moddev/mc/basepower/init/Entities.java b/src/main/java/zone/moddev/mc/basepower/init/Entities.java index b284e167..496f5975 100644 --- a/src/main/java/zone/moddev/mc/basepower/init/Entities.java +++ b/src/main/java/zone/moddev/mc/basepower/init/Entities.java @@ -3,10 +3,11 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegisterEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.neoforged.neoforge.registries.RegisterEvent; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; import zone.moddev.mc.basepower.PowerAdvantage; import zone.moddev.mc.basepower.machines.conveyors.TileEntityBlockFilter; import zone.moddev.mc.basepower.machines.conveyors.TileEntityConveyor; @@ -30,7 +31,7 @@ import cyano.poweradvantage.api.modsupport.techreborn.TileEntityTRElectricityConverter; /** Stable tile identities with the native 1.14 valid-block lists. */ -@Mod.EventBusSubscriber(modid = PowerAdvantage.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) +@net.neoforged.fml.common.EventBusSubscriber(modid = PowerAdvantage.MODID, bus = net.neoforged.fml.common.EventBusSubscriber.Bus.MOD) public final class Entities { public static BlockEntityType PIPE_TERMINAL; public static BlockEntityType FLUID_DRAIN; @@ -57,7 +58,7 @@ private Entities() {} @SubscribeEvent public static void register(RegisterEvent event) { - if (!ForgeRegistries.Keys.BLOCK_ENTITY_TYPES.equals(event.getRegistryKey())) return; + if (!Registries.BLOCK_ENTITY_TYPE.equals(event.getRegistryKey())) return; PIPE_TERMINAL = register(event, "tileentity.pipe_terminal", TerminalFluidPipeTileEntity::new, Blocks.fluid_pipe_terminal); FLUID_DRAIN = register(event, "tileentity.fluid_drain", FluidDrainTileEntity::new, Blocks.fluid_drain); FLUID_DISCHARGE = register(event, "tileentity.fluid_discharge", FluidDischargeTileEntity::new, Blocks.fluid_discharge); @@ -85,7 +86,7 @@ private static BlockEntityType register( RegisterEvent event, String id, BlockEntityType.BlockEntitySupplier factory, net.minecraft.world.level.block.Block... validBlocks) { BlockEntityType type = BlockEntityType.Builder.of(factory, validBlocks).build(null); - event.register(ForgeRegistries.Keys.BLOCK_ENTITY_TYPES, ResourceLocation.fromNamespaceAndPath(PowerAdvantage.MODID, id), () -> type); + event.register(Registries.BLOCK_ENTITY_TYPE, ResourceLocation.fromNamespaceAndPath(PowerAdvantage.MODID, id), () -> type); return type; } } diff --git a/src/main/java/zone/moddev/mc/basepower/init/Fluids.java b/src/main/java/zone/moddev/mc/basepower/init/Fluids.java index 9a063ca1..f4dc3297 100644 --- a/src/main/java/zone/moddev/mc/basepower/init/Fluids.java +++ b/src/main/java/zone/moddev/mc/basepower/init/Fluids.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.init; +import net.minecraft.core.registries.BuiltInRegistries; + import java.util.IdentityHashMap; import java.util.Map; import java.util.function.Consumer; @@ -18,19 +20,19 @@ import net.minecraft.core.Registry; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelReader; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.ForgeFlowingFluid; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegisterEvent; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.BaseFlowingFluid; +import net.neoforged.fml.common.Mod; +import net.minecraft.core.registries.Registries; +import net.neoforged.neoforge.registries.RegisterEvent; import zone.moddev.mc.basepower.PowerAdvantage; /** Native Forge fluids and their persistent PowerAdvantage conduit identities. */ -@Mod.EventBusSubscriber(modid = PowerAdvantage.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) +@net.neoforged.fml.common.EventBusSubscriber(modid = PowerAdvantage.MODID, bus = net.neoforged.fml.common.EventBusSubscriber.Bus.MOD) public final class Fluids { public static final ConduitType fluidConduit_general = new ConduitType("fluid"); private static final Map FLUID_TYPES = new IdentityHashMap<>(); @@ -57,19 +59,19 @@ public static synchronized void init() { @SubscribeEvent public static void registerFluids(RegisterEvent event) { - if (ForgeRegistries.Keys.FLUID_TYPES.equals(event.getRegistryKey())) { + if (net.neoforged.neoforge.registries.NeoForgeRegistries.Keys.FLUID_TYPES.equals(event.getRegistryKey())) { crudeOilType = oilType("crude_oil", 850, 6000); refinedOilType = oilType("refined_oil", 720, 1000); - event.register(ForgeRegistries.Keys.FLUID_TYPES, id("crude_oil"), () -> crudeOilType); - event.register(ForgeRegistries.Keys.FLUID_TYPES, id("refined_oil"), () -> refinedOilType); + event.register(net.neoforged.neoforge.registries.NeoForgeRegistries.Keys.FLUID_TYPES, id("crude_oil"), () -> crudeOilType); + event.register(net.neoforged.neoforge.registries.NeoForgeRegistries.Keys.FLUID_TYPES, id("refined_oil"), () -> refinedOilType); } - if (!ForgeRegistries.Keys.FLUIDS.equals(event.getRegistryKey())) return; + if (!Registries.FLUID.equals(event.getRegistryKey())) return; prepareOilFluids(); - event.register(ForgeRegistries.Keys.FLUIDS, id("flowing_crude_oil"), () -> flowing_crude_oil); - event.register(ForgeRegistries.Keys.FLUIDS, id("crude_oil"), () -> crude_oil); - event.register(ForgeRegistries.Keys.FLUIDS, id("flowing_refined_oil"), () -> flowing_refined_oil); - event.register(ForgeRegistries.Keys.FLUIDS, id("refined_oil"), () -> refined_oil); + event.register(Registries.FLUID, id("flowing_crude_oil"), () -> flowing_crude_oil); + event.register(Registries.FLUID, id("crude_oil"), () -> crude_oil); + event.register(Registries.FLUID, id("flowing_refined_oil"), () -> flowing_refined_oil); + event.register(Registries.FLUID, id("refined_oil"), () -> refined_oil); registerNewFluid(crude_oil); registerNewFluid(flowing_crude_oil); registerNewFluid(refined_oil); @@ -101,7 +103,7 @@ private static FluidType oilType(String name, int density, int viscosity) { } public static ConduitType registerNewFluid(Fluid fluid) { - ResourceLocation id = ForgeRegistries.FLUIDS.getKey(fluid); + ResourceLocation id = BuiltInRegistries.FLUID.getKey(fluid); ConduitType type = new ConduitType(id == null ? "unknown_fluid" : id.toString()); FLUID_TYPES.put(fluid, type); return type; @@ -137,13 +139,13 @@ public static Fluid byName(String name) { private static Fluid registeredFluid(ResourceLocation id) { // Forge's defaulted fluid registry returns EMPTY, not null, for unknown names. // Do not let a missing basepower:water hide the legacy vanilla fallback. - return net.minecraftforge.registries.ForgeRegistries.FLUIDS.containsKey(id) - ? net.minecraftforge.registries.ForgeRegistries.FLUIDS.getValue(id) : null; + return BuiltInRegistries.FLUID.containsKey(id) + ? zone.moddev.mc.basepower.util.RegistryValues.find(BuiltInRegistries.FLUID, id) : null; } public enum Kind { CRUDE, REFINED } - public abstract static class PowerFluid extends ForgeFlowingFluid { + public abstract static class PowerFluid extends BaseFlowingFluid { private final Kind kind; protected PowerFluid(Kind kind) { @@ -152,8 +154,8 @@ protected PowerFluid(Kind kind) { } public Kind getKind() { return kind; } - private static ForgeFlowingFluid.Properties properties(Kind kind) { - return new ForgeFlowingFluid.Properties( + private static BaseFlowingFluid.Properties properties(Kind kind) { + return new BaseFlowingFluid.Properties( () -> kind == Kind.CRUDE ? crudeOilType : refinedOilType, () -> kind == Kind.CRUDE ? crude_oil : refined_oil, () -> kind == Kind.CRUDE ? flowing_crude_oil : flowing_refined_oil) diff --git a/src/main/java/zone/moddev/mc/basepower/init/ItemGroups.java b/src/main/java/zone/moddev/mc/basepower/init/ItemGroups.java index 74d52557..983cf23c 100644 --- a/src/main/java/zone/moddev/mc/basepower/init/ItemGroups.java +++ b/src/main/java/zone/moddev/mc/basepower/init/ItemGroups.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.init; +import net.minecraft.core.registries.BuiltInRegistries; + import java.util.Comparator; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -9,9 +11,9 @@ import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraft.world.item.BlockItem; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.minecraft.core.registries.Registries; import zone.moddev.mc.basepower.PowerAdvantage; public final class ItemGroups { @@ -27,7 +29,7 @@ public final class ItemGroups { .icon(() -> Items.sprocket.getDefaultInstance()) .displayItems((parameters, output) -> VISIBLE_ITEMS.stream() .sorted(Comparator.comparing(ItemGroups::category, String.CASE_INSENSITIVE_ORDER) - .thenComparing(ForgeRegistries.ITEMS::getKey)) + .thenComparing(BuiltInRegistries.ITEM::getKey)) .forEach(output::accept)) .build()); } @@ -47,7 +49,7 @@ public static void register(IEventBus bus) { private static String category(Item item) { StringBuilder sb = new StringBuilder(); - sb.append(ForgeRegistries.ITEMS.getKey(item).getNamespace()); + sb.append(BuiltInRegistries.ITEM.getKey(item).getNamespace()); if (item instanceof BlockItem) { if (((BlockItem) item).getBlock().defaultBlockState().hasBlockEntity()) { sb.append("A"); diff --git a/src/main/java/zone/moddev/mc/basepower/init/Items.java b/src/main/java/zone/moddev/mc/basepower/init/Items.java index 4ae8a609..c218ae1b 100644 --- a/src/main/java/zone/moddev/mc/basepower/init/Items.java +++ b/src/main/java/zone/moddev/mc/basepower/init/Items.java @@ -7,15 +7,16 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.BucketItem; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegisterEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.neoforged.neoforge.registries.RegisterEvent; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; import zone.moddev.mc.basepower.PowerAdvantage; import zone.moddev.mc.basepower.items.RotationTool; /** Stable item registry for PowerAdvantage 1.13. */ -@Mod.EventBusSubscriber(modid = PowerAdvantage.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) +@net.neoforged.fml.common.EventBusSubscriber(modid = PowerAdvantage.MODID, bus = net.neoforged.fml.common.EventBusSubscriber.Bus.MOD) public final class Items { public static Item starch; public static Item bioplastic_ingot; @@ -55,9 +56,9 @@ private static Item add(String id, Item item) { @SubscribeEvent public static void register(RegisterEvent event) { - if (!ForgeRegistries.Keys.ITEMS.equals(event.getRegistryKey())) return; + if (!Registries.ITEM.equals(event.getRegistryKey())) return; init(); - event.register(ForgeRegistries.Keys.ITEMS, helper -> allItems.forEach((id, item) -> + event.register(Registries.ITEM, helper -> allItems.forEach((id, item) -> helper.register(ResourceLocation.fromNamespaceAndPath(PowerAdvantage.MODID, id), ItemGroups.show(item)))); } diff --git a/src/main/java/zone/moddev/mc/basepower/init/Recipes.java b/src/main/java/zone/moddev/mc/basepower/init/Recipes.java index dc0e094a..69a57da0 100644 --- a/src/main/java/zone/moddev/mc/basepower/init/Recipes.java +++ b/src/main/java/zone/moddev/mc/basepower/init/Recipes.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.init; +import net.minecraft.core.registries.BuiltInRegistries; + import zone.moddev.mc.basepower.PowerAdvantage; import cyano.poweradvantage.api.FluidCategoryRegistry; import net.minecraft.world.level.material.Fluid; @@ -41,12 +43,12 @@ public static void initDistillationRecipes(String[] distillRecipes) { private static void initCrudeOilAliasDistillationRecipes() { Fluid refinedOil = Fluids.refined_oil; if (refinedOil == null) return; - ResourceLocation outputId = net.minecraftforge.registries.ForgeRegistries.FLUIDS.getKey(refinedOil); + ResourceLocation outputId = BuiltInRegistries.FLUID.getKey(refinedOil); if (outputId == null) return; for (Fluid input : FluidCategoryRegistry.getRegisteredFluids(FluidCategoryRegistry.CRUDE_OIL)) { if (DistillationRecipeRegistry.getInstance().getDistillationRecipeForFluid(input) != null) continue; - ResourceLocation inputId = net.minecraftforge.registries.ForgeRegistries.FLUIDS.getKey(input); + ResourceLocation inputId = BuiltInRegistries.FLUID.getKey(input); if (inputId != null) { DistillationRecipeRegistry.addDistillationRecipe(inputId.toString(), 2, outputId.toString(), 1); } diff --git a/src/main/java/zone/moddev/mc/basepower/init/Villages.java b/src/main/java/zone/moddev/mc/basepower/init/Villages.java index 499519f9..dffbf91c 100644 --- a/src/main/java/zone/moddev/mc/basepower/init/Villages.java +++ b/src/main/java/zone/moddev/mc/basepower/init/Villages.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.trading.MerchantOffer; import net.minecraft.world.item.trading.ItemCost; -import net.minecraftforge.event.village.VillagerTradesEvent; +import net.neoforged.neoforge.event.village.VillagerTradesEvent; /** The old farmer and toolsmith careers now have their own vanilla professions. */ public final class Villages { diff --git a/src/main/java/zone/moddev/mc/basepower/machines/conveyors/TileEntityConveyor.java b/src/main/java/zone/moddev/mc/basepower/machines/conveyors/TileEntityConveyor.java index 54eaa087..30344080 100644 --- a/src/main/java/zone/moddev/mc/basepower/machines/conveyors/TileEntityConveyor.java +++ b/src/main/java/zone/moddev/mc/basepower/machines/conveyors/TileEntityConveyor.java @@ -31,23 +31,22 @@ public class TileEntityConveyor extends BlockEntity implements WorldlyContainer, private final zone.moddev.mc.basepower.util.MachineCapabilities machineCapabilities = new zone.moddev.mc.basepower.util.MachineCapabilities(this); - @Override public net.minecraftforge.common.util.LazyOptional getCapability( - net.minecraftforge.common.capabilities.Capability capability, Direction face) { - if (isRemoved() || (machineCapabilities != null && !machineCapabilities.isValid())) - return net.minecraftforge.common.util.LazyOptional.empty(); - if (machineCapabilities == null) return super.getCapability(capability, face); - net.minecraftforge.common.util.LazyOptional local = machineCapabilities.get(capability, face); - return local.isPresent() ? local : super.getCapability(capability, face); + public final zone.moddev.mc.basepower.util.MachineCapabilities machineCapabilities() { + return machineCapabilities; } - @Override public void invalidateCaps() { - if (machineCapabilities != null) machineCapabilities.invalidate(); - super.invalidateCaps(); + public void invalidateCaps() { machineCapabilities.invalidate(); } + public void reviveCaps() { machineCapabilities.revive(); } + protected boolean areCapabilitiesValid() { return !isRemoved() && machineCapabilities.isValid(); } + + @Override public void setRemoved() { + invalidateCaps(); + super.setRemoved(); } - @Override public void reviveCaps() { - super.reviveCaps(); - if (machineCapabilities != null) machineCapabilities.revive(); + @Override public void onChunkUnloaded() { + invalidateCaps(); + super.onChunkUnloaded(); } @Override public void clearRemoved() { diff --git a/src/main/java/zone/moddev/mc/basepower/machines/conveyors/TileEntityOreFilter.java b/src/main/java/zone/moddev/mc/basepower/machines/conveyors/TileEntityOreFilter.java index 6e0290a0..141134b1 100644 --- a/src/main/java/zone/moddev/mc/basepower/machines/conveyors/TileEntityOreFilter.java +++ b/src/main/java/zone/moddev/mc/basepower/machines/conveyors/TileEntityOreFilter.java @@ -1,7 +1,7 @@ package zone.moddev.mc.basepower.machines.conveyors; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.Tags; +import net.neoforged.neoforge.common.Tags; import zone.moddev.mc.basepower.init.Entities; public class TileEntityOreFilter extends TileEntityConveyorFilter { diff --git a/src/main/java/zone/moddev/mc/basepower/machines/conveyors/TileEntityPlantFilter.java b/src/main/java/zone/moddev/mc/basepower/machines/conveyors/TileEntityPlantFilter.java index 1e573305..03153e6a 100644 --- a/src/main/java/zone/moddev/mc/basepower/machines/conveyors/TileEntityPlantFilter.java +++ b/src/main/java/zone/moddev/mc/basepower/machines/conveyors/TileEntityPlantFilter.java @@ -4,7 +4,7 @@ import net.minecraft.world.level.block.BonemealableBlock; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.IPlantable; +import net.neoforged.neoforge.common.SpecialPlantable; import zone.moddev.mc.basepower.init.Entities; public class TileEntityPlantFilter extends TileEntityConveyorFilter { @@ -13,10 +13,12 @@ public class TileEntityPlantFilter extends TileEntityConveyorFilter { @Override public boolean matchesFilter(ItemStack item) { if (item == null) return false; - if (item.getItem() instanceof IPlantable) return true; + if (item.getItem() instanceof SpecialPlantable) return true; if (item.getItem() instanceof BlockItem) { Block b = ((BlockItem) item.getItem()).getBlock(); - if (b instanceof IPlantable) return true; + if (b instanceof net.minecraft.world.level.block.BushBlock + || b instanceof net.minecraft.world.level.block.CactusBlock + || b instanceof net.minecraft.world.level.block.SugarCaneBlock) return true; if (b instanceof BonemealableBlock) return true; } diff --git a/src/main/java/zone/moddev/mc/basepower/machines/fluidmachines/StorageTankBlock.java b/src/main/java/zone/moddev/mc/basepower/machines/fluidmachines/StorageTankBlock.java index e1bd397d..bb6b6bc5 100644 --- a/src/main/java/zone/moddev/mc/basepower/machines/fluidmachines/StorageTankBlock.java +++ b/src/main/java/zone/moddev/mc/basepower/machines/fluidmachines/StorageTankBlock.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.machines.fluidmachines; +import net.minecraft.core.registries.BuiltInRegistries; + import java.util.List; import javax.annotation.Nullable; @@ -57,7 +59,7 @@ public ItemStack createItem(StorageTankTileEntity tile) { ItemStack stack = new ItemStack(this); if (tile.getTank().getFluidAmount() > 0) { CompoundTag tag = new CompoundTag(); - net.minecraft.resources.ResourceLocation id = net.minecraftforge.registries.ForgeRegistries.FLUIDS + net.minecraft.resources.ResourceLocation id = BuiltInRegistries.FLUID .getKey(tile.getTank().getFluid().getFluid()); if (id != null) tag.putString("FluidID", id.toString()); tag.putInt("Volume", tile.getTank().getFluidAmount()); diff --git a/src/main/java/zone/moddev/mc/basepower/migration/BaseMetalsLegacyMigration.java b/src/main/java/zone/moddev/mc/basepower/migration/BaseMetalsLegacyMigration.java index 933fa8d2..fa24a246 100644 --- a/src/main/java/zone/moddev/mc/basepower/migration/BaseMetalsLegacyMigration.java +++ b/src/main/java/zone/moddev/mc/basepower/migration/BaseMetalsLegacyMigration.java @@ -1,10 +1,12 @@ package zone.moddev.mc.basepower.migration; +import net.minecraft.core.registries.BuiltInRegistries; + import cyano.poweradvantage.api.migration.LegacyMigrationApi; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.registries.ForgeRegistries; +import net.minecraft.core.registries.Registries; import zone.moddev.mc.basemetals.api.migration.Legacy112MigrationExtension; /** Loaded only when Base Metals is present. */ @@ -36,9 +38,9 @@ public void afterPlayerFlattening(CompoundTag preparedSource, CompoundTag result public BlockState decodeBlockState(ResourceLocation legacyId, int metadata) { if (!LegacyMigrationApi.handlesNamespace(legacyId.getNamespace())) return null; ResourceLocation target = LegacyMigrationApi.blockTarget(legacyId); - if (!ForgeRegistries.BLOCKS.containsKey(target)) { + if (!BuiltInRegistries.BLOCK.containsKey(target)) { throw new IllegalStateException("No replacement for saved Advantage block " + legacyId + " (expected " + target + ")"); } - return LegacyMigrationApi.decodeBlockState(legacyId, ForgeRegistries.BLOCKS.getValue(target), metadata); + return LegacyMigrationApi.decodeBlockState(legacyId, zone.moddev.mc.basepower.util.RegistryValues.find(BuiltInRegistries.BLOCK, target), metadata); } } diff --git a/src/main/java/zone/moddev/mc/basepower/migration/LegacyEntityDataFixes.java b/src/main/java/zone/moddev/mc/basepower/migration/LegacyEntityDataFixes.java index 8e3ddfc0..0f17e1e3 100644 --- a/src/main/java/zone/moddev/mc/basepower/migration/LegacyEntityDataFixes.java +++ b/src/main/java/zone/moddev/mc/basepower/migration/LegacyEntityDataFixes.java @@ -20,8 +20,10 @@ final class LegacyEntityDataFixes { private static final String STAGED = "AdvantageLegacyEntityDataFix"; // Forge moved these saved identities into its attribute registry in 1.16. private static final String[][] FORGE_ATTRIBUTES = { - {"forge.swimSpeed", "forge:swim_speed"}, - {"forge.nameTagDistance", "forge:nametag_distance"}, + {"forge.swimSpeed", "neoforge:swim_speed"}, + {"forge:swim_speed", "neoforge:swim_speed"}, + {"forge.nameTagDistance", "neoforge:nametag_distance"}, + {"forge:nametag_distance", "neoforge:nametag_distance"}, {"forge.entity_gravity", "minecraft:generic.gravity"}, {"forge:entity_gravity", "minecraft:generic.gravity"}, {"generic.reachDistance", "minecraft:player.block_interaction_range"}, @@ -33,6 +35,7 @@ final class LegacyEntityDataFixes { private LegacyEntityDataFixes() {} static void prepare(CompoundTag root) { + renameNativeAttributes(root); if (root.contains(STAGED)) return; int version = root.contains("DataVersion", 99) ? root.getInt("DataVersion") : -1; int current = SharedConstants.getCurrentVersion().getDataVersion().getVersion(); @@ -108,6 +111,7 @@ private static void upgradeAttributePayload(CompoundTag entity, int version, int } static void preparePlayerAttributes(CompoundTag player) { + renameNativeAttributes(player); renameForgeAttributes(player); if (!player.contains("RootVehicle")) return; if (!player.contains("RootVehicle", 10)) throw new IllegalStateException("Malformed player RootVehicle"); @@ -127,6 +131,28 @@ private static void prepareAttributeTree(CompoundTag entity) { } } + static void renameNativeAttributes(Tag value) { + if (value instanceof CompoundTag compound) { + if (compound.contains("attributes", Tag.TAG_LIST)) { + ListTag attributes = compound.getList("attributes", Tag.TAG_COMPOUND); + for (String[] alias : FORGE_ATTRIBUTES) { + CompoundTag legacy = null; + int found = 0; + for (Tag entry : attributes) { + CompoundTag attribute = (CompoundTag) entry; + if (attribute.getString("id").equals(alias[0])) { legacy = attribute; found++; } + else if (attribute.getString("id").equals(alias[1])) found++; + } + if (found > 1) throw new IllegalStateException("Ambiguous native attribute: " + alias[1]); + if (legacy != null) legacy.putString("id", alias[1]); + } + } + for (String key : java.util.List.copyOf(compound.getAllKeys())) renameNativeAttributes(compound.get(key)); + } else if (value instanceof ListTag list) { + for (Tag child : list) renameNativeAttributes(child); + } + } + private static void renameForgeAttributes(CompoundTag entity) { if (!entity.contains("Attributes")) return; requireCompoundList(entity, "Attributes"); diff --git a/src/main/java/zone/moddev/mc/basepower/migration/LegacyMachineItemDataFixes.java b/src/main/java/zone/moddev/mc/basepower/migration/LegacyMachineItemDataFixes.java index 7a992db9..3072d601 100644 --- a/src/main/java/zone/moddev/mc/basepower/migration/LegacyMachineItemDataFixes.java +++ b/src/main/java/zone/moddev/mc/basepower/migration/LegacyMachineItemDataFixes.java @@ -1,11 +1,12 @@ package zone.moddev.mc.basepower.migration; +import net.minecraft.core.registries.BuiltInRegistries; + import cyano.poweradvantage.api.migration.LegacyMigrationApi; import com.mojang.datafixers.DataFixer; import com.mojang.serialization.Dynamic; import java.util.ArrayList; import java.util.Objects; -import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.nbt.ListTag; diff --git a/src/main/java/zone/moddev/mc/basepower/migration/LegacyPlayerDataFixes.java b/src/main/java/zone/moddev/mc/basepower/migration/LegacyPlayerDataFixes.java index 5fd34420..9f608cd6 100644 --- a/src/main/java/zone/moddev/mc/basepower/migration/LegacyPlayerDataFixes.java +++ b/src/main/java/zone/moddev/mc/basepower/migration/LegacyPlayerDataFixes.java @@ -30,8 +30,12 @@ public static Dynamic updateNativeEmbeddedPlayer(DataFixTypes type, DataF public static CompoundTag update(DataFixer fixer, DataFixTypes type, CompoundTag source, int version) { if (type != DataFixTypes.PLAYER) throw new IllegalArgumentException("Expected native PLAYER type"); CompoundTag result = source.copy(); + NativePersistentData.prepare(result, true); int current = SharedConstants.getCurrentVersion().getDataVersion().getVersion(); - if (version >= current) return result; + if (version >= current) { + LegacyEntityDataFixes.renameNativeAttributes(result); + return result; + } LegacyEntityDataFixes.preparePlayerAttributes(result); if (version < 704) { // Re-read the native namespaced container schema before later choice fixes. diff --git a/src/main/java/zone/moddev/mc/basepower/migration/LegacyWorldDataHook.java b/src/main/java/zone/moddev/mc/basepower/migration/LegacyWorldDataHook.java index ea899a1b..721d1c5e 100644 --- a/src/main/java/zone/moddev/mc/basepower/migration/LegacyWorldDataHook.java +++ b/src/main/java/zone/moddev/mc/basepower/migration/LegacyWorldDataHook.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.migration; +import net.minecraft.core.registries.BuiltInRegistries; + import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -35,8 +37,8 @@ import net.minecraft.nbt.NbtUtils; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.datafix.fixes.BlockStateData; -import net.minecraftforge.fml.util.ObfuscationReflectionHelper; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.fml.util.ObfuscationReflectionHelper; +import net.minecraft.core.registries.Registries; import zone.moddev.mc.basepower.PowerAdvantage; /** @@ -205,7 +207,7 @@ public static synchronized void prepareLegacyChunk(CompoundTag root) { static synchronized boolean prepareExternalPayload(CompoundTag payload, boolean player) { CompoundTag before = player ? payload.copy() : null; - int changed = migrateLegacyNbt(payload); + int changed = migrateLegacyNbt(payload) + NativePersistentData.prepare(payload, player); if (player) LegacyEntityDataFixes.preparePlayerAttributes(payload); return changed > 0 || (player && !before.equals(payload)); } @@ -233,7 +235,7 @@ static void remapFlattenedPalette(CompoundTag level) { if (original == null) continue; ResourceLocation target = LegacyMigrationApi.blockTarget(original); if (target.equals(original)) continue; - if (!ForgeRegistries.BLOCKS.containsKey(target)) { + if (!BuiltInRegistries.BLOCK.containsKey(target)) { throw new IllegalStateException("No replacement for saved Advantage block " + original); } blockState.putString("Name", target.toString()); @@ -344,8 +346,8 @@ private static int installLegacyBlockStates(CompoundTag snapshot) { int mapped = 0; for (Map.Entry entry : ids.entrySet()) { ResourceLocation target = LegacyMigrationApi.blockTarget(entry.getKey()); - Block block = ForgeRegistries.BLOCKS.getValue(target); - if (!ForgeRegistries.BLOCKS.containsKey(target) || block == null) { + Block block = zone.moddev.mc.basepower.util.RegistryValues.find(BuiltInRegistries.BLOCK, target); + if (!BuiltInRegistries.BLOCK.containsKey(target) || block == null) { throw new IllegalStateException("No Advantage replacement for legacy block " + entry.getKey() + " (expected " + target + ")"); } @@ -428,6 +430,11 @@ private static void migrateLoosePlayerData(File levelDat, CompoundTag root) thro } private static int migrateLegacyNbt(Tag value) { + return (value instanceof CompoundTag root ? NativePersistentData.prepare(root, false) : 0) + + migrateLegacyIdentities(value); + } + + private static int migrateLegacyIdentities(Tag value) { int changed = 0; if (value instanceof CompoundTag) { CompoundTag compound = (CompoundTag) value; @@ -462,7 +469,7 @@ private static int migrateLegacyNbt(Tag value) { if (oldId != null && LegacyMigrationApi.handlesNamespace(oldId.getNamespace())) { ResourceLocation target = LegacyMigrationApi.itemTarget(oldId); if (!target.equals(oldId)) { - if (!ForgeRegistries.ITEMS.containsKey(target)) { + if (!BuiltInRegistries.ITEM.containsKey(target)) { throw new IllegalStateException("No replacement for saved Advantage item " + oldId + " (expected " + target + ")"); } @@ -488,11 +495,11 @@ private static int migrateLegacyNbt(Tag value) { if (LegacyMigrationApi.migrateRegisteredNbt(compound)) changed++; for (String key : new ArrayList<>(compound.getAllKeys())) { Tag child = compound.get(key); - if (child != null) changed += migrateLegacyNbt(child); + if (child != null) changed += migrateLegacyIdentities(child); } } else if (value instanceof ListTag) { ListTag list = (ListTag) value; - for (int index = 0; index < list.size(); index++) changed += migrateLegacyNbt(list.get(index)); + for (int index = 0; index < list.size(); index++) changed += migrateLegacyIdentities(list.get(index)); } return changed; } diff --git a/src/main/java/zone/moddev/mc/basepower/migration/LegacyWorldMetadata.java b/src/main/java/zone/moddev/mc/basepower/migration/LegacyWorldMetadata.java index 5c26da0e..230032a0 100644 --- a/src/main/java/zone/moddev/mc/basepower/migration/LegacyWorldMetadata.java +++ b/src/main/java/zone/moddev/mc/basepower/migration/LegacyWorldMetadata.java @@ -14,7 +14,7 @@ import net.minecraft.nbt.StringTag; import net.minecraft.nbt.Tag; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.fml.ModList; +import net.neoforged.fml.ModList; /** Translate renamed mods before vanilla selects packs or Forge reads its saved mod list. */ public final class LegacyWorldMetadata { diff --git a/src/main/java/zone/moddev/mc/basepower/migration/NativePersistentData.java b/src/main/java/zone/moddev/mc/basepower/migration/NativePersistentData.java new file mode 100644 index 00000000..8c502a99 --- /dev/null +++ b/src/main/java/zone/moddev/mc/basepower/migration/NativePersistentData.java @@ -0,0 +1,78 @@ +package zone.moddev.mc.basepower.migration; + +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.Tag; + +/** Moves Forge's engine-owned payload key without rewriting arbitrary item custom data. */ +final class NativePersistentData { + private NativePersistentData() { } + + static int prepare(CompoundTag root, boolean player) { + int changed = player ? owner(root) : 0; + CompoundTag chunk = root.contains("Level", Tag.TAG_COMPOUND) ? root.getCompound("Level") : root; + for (String key : new String[] {"Entities", "entities", "TileEntities", "block_entities"}) { + if (chunk.get(key) instanceof ListTag list) for (Tag entry : list) { + if (entry instanceof CompoundTag compound) changed += owner(compound); + } + } + if (root.contains("Data", Tag.TAG_COMPOUND)) { + CompoundTag data = root.getCompound("Data"); + if (data.contains("Player", Tag.TAG_COMPOUND)) changed += owner(data.getCompound("Player")); + } + return changed; + } + + private static int owner(CompoundTag owner) { + int changed = rename(owner); + for (String key : new String[] {"Passengers", "Inventory", "EnderItems", "Items", "ArmorItems", "HandItems"}) { + if (owner.get(key) instanceof ListTag list) for (Tag entry : list) { + if (entry instanceof CompoundTag compound) { + changed += key.equals("Passengers") ? owner(compound) : stack(compound); + } + } + } + if (owner.contains("RootVehicle", Tag.TAG_COMPOUND)) { + CompoundTag vehicle = owner.getCompound("RootVehicle"); + if (vehicle.contains("Entity", Tag.TAG_COMPOUND)) changed += owner(vehicle.getCompound("Entity")); + } + if (owner.contains("Item", Tag.TAG_COMPOUND)) changed += stack(owner.getCompound("Item")); + return changed; + } + + private static int stack(CompoundTag stack) { + int changed = 0; + if (stack.contains("tag", Tag.TAG_COMPOUND)) { + CompoundTag tag = stack.getCompound("tag"); + for (String key : new String[] {"BlockEntityTag", "EntityTag"}) { + if (tag.contains(key, Tag.TAG_COMPOUND)) changed += owner(tag.getCompound(key)); + } + if (tag.get("Items") instanceof ListTag items) for (Tag entry : items) { + if (entry instanceof CompoundTag compound) changed += stack(compound); + } + } + if (stack.contains("components", Tag.TAG_COMPOUND)) { + CompoundTag components = stack.getCompound("components"); + for (String key : new String[] {"minecraft:block_entity_data", "minecraft:entity_data"}) { + if (components.contains(key, Tag.TAG_COMPOUND)) changed += owner(components.getCompound(key)); + } + if (components.get("minecraft:container") instanceof ListTag contents) for (Tag entry : contents) { + if (entry instanceof CompoundTag slot && slot.contains("item", Tag.TAG_COMPOUND)) + changed += stack(slot.getCompound("item")); + } + } + return changed; + } + + private static int rename(CompoundTag owner) { + if (!owner.contains("ForgeData")) return 0; + if (!owner.contains("ForgeData", Tag.TAG_COMPOUND)) + throw new IllegalStateException("Saved ForgeData is not a compound"); + Tag previous = owner.get("ForgeData"); + if (owner.contains("NeoForgeData") && !previous.equals(owner.get("NeoForgeData"))) + throw new IllegalStateException("Conflicting Forge and NeoForge persistent data; original save retained"); + owner.put("NeoForgeData", previous.copy()); + owner.remove("ForgeData"); + return 1; + } +} diff --git a/src/main/java/zone/moddev/mc/basepower/migration/VanillaRegistryRemaps.java b/src/main/java/zone/moddev/mc/basepower/migration/VanillaRegistryRemaps.java index 4407dd7b..683e607e 100644 --- a/src/main/java/zone/moddev/mc/basepower/migration/VanillaRegistryRemaps.java +++ b/src/main/java/zone/moddev/mc/basepower/migration/VanillaRegistryRemaps.java @@ -15,11 +15,10 @@ import net.minecraft.sounds.SoundEvent; import net.minecraft.util.datafix.fixes.CavesAndCliffsRenames; import net.minecraft.world.level.biome.Biome; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.eventbus.api.EventPriority; -import net.minecraftforge.registries.MissingMappingsEvent; -import net.minecraftforge.registries.IForgeRegistry; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.bus.api.EventPriority; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; import zone.moddev.mc.basepower.PowerAdvantage; /** Vanilla's data fixers rename saved data, but not Forge's registry snapshot. */ @@ -32,117 +31,45 @@ public final class VanillaRegistryRemaps { private VanillaRegistryRemaps() {} - public static void register() { - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::blocks); - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::items); - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::entities); - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::sounds); - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::biomes); - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::memories); - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::pointsOfInterest); - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::blockEntities); - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::fluids); - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::potions); - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::menus); - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::recipeSerializers); - MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, VanillaRegistryRemaps::paintings); - } - - private static void blocks(MissingMappingsEvent event) { - remap(event, ForgeRegistries.BLOCKS); - remapAdvantage(event, ForgeRegistries.BLOCKS, LegacyMigrationApi::blockTarget); - } - private static void items(MissingMappingsEvent event) { - remap(event, ForgeRegistries.ITEMS); - remapAdvantage(event, ForgeRegistries.ITEMS, LegacyMigrationApi::itemTarget); - } - private static void entities(MissingMappingsEvent event) { - remap(event, ForgeRegistries.ENTITY_TYPES); - remapAdvantage(event, ForgeRegistries.ENTITY_TYPES, - id -> ResourceLocation.parse(LegacyMigrationApi.entityTarget(id.toString()))); - } - private static void sounds(MissingMappingsEvent event) { remap(event, ForgeRegistries.SOUND_EVENTS); } - private static void paintings(MissingMappingsEvent event) { remap(event, ForgeRegistries.PAINTING_VARIANTS); } - private static void biomes(MissingMappingsEvent event) { remap(event, ForgeRegistries.BIOMES); } - private static void memories(MissingMappingsEvent event) { remap(event, ForgeRegistries.MEMORY_MODULE_TYPES); } - private static void pointsOfInterest(MissingMappingsEvent event) { remap(event, ForgeRegistries.POI_TYPES); } - - private static void blockEntities(MissingMappingsEvent event) { - remapAdvantage(event, ForgeRegistries.BLOCK_ENTITY_TYPES, - id -> ResourceLocation.parse(LegacyMigrationApi.tileTarget(id.toString()))); - } - private static void fluids(MissingMappingsEvent event) { - remapAdvantage(event, ForgeRegistries.FLUIDS, - id -> ResourceLocation.parse(LegacyMigrationApi.fluidTarget(id.toString()))); - } - private static void potions(MissingMappingsEvent event) { remap(event, ForgeRegistries.POTIONS); } - private static void menus(MissingMappingsEvent event) { - remapAdvantage(event, ForgeRegistries.MENU_TYPES, LegacyMigrationApi::registryTarget); - } - private static void recipeSerializers(MissingMappingsEvent event) { - remapAdvantage(event, ForgeRegistries.RECIPE_SERIALIZERS, LegacyMigrationApi::registryTarget); - } - - private static void remapAdvantage(MissingMappingsEvent event, - IForgeRegistry active, UnaryOperator replacement) { - for (MissingMappingsEvent.Mapping mapping : event.getAllMappings(active.getRegistryKey())) { - ResourceLocation target = replacement.apply(mapping.getKey()); - if (!mapping.getKey().equals(target) && active.containsKey(target)) { - mapping.remap(active.getValue(target)); - PowerAdvantage.LOGGER.info("Migrated Advantage registry entry {} to {}", mapping.getKey(), target); + /** Aliases apply to named registries; legacy numeric snapshots are handled before data fixing. */ + public static void registerAliases(net.neoforged.neoforge.registries.RegisterEvent event) { + net.minecraft.core.Registry registry = event.getRegistry(); + ResourceLocation registryId = event.getRegistryKey().location(); + for (ResourceLocation current : java.util.List.copyOf(registry.keySet())) { + if (!LegacyMigrationApi.handlesNamespace(current.getNamespace())) continue; + for (String namespace : LegacyMigrationApi.namespaces()) { + ResourceLocation legacy = ResourceLocation.fromNamespaceAndPath(namespace, current.getPath()); + ResourceLocation target = migrationTarget(registryId, legacy); + if (!legacy.equals(target) && target.equals(current) && !registry.containsKey(legacy)) { + registry.addAlias(legacy, target); + } + ResourceLocation prefixed = ResourceLocation.withDefaultNamespace(namespace + "." + current.getPath()); + if (registryId.getPath().equals("block_entity_type")) { + ResourceLocation tileTarget = ResourceLocation.tryParse(LegacyMigrationApi.tileTarget(prefixed.toString())); + if (current.equals(tileTarget) && !registry.containsKey(prefixed)) registry.addAlias(prefixed, current); + } } } - } - - static void remap(MissingMappingsEvent event, IForgeRegistry active) { - for (MissingMappingsEvent.Mapping mapping : event.getMappings(active.getRegistryKey(), "minecraft")) { - if (retiredPaintingIndex(active.getRegistryName(), mapping.getKey())) { - // These names still exist in the native data-pack registry. Only - // Forge's old numeric index is retired; entity variant NBT is unchanged. - mapping.ignore(); - continue; - } - if (active.getRegistryName().equals(ResourceLocation.parse("minecraft:potion")) - && mapping.getKey().equals(ResourceLocation.parse("minecraft:empty"))) { - // An absent potion is now represented by empty potion contents, not a registry entry. - mapping.ignore(); - continue; - } - if (retiredTransientMemory(active.getRegistryName(), mapping.getKey())) { - // Both old types used register(name) without a serializer: no saved - // brain values exist. Retire only their obsolete Forge ID indexes. - mapping.ignore(); - PowerAdvantage.LOGGER.info("Retired non-serialized vanilla AI registry index {}", mapping.getKey()); - continue; + if (registryId.getPath().equals("block") || registryId.getPath().equals("item")) { + for (ResourceLocation oldId : LegacyMigrationApi.blockStateCodecs().keySet()) { + ResourceLocation target = migrationTarget(registryId, oldId); + if (!oldId.equals(target) && registry.containsKey(target) && !registry.containsKey(oldId)) + registry.addAlias(oldId, target); } - if (retiredVanillaPoi(active.getRegistryName(), mapping.getKey())) { - // Vanilla's "Remove unpopulated villager PoI types" fixer handles - // saved POI sections. Forge still sees the obsolete numeric indexes. - mapping.ignore(); - PowerAdvantage.LOGGER.info("Retired unused vanilla point of interest index {}", mapping.getKey()); - continue; - } - ResourceLocation updatedBiome = vanillaBiomeFixTarget(active.getRegistryName(), mapping.getKey()); - if (updatedBiome != null && active.containsKey(updatedBiome)) { - // Vanilla fixes biome names in chunks and world settings. Several - // old entries share one target; do not assign it multiple numeric IDs. - mapping.ignore(); - PowerAdvantage.LOGGER.info("Retired vanilla biome registry index {} (data fixer: {})", - mapping.getKey(), updatedBiome); - continue; - } - ResourceLocation replacement = replacement(active.getRegistryName(), mapping.getKey()); - if (replacement == null) continue; - // The event's registry is STAGING: new entries need not be present there yet. - if (!active.containsKey(replacement)) { - throw new IllegalStateException("Missing native vanilla migration target " + replacement); - } - T target = active.getValue(replacement); - mapping.remap(target); - PowerAdvantage.LOGGER.info("Migrated vanilla registry entry {} to {}", mapping.getKey(), replacement); } } + private static ResourceLocation migrationTarget(ResourceLocation registry, ResourceLocation id) { + return switch (registry.getPath()) { + case "block" -> LegacyMigrationApi.blockTarget(id); + case "item" -> LegacyMigrationApi.itemTarget(id); + case "entity_type" -> ResourceLocation.parse(LegacyMigrationApi.entityTarget(id.toString())); + case "block_entity_type" -> ResourceLocation.parse(LegacyMigrationApi.tileTarget(id.toString())); + case "fluid" -> ResourceLocation.parse(LegacyMigrationApi.fluidTarget(id.toString())); + default -> LegacyMigrationApi.registryTarget(id); + }; + } + static boolean retiredPaintingIndex(ResourceLocation registry, ResourceLocation old) { return registry.equals(ResourceLocation.parse("minecraft:painting_variant")) && old.getNamespace().equals("minecraft") && LEGACY_PAINTINGS.contains(old.getPath()); diff --git a/src/main/java/zone/moddev/mc/basepower/recipe/MaterialPolicyPack.java b/src/main/java/zone/moddev/mc/basepower/recipe/MaterialPolicyPack.java index cd291e48..0463c9b6 100644 --- a/src/main/java/zone/moddev/mc/basepower/recipe/MaterialPolicyPack.java +++ b/src/main/java/zone/moddev/mc/basepower/recipe/MaterialPolicyPack.java @@ -19,7 +19,7 @@ import net.minecraft.server.packs.metadata.pack.PackMetadataSection; import net.minecraft.server.packs.resources.IoSupplier; import net.minecraft.server.packs.repository.PackSource; -import net.minecraftforge.fml.ModList; +import net.neoforged.fml.ModList; import zone.moddev.mc.basepower.PowerAdvantage; import zone.moddev.mc.basepower.RecipeMode; @@ -46,7 +46,7 @@ final class MaterialPolicyPack implements PackResources { if (normalSolder) { for (String metal : new String[] {"lead", "tin", "silver"}) { JsonObject optional = new JsonObject(); - optional.addProperty("id", "#forge:ingots/" + metal); + optional.addProperty("id", "#c:ingots/" + metal); optional.addProperty("required", false); solder.add(optional); } @@ -58,7 +58,7 @@ private void put(String path, JsonArray values) { JsonObject tag = new JsonObject(); tag.addProperty("replace", false); tag.add("values", values); - resources.put(ResourceLocation.fromNamespaceAndPath("forge", "tags/item/" + path + ".json"), tag.toString()); + resources.put(ResourceLocation.fromNamespaceAndPath("c", "tags/item/" + path + ".json"), tag.toString()); } @Override public IoSupplier getRootResource(String... names) { return null; } @@ -77,7 +77,7 @@ private void put(String path, JsonArray values) { } } @Override public Set getNamespaces(PackType type) { - return type == PackType.SERVER_DATA ? Collections.singleton("forge") : Collections.emptySet(); + return type == PackType.SERVER_DATA ? Collections.singleton("c") : Collections.emptySet(); } @Override @SuppressWarnings("unchecked") public T getMetadataSection(MetadataSectionSerializer serializer) { diff --git a/src/main/java/zone/moddev/mc/basepower/recipe/MaterialTags.java b/src/main/java/zone/moddev/mc/basepower/recipe/MaterialTags.java index 3fa3a25f..fbfff0f3 100644 --- a/src/main/java/zone/moddev/mc/basepower/recipe/MaterialTags.java +++ b/src/main/java/zone/moddev/mc/basepower/recipe/MaterialTags.java @@ -5,7 +5,7 @@ import net.minecraft.server.packs.PackSelectionConfig; import net.minecraft.server.packs.PackType; import net.minecraft.server.packs.repository.Pack; -import net.minecraftforge.event.AddPackFindersEvent; +import net.neoforged.neoforge.event.AddPackFindersEvent; /** Config-dependent aliases resolved by the server's native tag reload. */ public final class MaterialTags { diff --git a/src/main/java/zone/moddev/mc/basepower/recipe/PartsLoot.java b/src/main/java/zone/moddev/mc/basepower/recipe/PartsLoot.java index 39c6e7f4..95e6c51e 100644 --- a/src/main/java/zone/moddev/mc/basepower/recipe/PartsLoot.java +++ b/src/main/java/zone/moddev/mc/basepower/recipe/PartsLoot.java @@ -13,12 +13,13 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; -import net.minecraftforge.common.loot.IGlobalLootModifier; -import net.minecraftforge.common.loot.LootModifier; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.ModList; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.loot.IGlobalLootModifier; +import net.neoforged.neoforge.common.loot.LootModifier; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModList; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; import zone.moddev.mc.basepower.PowerAdvantage; /** Adds Advantage parts to the selected vanilla chest tables, not to data-pack replacements. */ @@ -28,7 +29,7 @@ public final class PartsLoot extends LootModifier { "chests/stronghold_crossing", "chests/end_city_treasure"); private static final List MODS = List.of("basepower", "basesteam", "baseelectric"); private static final DeferredRegister> SERIALIZERS = - DeferredRegister.create(ForgeRegistries.Keys.GLOBAL_LOOT_MODIFIER_SERIALIZERS, PowerAdvantage.MODID); + DeferredRegister.create(net.neoforged.neoforge.registries.NeoForgeRegistries.Keys.GLOBAL_LOOT_MODIFIER_SERIALIZERS, PowerAdvantage.MODID); private static final MapCodec CODEC = RecordCodecBuilder.mapCodec(instance -> codecStart(instance).apply(instance, PartsLoot::new)); diff --git a/src/main/java/zone/moddev/mc/basepower/recipe/RecipeConditions.java b/src/main/java/zone/moddev/mc/basepower/recipe/RecipeConditions.java index 74eb3c31..970667d0 100644 --- a/src/main/java/zone/moddev/mc/basepower/recipe/RecipeConditions.java +++ b/src/main/java/zone/moddev/mc/basepower/recipe/RecipeConditions.java @@ -6,17 +6,18 @@ import java.util.Locale; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; -import net.minecraftforge.common.crafting.conditions.ICondition; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.conditions.ICondition; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; import zone.moddev.mc.basepower.PowerAdvantage; import zone.moddev.mc.basepower.RecipeMode; /** Forge recipe conditions for the existing modes and optional material tags. */ public final class RecipeConditions { private static final DeferredRegister> SERIALIZERS = - DeferredRegister.create(ForgeRegistries.Keys.CONDITION_SERIALIZERS, PowerAdvantage.MODID); + DeferredRegister.create(net.neoforged.neoforge.registries.NeoForgeRegistries.Keys.CONDITION_CODECS, PowerAdvantage.MODID); static { SERIALIZERS.register("recipe_mode", () -> Mode.MATCH); @@ -38,7 +39,7 @@ private static MapCodec create(boolean match) { } @Override public MapCodec codec() { return match ? MATCH : MISMATCH; } - @Override public boolean test(IContext context, DynamicOps ops) { + @Override public boolean test(IContext context) { return (PowerAdvantage.recipeMode == RecipeMode.valueOf(mode.toUpperCase(Locale.ROOT))) == match; } } @@ -52,7 +53,7 @@ private static MapCodec create(boolean empty) { } @Override public MapCodec codec() { return empty ? EMPTY : NOT_EMPTY; } - @Override public boolean test(IContext context, DynamicOps ops) { + @Override public boolean test(IContext context) { return context.getTag(ItemTags.create(tag)).isEmpty() == empty; } } diff --git a/src/main/java/zone/moddev/mc/basepower/recipe/RecipeDiscovery.java b/src/main/java/zone/moddev/mc/basepower/recipe/RecipeDiscovery.java index c6f026bf..993bf435 100644 --- a/src/main/java/zone/moddev/mc/basepower/recipe/RecipeDiscovery.java +++ b/src/main/java/zone/moddev/mc/basepower/recipe/RecipeDiscovery.java @@ -8,7 +8,7 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.event.entity.player.PlayerEvent; +import net.neoforged.neoforge.event.entity.player.PlayerEvent; /** Retains earned discoveries when recipe modes or material providers change. */ public final class RecipeDiscovery { diff --git a/src/main/java/zone/moddev/mc/basepower/registry/FuelRegistry.java b/src/main/java/zone/moddev/mc/basepower/registry/FuelRegistry.java index fdef43ca..803de717 100644 --- a/src/main/java/zone/moddev/mc/basepower/registry/FuelRegistry.java +++ b/src/main/java/zone/moddev/mc/basepower/registry/FuelRegistry.java @@ -4,7 +4,6 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity; -import net.minecraftforge.event.ForgeEventFactory; import java.util.*; import java.util.concurrent.locks.Lock; @@ -142,8 +141,7 @@ public static short getActualBurntimeForItem(ItemStack fuel){ if(fuel == null || fuel.isEmpty()) return 0; int custom = getInstance().getBurnTime(fuel); if (custom > 0) return (short) Math.min(Short.MAX_VALUE, custom); - Integer vanilla = AbstractFurnaceBlockEntity.getFuel().get(fuel.getItem()); - int burnTime = ForgeEventFactory.getItemBurnTime(fuel, vanilla == null ? 0 : vanilla.intValue(), net.minecraft.world.item.crafting.RecipeType.SMELTING); + int burnTime = fuel.getBurnTime(net.minecraft.world.item.crafting.RecipeType.SMELTING); return (short) Math.min(Short.MAX_VALUE, Math.max(0, burnTime)); } diff --git a/src/main/java/zone/moddev/mc/basepower/registry/ITileEntityGUI.java b/src/main/java/zone/moddev/mc/basepower/registry/ITileEntityGUI.java index ab581433..9c3f6f7c 100644 --- a/src/main/java/zone/moddev/mc/basepower/registry/ITileEntityGUI.java +++ b/src/main/java/zone/moddev/mc/basepower/registry/ITileEntityGUI.java @@ -2,8 +2,8 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; /** * This interface is used to combine the two different classes of a block GUI diff --git a/src/main/java/zone/moddev/mc/basepower/registry/MachineGUIRegistry.java b/src/main/java/zone/moddev/mc/basepower/registry/MachineGUIRegistry.java index d3418d8c..1c2c4081 100644 --- a/src/main/java/zone/moddev/mc/basepower/registry/MachineGUIRegistry.java +++ b/src/main/java/zone/moddev/mc/basepower/registry/MachineGUIRegistry.java @@ -16,12 +16,13 @@ import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.extensions.IForgeMenuType; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.common.extensions.IMenuTypeExtension; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegisterEvent; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.neoforged.neoforge.registries.RegisterEvent; import zone.moddev.mc.basepower.PowerAdvantage; import java.util.Map; @@ -48,9 +49,9 @@ public static int addGUI(ITileEntityGUI gui) { public void removeGUI(int id) { DEFINITIONS.remove(id); } public static void registerTypes(RegisterEvent event) { - if (!ForgeRegistries.Keys.MENU_TYPES.equals(event.getRegistryKey())) return; - TYPE = IForgeMenuType.create(MachineGUIRegistry::createClientContainer); - event.register(ForgeRegistries.Keys.MENU_TYPES, ResourceLocation.fromNamespaceAndPath(PowerAdvantage.MODID, "machine"), () -> TYPE); + if (!Registries.MENU.equals(event.getRegistryKey())) return; + TYPE = IMenuTypeExtension.create(MachineGUIRegistry::createClientContainer); + event.register(Registries.MENU, ResourceLocation.fromNamespaceAndPath(PowerAdvantage.MODID, "machine"), () -> TYPE); } private static SimpleMachineGUI.Container createClientContainer( @@ -75,8 +76,8 @@ private static SimpleMachineGUI definition(int id) { } @OnlyIn(Dist.CLIENT) - public static void registerScreens() { - MenuScreens.register(TYPE, + public static void registerScreens(net.neoforged.neoforge.client.event.RegisterMenuScreensEvent event) { + event.register(TYPE, (container, inventory, title) -> container.createScreen(inventory, title)); } diff --git a/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/DistillationRecipe.java b/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/DistillationRecipe.java index c0f848cb..6ee0f0f5 100644 --- a/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/DistillationRecipe.java +++ b/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/DistillationRecipe.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.registry.still.recipe; +import net.minecraft.core.registries.BuiltInRegistries; + import java.util.Collection; import java.util.LinkedList; @@ -119,7 +121,7 @@ public boolean isValidOutput(Fluid output) { */ public Collection getValidInputs() { LinkedList l = new LinkedList<>(); - for (Fluid f : net.minecraftforge.registries.ForgeRegistries.FLUIDS) { + for (Fluid f : BuiltInRegistries.FLUID) { FluidStack stack = new FluidStack(f, FluidTank.BUCKET_VOLUME); if (this.isValidInput(stack)) { l.add(stack); diff --git a/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/DistillationRecipeRegistry.java b/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/DistillationRecipeRegistry.java index 5015b2a6..8432c9ca 100644 --- a/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/DistillationRecipeRegistry.java +++ b/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/DistillationRecipeRegistry.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.registry.still.recipe; +import net.minecraft.core.registries.BuiltInRegistries; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -137,7 +139,7 @@ public static void addDistillationRecipe(FluidStack input, FluidStack output){ } private static String id(Fluid fluid) { - ResourceLocation id = net.minecraftforge.registries.ForgeRegistries.FLUIDS.getKey(fluid); + ResourceLocation id = BuiltInRegistries.FLUID.getKey(fluid); return id == null ? "unknown" : id.toString(); } diff --git a/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/ExplicitFluidReference.java b/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/ExplicitFluidReference.java index 716b7ffa..4a387a6a 100644 --- a/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/ExplicitFluidReference.java +++ b/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/ExplicitFluidReference.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.registry.still.recipe; +import net.minecraft.core.registries.BuiltInRegistries; + import net.minecraft.world.level.material.Fluid; import net.minecraft.resources.ResourceLocation; import net.minecraft.core.Registry; @@ -44,7 +46,7 @@ public boolean matches(Fluid fluid) { */ @Override public boolean matches(String fluidName) { - ResourceLocation id = net.minecraftforge.registries.ForgeRegistries.FLUIDS.getKey(reference); + ResourceLocation id = BuiltInRegistries.FLUID.getKey(reference); return id != null && (id.toString().equals(fluidName) || id.getPath().equals(fluidName)); } @@ -65,7 +67,7 @@ public Fluid getFluid() { */ @Override public int hashCode() { - ResourceLocation id = net.minecraftforge.registries.ForgeRegistries.FLUIDS.getKey(reference); + ResourceLocation id = BuiltInRegistries.FLUID.getKey(reference); return id == null ? System.identityHashCode(reference) : id.hashCode(); } } diff --git a/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/RegistryNameFluidReference.java b/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/RegistryNameFluidReference.java index e539c931..4ab5df6a 100644 --- a/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/RegistryNameFluidReference.java +++ b/src/main/java/zone/moddev/mc/basepower/registry/still/recipe/RegistryNameFluidReference.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.registry.still.recipe; +import net.minecraft.core.registries.BuiltInRegistries; + import net.minecraft.world.level.material.Fluid; import net.minecraft.resources.ResourceLocation; import net.minecraft.core.Registry; @@ -28,7 +30,7 @@ public RegistryNameFluidReference(String registryName) { */ @Override public boolean matches(Fluid fluid) { - ResourceLocation id = net.minecraftforge.registries.ForgeRegistries.FLUIDS.getKey(fluid); + ResourceLocation id = BuiltInRegistries.FLUID.getKey(fluid); return id != null && (reference.equals(id.toString()) || reference.equals(id.getPath())); } diff --git a/src/main/java/zone/moddev/mc/basepower/util/AdvantageFluidAdapter.java b/src/main/java/zone/moddev/mc/basepower/util/AdvantageFluidAdapter.java index 9b63e8da..b985b8e4 100644 --- a/src/main/java/zone/moddev/mc/basepower/util/AdvantageFluidAdapter.java +++ b/src/main/java/zone/moddev/mc/basepower/util/AdvantageFluidAdapter.java @@ -6,9 +6,9 @@ import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.core.Direction; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction; /** A side-bound foreign capability; reacquire it after removal or capability invalidation. */ final class AdvantageFluidAdapter implements IAdvantageFluidHandler { @@ -21,7 +21,8 @@ final class AdvantageFluidAdapter implements IAdvantageFluidHandler { } private IFluidHandler handler() { - return tile.isRemoved() ? null : tile.getCapability(ForgeCapabilities.FLUID_HANDLER, side).orElse(null); + return tile.isRemoved() || tile.getLevel() == null ? null + : tile.getLevel().getCapability(Capabilities.FluidHandler.BLOCK, tile.getBlockPos(), side); } @Override public FluidTankInfo[] getTankInfo(Direction ignored) { @@ -54,7 +55,7 @@ private IFluidHandler handler() { @Override public boolean canFill(Direction ignored, Fluid fluid) { IFluidHandler handler = handler(); if (handler == null || fluid == null) return false; - net.minecraftforge.fluids.FluidStack probe = new net.minecraftforge.fluids.FluidStack(fluid, 1); + net.neoforged.neoforge.fluids.FluidStack probe = new net.neoforged.neoforge.fluids.FluidStack(fluid, 1); for (int i = 0; i < handler.getTanks(); i++) if (handler.isFluidValid(i, probe)) return true; return false; } diff --git a/src/main/java/zone/moddev/mc/basepower/util/FluidContainerHelper.java b/src/main/java/zone/moddev/mc/basepower/util/FluidContainerHelper.java index 1290b705..f7970276 100644 --- a/src/main/java/zone/moddev/mc/basepower/util/FluidContainerHelper.java +++ b/src/main/java/zone/moddev/mc/basepower/util/FluidContainerHelper.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.util; +import net.minecraft.core.registries.BuiltInRegistries; + import cyano.poweradvantage.api.fluid.IAdvantageFluidHandler; import java.util.Optional; import net.minecraft.world.item.BucketItem; @@ -12,12 +14,12 @@ import net.minecraft.core.Direction; import net.minecraft.world.InteractionHand; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidUtil; -import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction; -import net.minecraftforge.fluids.capability.IFluidHandlerItem; -import net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidUtil; +import net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction; +import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; +import net.neoforged.neoforge.fluids.capability.wrappers.FluidBucketWrapper; /** Uses Forge's container handling for buckets and capability-based fluid containers. */ public final class FluidContainerHelper { @@ -51,16 +53,16 @@ public static Optional getFluidContained(ItemStack stack) { } private static Optional itemHandler(ItemStack stack) { - // Forge 50's FluidUtil#getFluidHandler(ItemStack) is a stub. Use its standard - // bucket adapter directly and accept explicit providers from other items. - if (stack.getItem() instanceof BucketItem) return Optional.of(new FluidBucketWrapper(stack)); - var provider = stack.getItem().getCapabilityProvider(stack); - return provider == null ? Optional.empty() : provider.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).resolve(); + return Optional.ofNullable(stack.getCapability(Capabilities.FluidHandler.ITEM)); } public static Fluid fluidForBucket(Item bucketItem) { - for (Fluid fluid : net.minecraftforge.registries.ForgeRegistries.FLUIDS) { - if (fluid.getBucket() == bucketItem && bucketItem != Items.BUCKET) return fluid; + if (bucketItem instanceof BucketItem bucket) { + return bucket.content == net.minecraft.world.level.material.Fluids.EMPTY ? null : bucket.content; + } + for (Fluid fluid : BuiltInRegistries.FLUID) { + if (fluid.getBucket() == bucketItem && bucketItem != Items.BUCKET) + return fluid instanceof net.minecraft.world.level.material.FlowingFluid flowing ? flowing.getSource() : fluid; } return null; } diff --git a/src/main/java/zone/moddev/mc/basepower/util/FluidHandlerHelper.java b/src/main/java/zone/moddev/mc/basepower/util/FluidHandlerHelper.java index ce8da75d..858184e2 100644 --- a/src/main/java/zone/moddev/mc/basepower/util/FluidHandlerHelper.java +++ b/src/main/java/zone/moddev/mc/basepower/util/FluidHandlerHelper.java @@ -11,7 +11,8 @@ private FluidHandlerHelper() {} public static IAdvantageFluidHandler getHandler(BlockEntity tileEntity, Direction face) { if (tileEntity == null || tileEntity.isRemoved()) return null; if (tileEntity instanceof IAdvantageFluidHandler) return (IAdvantageFluidHandler) tileEntity; - return tileEntity.getCapability(net.minecraftforge.common.capabilities.ForgeCapabilities.FLUID_HANDLER, face).isPresent() + return tileEntity.getLevel() != null && tileEntity.getLevel().getCapability( + net.neoforged.neoforge.capabilities.Capabilities.FluidHandler.BLOCK, tileEntity.getBlockPos(), face) != null ? new AdvantageFluidAdapter(tileEntity, face) : null; } diff --git a/src/main/java/zone/moddev/mc/basepower/util/FluidIdHelper.java b/src/main/java/zone/moddev/mc/basepower/util/FluidIdHelper.java index 45f122c2..573bdf23 100644 --- a/src/main/java/zone/moddev/mc/basepower/util/FluidIdHelper.java +++ b/src/main/java/zone/moddev/mc/basepower/util/FluidIdHelper.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.util; +import net.minecraft.core.registries.BuiltInRegistries; + import net.minecraft.world.level.material.Fluid; import net.minecraft.resources.ResourceLocation; import net.minecraft.core.Registry; @@ -12,14 +14,14 @@ private FluidIdHelper() { public static int getFluidId(Fluid fluid) { if (fluid == null) return 0; - ResourceLocation name = net.minecraftforge.registries.ForgeRegistries.FLUIDS.getKey(fluid); + ResourceLocation name = BuiltInRegistries.FLUID.getKey(fluid); return name == null ? 0 : name.toString().hashCode(); } public static Fluid getFluid(int id) { if (id == 0) return null; - for (Fluid fluid : net.minecraftforge.registries.ForgeRegistries.FLUIDS) { - ResourceLocation name = net.minecraftforge.registries.ForgeRegistries.FLUIDS.getKey(fluid); + for (Fluid fluid : BuiltInRegistries.FLUID) { + ResourceLocation name = BuiltInRegistries.FLUID.getKey(fluid); if (name != null && name.toString().hashCode() == id) return fluid; } return null; diff --git a/src/main/java/zone/moddev/mc/basepower/util/ForgeFluidAdapter.java b/src/main/java/zone/moddev/mc/basepower/util/ForgeFluidAdapter.java index a6418031..3b44c278 100644 --- a/src/main/java/zone/moddev/mc/basepower/util/ForgeFluidAdapter.java +++ b/src/main/java/zone/moddev/mc/basepower/util/ForgeFluidAdapter.java @@ -4,7 +4,7 @@ import cyano.poweradvantage.api.fluid.FluidTankInfo; import cyano.poweradvantage.api.fluid.IAdvantageFluidHandler; import net.minecraft.core.Direction; -import net.minecraftforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; /** Exposes the stable Advantage contract through Forge's native fluid capability. */ public final class ForgeFluidAdapter implements IFluidHandler { @@ -18,61 +18,90 @@ public ForgeFluidAdapter(IAdvantageFluidHandler handler, Direction face, Runnabl this.changed = changed; } - public static net.minecraftforge.fluids.FluidStack toForge(FluidStack stack) { - return stack == null || stack.amount <= 0 ? net.minecraftforge.fluids.FluidStack.EMPTY - : new net.minecraftforge.fluids.FluidStack(stack.getFluid(), stack.amount, - stack.tag == null ? null : stack.tag.copy()); + public static net.neoforged.neoforge.fluids.FluidStack toForge(FluidStack stack) { + if (stack == null || stack.amount <= 0) return net.neoforged.neoforge.fluids.FluidStack.EMPTY; + var result = new net.neoforged.neoforge.fluids.FluidStack(stack.getFluid(), stack.amount); + if (stack.tag != null) { + var custom = stack.tag.copy(); + if (custom.contains("basepower:fluid_components", 10)) { + var encoded = new net.minecraft.nbt.CompoundTag(); + encoded.putString("id", net.minecraft.core.registries.BuiltInRegistries.FLUID.getKey(stack.getFluid()).toString()); + encoded.putInt("amount", stack.amount); + encoded.put("components", custom.getCompound("basepower:fluid_components").copy()); + result = net.neoforged.neoforge.fluids.FluidStack.parseOptional(registries(), encoded); + if (result.isEmpty()) throw new IllegalStateException("Invalid saved fluid components"); + custom.remove("basepower:fluid_components"); + } + if (!custom.isEmpty()) + result.set(net.minecraft.core.component.DataComponents.CUSTOM_DATA, + net.minecraft.world.item.component.CustomData.of(custom)); + } + return result; } - public static FluidStack fromForge(net.minecraftforge.fluids.FluidStack stack) { + public static FluidStack fromForge(net.neoforged.neoforge.fluids.FluidStack stack) { if (stack == null || stack.isEmpty()) return null; FluidStack copy = new FluidStack(stack.getFluid(), stack.getAmount()); - copy.tag = stack.hasTag() ? stack.getTag().copy() : null; + copy.tag = stack.getOrDefault(net.minecraft.core.component.DataComponents.CUSTOM_DATA, + net.minecraft.world.item.component.CustomData.EMPTY).copyTag(); + if (!stack.isComponentsPatchEmpty()) { + var components = ((net.minecraft.nbt.CompoundTag) stack.save(registries())).getCompound("components").copy(); + components.remove("minecraft:custom_data"); + if (!components.isEmpty()) copy.tag.put("basepower:fluid_components", components); + } + if (copy.tag.isEmpty()) copy.tag = null; return copy; } + private static net.minecraft.core.HolderLookup.Provider registries() { + var server = net.neoforged.neoforge.server.ServerLifecycleHooks.getCurrentServer(); + return server != null ? server.registryAccess() + : net.minecraft.core.RegistryAccess.fromRegistryOfRegistries( + net.minecraft.core.registries.BuiltInRegistries.REGISTRY); + } + private FluidTankInfo[] tanks() { FluidTankInfo[] tanks = handler.getTankInfo(face); return tanks == null ? new FluidTankInfo[0] : tanks; } @Override public int getTanks() { return tanks().length; } - @Override public net.minecraftforge.fluids.FluidStack getFluidInTank(int tank) { + @Override public net.neoforged.neoforge.fluids.FluidStack getFluidInTank(int tank) { FluidTankInfo[] tanks = tanks(); return tank < 0 || tank >= tanks.length || tanks[tank] == null - ? net.minecraftforge.fluids.FluidStack.EMPTY : toForge(tanks[tank].fluid); + ? net.neoforged.neoforge.fluids.FluidStack.EMPTY : toForge(tanks[tank].fluid); } @Override public int getTankCapacity(int tank) { FluidTankInfo[] tanks = tanks(); return tank < 0 || tank >= tanks.length || tanks[tank] == null ? 0 : Math.max(0, tanks[tank].capacity); } - @Override public boolean isFluidValid(int tank, net.minecraftforge.fluids.FluidStack resource) { + @Override public boolean isFluidValid(int tank, net.neoforged.neoforge.fluids.FluidStack resource) { return resource != null && !resource.isEmpty() && getTankCapacity(tank) > 0 && handler.canFill(face, resource.getFluid()); } - @Override public int fill(net.minecraftforge.fluids.FluidStack resource, FluidAction action) { + @Override public int fill(net.neoforged.neoforge.fluids.FluidStack resource, FluidAction action) { FluidStack copy = fromForge(resource); if (copy == null || !handler.canFill(face, copy.getFluid())) return 0; int accepted = Math.max(0, Math.min(resource.getAmount(), handler.fill(face, copy, action.execute()))); if (accepted > 0 && action.execute()) changed.run(); return accepted; } - @Override public net.minecraftforge.fluids.FluidStack drain(net.minecraftforge.fluids.FluidStack resource, FluidAction action) { + @Override public net.neoforged.neoforge.fluids.FluidStack drain(net.neoforged.neoforge.fluids.FluidStack resource, FluidAction action) { FluidStack copy = fromForge(resource); - if (copy == null || !handler.canDrain(face, copy.getFluid())) return net.minecraftforge.fluids.FluidStack.EMPTY; + if (copy == null || !handler.canDrain(face, copy.getFluid())) return net.neoforged.neoforge.fluids.FluidStack.EMPTY; FluidStack result = handler.drain(face, copy, action.execute()); - if (result == null || !copy.isFluidEqual(result)) return net.minecraftforge.fluids.FluidStack.EMPTY; + if (result == null || !copy.isFluidEqual(result)) return net.neoforged.neoforge.fluids.FluidStack.EMPTY; return drained(result, resource.getAmount(), action); } - @Override public net.minecraftforge.fluids.FluidStack drain(int amount, FluidAction action) { - if (amount <= 0) return net.minecraftforge.fluids.FluidStack.EMPTY; + @Override public net.neoforged.neoforge.fluids.FluidStack drain(int amount, FluidAction action) { + if (amount <= 0) return net.neoforged.neoforge.fluids.FluidStack.EMPTY; FluidStack available = handler.drain(face, amount, false); - if (available == null || !handler.canDrain(face, available.getFluid())) return net.minecraftforge.fluids.FluidStack.EMPTY; + if (available == null || !handler.canDrain(face, available.getFluid())) return net.neoforged.neoforge.fluids.FluidStack.EMPTY; return drained(handler.drain(face, new FluidStack(available, Math.min(amount, available.amount)), action.execute()), amount, action); } - private net.minecraftforge.fluids.FluidStack drained(FluidStack result, int limit, FluidAction action) { - if (result == null || result.amount <= 0) return net.minecraftforge.fluids.FluidStack.EMPTY; - net.minecraftforge.fluids.FluidStack copy = toForge(new FluidStack(result, Math.min(limit, result.amount))); + private net.neoforged.neoforge.fluids.FluidStack drained(FluidStack result, int limit, FluidAction action) { + if (result == null || result.amount <= 0) return net.neoforged.neoforge.fluids.FluidStack.EMPTY; + net.neoforged.neoforge.fluids.FluidStack copy = toForge(new FluidStack(result, Math.min(limit, result.amount))); if (action.execute()) changed.run(); return copy; } diff --git a/src/main/java/zone/moddev/mc/basepower/util/InventoryLocks.java b/src/main/java/zone/moddev/mc/basepower/util/InventoryLocks.java index 081a5be8..45e11ec7 100644 --- a/src/main/java/zone/moddev/mc/basepower/util/InventoryLocks.java +++ b/src/main/java/zone/moddev/mc/basepower/util/InventoryLocks.java @@ -4,17 +4,17 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BaseContainerBlockEntity; import net.minecraft.world.LockCode; -import net.minecraftforge.fml.util.ObfuscationReflectionHelper; +import net.neoforged.fml.util.ObfuscationReflectionHelper; /** Keeps automation from bypassing vanilla container locks. */ public final class InventoryLocks { // Ordinary inventories need no vanilla field access or Forge name remapper. private static final class Fields { - static final Field CODE = ObfuscationReflectionHelper.findField(BaseContainerBlockEntity.class, "f_58621_"); + static final Field CODE = ObfuscationReflectionHelper.findField(BaseContainerBlockEntity.class, "lockKey"); static final Field FIRST = ObfuscationReflectionHelper.findField( - net.minecraft.world.CompoundContainer.class, "f_18910_"); + net.minecraft.world.CompoundContainer.class, "container1"); static final Field SECOND = ObfuscationReflectionHelper.findField( - net.minecraft.world.CompoundContainer.class, "f_18911_"); + net.minecraft.world.CompoundContainer.class, "container2"); } private InventoryLocks() {} diff --git a/src/main/java/zone/moddev/mc/basepower/util/MachineCapabilities.java b/src/main/java/zone/moddev/mc/basepower/util/MachineCapabilities.java index 31b5e81e..ee8f1472 100644 --- a/src/main/java/zone/moddev/mc/basepower/util/MachineCapabilities.java +++ b/src/main/java/zone/moddev/mc/basepower/util/MachineCapabilities.java @@ -1,49 +1,80 @@ package zone.moddev.mc.basepower.util; +import net.minecraft.core.registries.BuiltInRegistries; + +import cyano.poweradvantage.api.PoweredEntity; import cyano.poweradvantage.api.fluid.IAdvantageFluidHandler; import java.util.HashMap; import java.util.Map; +import java.util.Set; +import net.minecraft.core.Direction; import net.minecraft.world.Container; import net.minecraft.world.WorldlyContainer; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.core.Direction; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.items.wrapper.InvWrapper; -import net.minecraftforge.items.wrapper.SidedInvWrapper; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.wrapper.InvWrapper; +import net.neoforged.neoforge.items.wrapper.SidedInvWrapper; +import zone.moddev.mc.basepower.machines.conveyors.TileEntityConveyor; -/** Lazily built sided adapters, discarded when a machine is removed or unloaded. */ +/** Sided adapters registered through NeoForge; no Forge LazyOptional lifetime remains. */ public final class MachineCapabilities { private final BlockEntity owner; - private final Map> fluids = new HashMap<>(); - private final Map> items = new HashMap<>(); + private final Map fluids = new HashMap<>(); + private final Map items = new HashMap<>(); private boolean valid = true; public MachineCapabilities(BlockEntity owner) { this.owner = owner; } - public LazyOptional get(Capability capability, Direction face) { - if (!valid || owner.isRemoved()) return LazyOptional.empty(); - if (capability == ForgeCapabilities.FLUID_HANDLER && owner instanceof IAdvantageFluidHandler) { - return fluids.computeIfAbsent(face, side -> LazyOptional.of(() -> - new ForgeFluidAdapter((IAdvantageFluidHandler) owner, side, owner::setChanged))).cast(); - } - if (capability == ForgeCapabilities.ITEM_HANDLER && owner instanceof Container) { - return items.computeIfAbsent(face, side -> LazyOptional.of(() -> side != null && owner instanceof WorldlyContainer - ? new SidedInvWrapper((WorldlyContainer) owner, side) : new InvWrapper((Container) owner))).cast(); - } - return LazyOptional.empty(); + public IFluidHandler fluids(Direction face) { + if (!valid || owner.isRemoved() || !(owner instanceof IAdvantageFluidHandler handler)) return null; + return fluids.computeIfAbsent(face, side -> new ForgeFluidAdapter(handler, side, owner::setChanged)); + } + + public IItemHandler items(Direction face) { + if (!valid || owner.isRemoved() || !(owner instanceof Container inventory)) return null; + return items.computeIfAbsent(face, side -> side != null && inventory instanceof WorldlyContainer sided + ? new SidedInvWrapper(sided, side) : new InvWrapper(inventory)); } public void invalidate() { valid = false; - fluids.values().forEach(LazyOptional::invalidate); - items.values().forEach(LazyOptional::invalidate); fluids.clear(); items.clear(); + if (owner.getLevel() != null) owner.getLevel().invalidateCapabilities(owner.getBlockPos()); } public boolean isValid() { return valid; } + public void revive() { + if (valid) return; + valid = true; + if (owner.getLevel() != null) owner.getLevel().invalidateCapabilities(owner.getBlockPos()); + } + + private static MachineCapabilities adapters(BlockEntity tile) { + if (tile instanceof PoweredEntity powered) return powered.machineCapabilities(); + if (tile instanceof TileEntityConveyor conveyor) return conveyor.machineCapabilities(); + return null; + } - public void revive() { valid = true; } + public static void register(RegisterCapabilitiesEvent event) { + Set owners = Set.of("basepower", "basesteam", "baseelectric"); + Block[] blocks = BuiltInRegistries.BLOCK.entrySet().stream() + .filter(entry -> owners.contains(entry.getKey().location().getNamespace())) + .map(Map.Entry::getValue).toArray(Block[]::new); + event.registerBlock(Capabilities.FluidHandler.BLOCK, (level, pos, state, tile, side) -> { + MachineCapabilities caps = adapters(tile); + return caps == null ? null : caps.fluids(side); + }, blocks); + event.registerBlock(Capabilities.ItemHandler.BLOCK, (level, pos, state, tile, side) -> { + MachineCapabilities caps = adapters(tile); + return caps == null ? null : caps.items(side); + }, blocks); + event.registerBlock(Capabilities.EnergyStorage.BLOCK, (level, pos, state, tile, side) -> + tile != null && !tile.isRemoved() && tile instanceof net.neoforged.neoforge.energy.IEnergyStorage energy + ? energy : null, blocks); + } } diff --git a/src/main/java/zone/moddev/mc/basepower/util/PowerHelper.java b/src/main/java/zone/moddev/mc/basepower/util/PowerHelper.java index 2260fe1f..451deb68 100644 --- a/src/main/java/zone/moddev/mc/basepower/util/PowerHelper.java +++ b/src/main/java/zone/moddev/mc/basepower/util/PowerHelper.java @@ -6,7 +6,7 @@ import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.core.Direction; -import net.minecraftforge.common.capabilities.ForgeCapabilities; +import net.neoforged.neoforge.capabilities.Capabilities; /** * Collection of utility methods @@ -32,7 +32,8 @@ public static boolean areConnectable(PowerConnectorContext connection) { BlockEntity tile = connection.world.getBlockEntity(connection.otherBlockPosition); if (tile == null) return false; for (Direction side : Direction.values()) { - if (tile.getCapability(ForgeCapabilities.ENERGY, side).isPresent()) return true; + if (tile.getLevel() != null && tile.getLevel().getCapability( + Capabilities.EnergyStorage.BLOCK, tile.getBlockPos(), side) != null) return true; } } } diff --git a/src/main/java/zone/moddev/mc/basepower/util/RegistryValues.java b/src/main/java/zone/moddev/mc/basepower/util/RegistryValues.java new file mode 100644 index 00000000..26b3eaca --- /dev/null +++ b/src/main/java/zone/moddev/mc/basepower/util/RegistryValues.java @@ -0,0 +1,13 @@ +package zone.moddev.mc.basepower.util; + +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceLocation; + +/** Optional lookups must not mistake a defaulted registry's air for a real entry. */ +public final class RegistryValues { + private RegistryValues() { } + + public static T find(Registry registry, ResourceLocation id) { + return registry.getOptional(id).orElse(null); + } +} diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/neoforge.mods.toml similarity index 58% rename from src/main/resources/META-INF/mods.toml rename to src/main/resources/META-INF/neoforge.mods.toml index bf430c4a..abf5bfd8 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/neoforge.mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="${loader_version_range}" +loaderVersion="[4,)" license="LGPL-3.0-only" issueTrackerURL="https://github.com/MinecraftModDevelopmentMods/basePower/issues" @@ -9,32 +9,39 @@ version="${version}" displayName="basePower" displayURL="https://www.curseforge.com/minecraft/mc-mods/basepower" authors="DrCyano (aka Cyanobacterium), the MMD Team" -description='''API and shared machines for pressure, electricity, quantum power, fluids, and item transport.''' +description='''Shared machines, fluid handling and item transport for the Base Metals expansions.''' [[dependencies.basepower]] -modId="basemetals" -mandatory=false -versionRange="[3.1.2.120061,4.0.0)" -ordering="AFTER" +modId="neoforge" +type="required" +versionRange="[${neo_version},21.2)" +ordering="NONE" side="BOTH" [[dependencies.basepower]] -modId="orespawn" -mandatory=true -versionRange="[4.1.0.120061,5.0.0)" +modId="minecraft" +type="required" +versionRange="[1.21.1,1.21.2)" +ordering="NONE" +side="BOTH" + +[[dependencies.basepower]] +modId="basemetals" +type="required" +versionRange="[4.0.1,5)" ordering="AFTER" side="BOTH" [[dependencies.basepower]] -modId="forge" -mandatory=true -versionRange="${forge_version_range}" -ordering="NONE" +modId="mmdlib" +type="required" +versionRange="[2.0.2,3)" +ordering="AFTER" side="BOTH" [[dependencies.basepower]] -modId="minecraft" -mandatory=true -versionRange="${minecraft_version_range}" -ordering="NONE" +modId="orespawn" +type="required" +versionRange="[4.1.1,5)" +ordering="AFTER" side="BOTH" diff --git a/src/main/resources/data/basepower/advancement/recipes/converter_rf_electricity.json b/src/main/resources/data/basepower/advancement/recipes/converter_rf_electricity.json index 928d9048..d78e3707 100644 --- a/src/main/resources/data/basepower/advancement/recipes/converter_rf_electricity.json +++ b/src/main/resources/data/basepower/advancement/recipes/converter_rf_electricity.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:power_supply_units" + "items": "#c:power_supply_units" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:frames/steel" + "items": "#c:frames/steel" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/converter_rf_quantum.json b/src/main/resources/data/basepower/advancement/recipes/converter_rf_quantum.json index bbe4ff1b..c6804b97 100644 --- a/src/main/resources/data/basepower/advancement/recipes/converter_rf_quantum.json +++ b/src/main/resources/data/basepower/advancement/recipes/converter_rf_quantum.json @@ -18,7 +18,7 @@ "conditions": { "items": [ { - "items": "#forge:frames/steel" + "items": "#c:frames/steel" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/converter_rf_steam.json b/src/main/resources/data/basepower/advancement/recipes/converter_rf_steam.json index 09cf833a..56b681f5 100644 --- a/src/main/resources/data/basepower/advancement/recipes/converter_rf_steam.json +++ b/src/main/resources/data/basepower/advancement/recipes/converter_rf_steam.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:governors" + "items": "#c:governors" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:frames/steel" + "items": "#c:frames/steel" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/converter_tr_electricity_iron.json b/src/main/resources/data/basepower/advancement/recipes/converter_tr_electricity_iron.json index d547155c..fb6f86b5 100644 --- a/src/main/resources/data/basepower/advancement/recipes/converter_tr_electricity_iron.json +++ b/src/main/resources/data/basepower/advancement/recipes/converter_tr_electricity_iron.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/iron" + "items": "#c:ingots/iron" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:power_supply_units" + "items": "#c:power_supply_units" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/converter_tr_electricity_refined_iron.json b/src/main/resources/data/basepower/advancement/recipes/converter_tr_electricity_refined_iron.json index 77eda806..3cc47b7b 100644 --- a/src/main/resources/data/basepower/advancement/recipes/converter_tr_electricity_refined_iron.json +++ b/src/main/resources/data/basepower/advancement/recipes/converter_tr_electricity_refined_iron.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/refined_iron" + "items": "#c:ingots/refined_iron" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:power_supply_units" + "items": "#c:power_supply_units" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/fluid_discharge.json b/src/main/resources/data/basepower/advancement/recipes/fluid_discharge.json index bc16e154..0fbfcbde 100644 --- a/src/main/resources/data/basepower/advancement/recipes/fluid_discharge.json +++ b/src/main/resources/data/basepower/advancement/recipes/fluid_discharge.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:bars" + "items": "#c:bars" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:plates/steel" + "items": "#c:plates/steel" } ] } @@ -26,7 +26,7 @@ "conditions": { "items": [ { - "items": "#forge:frames/steel" + "items": "#c:frames/steel" } ] } @@ -36,7 +36,7 @@ "conditions": { "items": [ { - "items": "#forge:pipes" + "items": "#c:pipes" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/fluid_drain.json b/src/main/resources/data/basepower/advancement/recipes/fluid_drain.json index 8f78a994..e2633edd 100644 --- a/src/main/resources/data/basepower/advancement/recipes/fluid_drain.json +++ b/src/main/resources/data/basepower/advancement/recipes/fluid_drain.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:bars" + "items": "#c:bars" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:plates/steel" + "items": "#c:plates/steel" } ] } @@ -26,7 +26,7 @@ "conditions": { "items": [ { - "items": "#forge:frames/steel" + "items": "#c:frames/steel" } ] } @@ -36,7 +36,7 @@ "conditions": { "items": [ { - "items": "#forge:pipes" + "items": "#c:pipes" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/fluid_metal_tank_iron_normal.json b/src/main/resources/data/basepower/advancement/recipes/fluid_metal_tank_iron_normal.json index 4287d659..1fde9e20 100644 --- a/src/main/resources/data/basepower/advancement/recipes/fluid_metal_tank_iron_normal.json +++ b/src/main/resources/data/basepower/advancement/recipes/fluid_metal_tank_iron_normal.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/iron" + "items": "#c:ingots/iron" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:pipes" + "items": "#c:pipes" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/fluid_metal_tank_steel.json b/src/main/resources/data/basepower/advancement/recipes/fluid_metal_tank_steel.json index 96c83878..0b518a45 100644 --- a/src/main/resources/data/basepower/advancement/recipes/fluid_metal_tank_steel.json +++ b/src/main/resources/data/basepower/advancement/recipes/fluid_metal_tank_steel.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/steel" + "items": "#c:ingots/steel" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:pipes" + "items": "#c:pipes" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_copper_apocalyptic.json b/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_copper_apocalyptic.json index 299d2a2e..62aa8445 100644 --- a/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_copper_apocalyptic.json +++ b/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_copper_apocalyptic.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/copper" + "items": "#c:ingots/copper" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_copper_normal.json b/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_copper_normal.json index 2f56e9f8..b60fff5a 100644 --- a/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_copper_normal.json +++ b/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_copper_normal.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/copper" + "items": "#c:ingots/copper" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_iron_apocalyptic.json b/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_iron_apocalyptic.json index 7dfcae60..c52dcd5b 100644 --- a/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_iron_apocalyptic.json +++ b/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_iron_apocalyptic.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/iron" + "items": "#c:ingots/iron" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_iron_normal.json b/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_iron_normal.json index 3ebe5a3c..690e7ace 100644 --- a/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_iron_normal.json +++ b/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_iron_normal.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/iron" + "items": "#c:ingots/iron" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_iron_tech.json b/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_iron_tech.json index 05114108..7955c318 100644 --- a/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_iron_tech.json +++ b/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_iron_tech.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/iron" + "items": "#c:ingots/iron" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_lead_apocalyptic.json b/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_lead_apocalyptic.json index 3eb6bf99..5a8955d0 100644 --- a/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_lead_apocalyptic.json +++ b/src/main/resources/data/basepower/advancement/recipes/fluid_pipe_lead_apocalyptic.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/lead" + "items": "#c:ingots/lead" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/fluid_storage_tank.json b/src/main/resources/data/basepower/advancement/recipes/fluid_storage_tank.json index e2fdc4de..e63298dd 100644 --- a/src/main/resources/data/basepower/advancement/recipes/fluid_storage_tank.json +++ b/src/main/resources/data/basepower/advancement/recipes/fluid_storage_tank.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/plastic" + "items": "#c:ingots/plastic" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:pipes" + "items": "#c:pipes" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/fluid_switch.json b/src/main/resources/data/basepower/advancement/recipes/fluid_switch.json index 356ebc65..58e4a1c7 100644 --- a/src/main/resources/data/basepower/advancement/recipes/fluid_switch.json +++ b/src/main/resources/data/basepower/advancement/recipes/fluid_switch.json @@ -18,7 +18,7 @@ "conditions": { "items": [ { - "items": "#forge:pipes" + "items": "#c:pipes" } ] } @@ -28,7 +28,7 @@ "conditions": { "items": [ { - "items": "#forge:frames/steel" + "items": "#c:frames/steel" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/item_conveyor.json b/src/main/resources/data/basepower/advancement/recipes/item_conveyor.json index 67c696f5..86c55ced 100644 --- a/src/main/resources/data/basepower/advancement/recipes/item_conveyor.json +++ b/src/main/resources/data/basepower/advancement/recipes/item_conveyor.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:plates/steel" + "items": "#c:plates/steel" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:sprockets" + "items": "#c:sprockets" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/item_filter_ore.json b/src/main/resources/data/basepower/advancement/recipes/item_filter_ore.json index baf0362b..8de33846 100644 --- a/src/main/resources/data/basepower/advancement/recipes/item_filter_ore.json +++ b/src/main/resources/data/basepower/advancement/recipes/item_filter_ore.json @@ -18,7 +18,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/gold" + "items": "#c:ingots/gold" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/rotator_tool.json b/src/main/resources/data/basepower/advancement/recipes/rotator_tool.json index 8a43e0b5..6692dd53 100644 --- a/src/main/resources/data/basepower/advancement/recipes/rotator_tool.json +++ b/src/main/resources/data/basepower/advancement/recipes/rotator_tool.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/iron" + "items": "#c:ingots/iron" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:sprockets" + "items": "#c:sprockets" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/sprocket_bronze_nugget_tech_no_rod.json b/src/main/resources/data/basepower/advancement/recipes/sprocket_bronze_nugget_tech_no_rod.json index c34e4867..3120748b 100644 --- a/src/main/resources/data/basepower/advancement/recipes/sprocket_bronze_nugget_tech_no_rod.json +++ b/src/main/resources/data/basepower/advancement/recipes/sprocket_bronze_nugget_tech_no_rod.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/steel" + "items": "#c:ingots/steel" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:nuggets/bronze" + "items": "#c:nuggets/bronze" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/sprocket_rod_normal.json b/src/main/resources/data/basepower/advancement/recipes/sprocket_rod_normal.json index caae00f0..683abf87 100644 --- a/src/main/resources/data/basepower/advancement/recipes/sprocket_rod_normal.json +++ b/src/main/resources/data/basepower/advancement/recipes/sprocket_rod_normal.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/steel" + "items": "#c:ingots/steel" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:rods" + "items": "#c:rods" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/sprocket_rod_tech.json b/src/main/resources/data/basepower/advancement/recipes/sprocket_rod_tech.json index 47ea8711..491ca726 100644 --- a/src/main/resources/data/basepower/advancement/recipes/sprocket_rod_tech.json +++ b/src/main/resources/data/basepower/advancement/recipes/sprocket_rod_tech.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/steel" + "items": "#c:ingots/steel" } ] } @@ -16,7 +16,7 @@ "conditions": { "items": [ { - "items": "#forge:rods" + "items": "#c:rods" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/sprocket_stickwood_normal.json b/src/main/resources/data/basepower/advancement/recipes/sprocket_stickwood_normal.json index 3dd37bff..44717d62 100644 --- a/src/main/resources/data/basepower/advancement/recipes/sprocket_stickwood_normal.json +++ b/src/main/resources/data/basepower/advancement/recipes/sprocket_stickwood_normal.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:ingots/steel" + "items": "#c:ingots/steel" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/steel_frame.json b/src/main/resources/data/basepower/advancement/recipes/steel_frame.json index c14410df..016a7e82 100644 --- a/src/main/resources/data/basepower/advancement/recipes/steel_frame.json +++ b/src/main/resources/data/basepower/advancement/recipes/steel_frame.json @@ -6,7 +6,7 @@ "conditions": { "items": [ { - "items": "#forge:bars/steel" + "items": "#c:bars/steel" } ] } diff --git a/src/main/resources/data/basepower/advancement/recipes/still.json b/src/main/resources/data/basepower/advancement/recipes/still.json index c34476be..79f3bee4 100644 --- a/src/main/resources/data/basepower/advancement/recipes/still.json +++ b/src/main/resources/data/basepower/advancement/recipes/still.json @@ -18,7 +18,7 @@ "conditions": { "items": [ { - "items": "#forge:pipes" + "items": "#c:pipes" } ] } diff --git a/src/main/resources/data/basepower/recipe/converter_rf_electricity.json b/src/main/resources/data/basepower/recipe/converter_rf_electricity.json index f6842b6b..f6c887b4 100644 --- a/src/main/resources/data/basepower/recipe/converter_rf_electricity.json +++ b/src/main/resources/data/basepower/recipe/converter_rf_electricity.json @@ -5,10 +5,10 @@ ], "key": { "x": { - "tag": "forge:power_supply_units" + "tag": "c:power_supply_units" }, "y": { - "tag": "forge:frames/steel" + "tag": "c:frames/steel" }, "z": { "item": "minecraft:redstone_block" @@ -18,17 +18,19 @@ "id": "basepower:converter_rf_electricity" }, "group": "basepower:converter_rf_electricity", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:tag_not_empty", - "tag": "forge:power_supply_units" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:frames/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:power_supply_units" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:frames/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/converter_rf_quantum.json b/src/main/resources/data/basepower/recipe/converter_rf_quantum.json index 3d5d6d9b..13d12052 100644 --- a/src/main/resources/data/basepower/recipe/converter_rf_quantum.json +++ b/src/main/resources/data/basepower/recipe/converter_rf_quantum.json @@ -8,7 +8,7 @@ "item": "minecraft:ender_pearl" }, "y": { - "tag": "forge:frames/steel" + "tag": "c:frames/steel" }, "z": { "item": "minecraft:redstone_block" @@ -18,8 +18,10 @@ "id": "basepower:converter_rf_quantum" }, "group": "basepower:converter_rf_quantum", - "forge:condition": { - "type": "basepower:tag_not_empty", - "tag": "forge:frames/steel" - } + "neoforge:conditions": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:frames/steel" + } + ] } diff --git a/src/main/resources/data/basepower/recipe/converter_rf_steam.json b/src/main/resources/data/basepower/recipe/converter_rf_steam.json index 46b3a00b..048e1351 100644 --- a/src/main/resources/data/basepower/recipe/converter_rf_steam.json +++ b/src/main/resources/data/basepower/recipe/converter_rf_steam.json @@ -5,10 +5,10 @@ ], "key": { "x": { - "tag": "forge:governors" + "tag": "c:governors" }, "y": { - "tag": "forge:frames/steel" + "tag": "c:frames/steel" }, "z": { "item": "minecraft:redstone_block" @@ -18,17 +18,19 @@ "id": "basepower:converter_rf_steam" }, "group": "basepower:converter_rf_steam", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:tag_not_empty", - "tag": "forge:governors" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:frames/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:governors" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:frames/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/converter_tr_electricity_iron.json b/src/main/resources/data/basepower/recipe/converter_tr_electricity_iron.json index 3d674798..c5180906 100644 --- a/src/main/resources/data/basepower/recipe/converter_tr_electricity_iron.json +++ b/src/main/resources/data/basepower/recipe/converter_tr_electricity_iron.json @@ -7,31 +7,33 @@ ], "key": { "X": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" }, "Z": { - "tag": "forge:power_supply_units" + "tag": "c:power_supply_units" } }, "result": { "id": "basepower:converter_tr_electricity" }, "group": "basepower:converter_tr_electricity", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:tag_empty", - "tag": "forge:ingots/refined_iron" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/iron" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:power_supply_units" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:tag_empty", + "tag": "c:ingots/refined_iron" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/iron" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:power_supply_units" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/converter_tr_electricity_refined_iron.json b/src/main/resources/data/basepower/recipe/converter_tr_electricity_refined_iron.json index 2842bff1..e48b8d1b 100644 --- a/src/main/resources/data/basepower/recipe/converter_tr_electricity_refined_iron.json +++ b/src/main/resources/data/basepower/recipe/converter_tr_electricity_refined_iron.json @@ -7,27 +7,29 @@ ], "key": { "X": { - "tag": "forge:ingots/refined_iron" + "tag": "c:ingots/refined_iron" }, "Z": { - "tag": "forge:power_supply_units" + "tag": "c:power_supply_units" } }, "result": { "id": "basepower:converter_tr_electricity" }, "group": "basepower:converter_tr_electricity", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/refined_iron" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:power_supply_units" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/refined_iron" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:power_supply_units" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_fluid_discharge.json b/src/main/resources/data/basepower/recipe/crushing_fluid_discharge.json index d67b2602..35f1169a 100644 --- a/src/main/resources/data/basepower/recipe/crushing_fluid_discharge.json +++ b/src/main/resources/data/basepower/recipe/crushing_fluid_discharge.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": { "item": "basepower:fluid_discharge" }, @@ -7,17 +7,19 @@ "id": "basepower:fluid_pipe", "count": 2 }, - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "forge:mod_loaded", - "modid": "basemetals" - }, - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + }, + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_fluid_drain.json b/src/main/resources/data/basepower/recipe/crushing_fluid_drain.json index 5cb809dd..39481a1e 100644 --- a/src/main/resources/data/basepower/recipe/crushing_fluid_drain.json +++ b/src/main/resources/data/basepower/recipe/crushing_fluid_drain.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": { "item": "basepower:fluid_drain" }, @@ -7,17 +7,19 @@ "id": "basepower:fluid_pipe", "count": 2 }, - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "forge:mod_loaded", - "modid": "basemetals" - }, - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + }, + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_fluid_storage_tank.json b/src/main/resources/data/basepower/recipe/crushing_fluid_storage_tank.json index 300411bb..9dd7d876 100644 --- a/src/main/resources/data/basepower/recipe/crushing_fluid_storage_tank.json +++ b/src/main/resources/data/basepower/recipe/crushing_fluid_storage_tank.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": { "item": "basepower:fluid_storage_tank" }, @@ -7,17 +7,19 @@ "id": "basepower:fluid_pipe", "count": 1 }, - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "forge:mod_loaded", - "modid": "basemetals" - }, - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + }, + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_item_conveyor.json b/src/main/resources/data/basepower/recipe/crushing_item_conveyor.json index 38087ed5..6733daf6 100644 --- a/src/main/resources/data/basepower/recipe/crushing_item_conveyor.json +++ b/src/main/resources/data/basepower/recipe/crushing_item_conveyor.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": { "item": "basepower:item_conveyor" }, @@ -7,21 +7,23 @@ "id": "basemetals:steel_plate", "count": 1 }, - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "forge:mod_loaded", - "modid": "basemetals" - }, - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:plates/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + }, + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:plates/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_item_filter_block.json b/src/main/resources/data/basepower/recipe/crushing_item_filter_block.json index 9c786824..402dafd5 100644 --- a/src/main/resources/data/basepower/recipe/crushing_item_filter_block.json +++ b/src/main/resources/data/basepower/recipe/crushing_item_filter_block.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": { "item": "basepower:item_filter_block" }, @@ -7,21 +7,23 @@ "id": "basemetals:steel_plate", "count": 1 }, - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "forge:mod_loaded", - "modid": "basemetals" - }, - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:plates/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + }, + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:plates/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_item_filter_food.json b/src/main/resources/data/basepower/recipe/crushing_item_filter_food.json index 5388a4ab..ccc17436 100644 --- a/src/main/resources/data/basepower/recipe/crushing_item_filter_food.json +++ b/src/main/resources/data/basepower/recipe/crushing_item_filter_food.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": { "item": "basepower:item_filter_food" }, @@ -7,21 +7,23 @@ "id": "basemetals:steel_plate", "count": 1 }, - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "forge:mod_loaded", - "modid": "basemetals" - }, - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:plates/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + }, + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:plates/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_item_filter_fuel.json b/src/main/resources/data/basepower/recipe/crushing_item_filter_fuel.json index 261ea312..d4435ab1 100644 --- a/src/main/resources/data/basepower/recipe/crushing_item_filter_fuel.json +++ b/src/main/resources/data/basepower/recipe/crushing_item_filter_fuel.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": { "item": "basepower:item_filter_fuel" }, @@ -7,21 +7,23 @@ "id": "basemetals:steel_plate", "count": 1 }, - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "forge:mod_loaded", - "modid": "basemetals" - }, - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:plates/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + }, + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:plates/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_item_filter_inventory.json b/src/main/resources/data/basepower/recipe/crushing_item_filter_inventory.json index 6e7d8920..5f99f609 100644 --- a/src/main/resources/data/basepower/recipe/crushing_item_filter_inventory.json +++ b/src/main/resources/data/basepower/recipe/crushing_item_filter_inventory.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": { "item": "basepower:item_filter_inventory" }, @@ -7,21 +7,23 @@ "id": "basemetals:steel_plate", "count": 1 }, - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "forge:mod_loaded", - "modid": "basemetals" - }, - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:plates/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + }, + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:plates/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_item_filter_ore.json b/src/main/resources/data/basepower/recipe/crushing_item_filter_ore.json index 9f29239f..58439cd7 100644 --- a/src/main/resources/data/basepower/recipe/crushing_item_filter_ore.json +++ b/src/main/resources/data/basepower/recipe/crushing_item_filter_ore.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": { "item": "basepower:item_filter_ore" }, @@ -7,21 +7,23 @@ "id": "basemetals:steel_plate", "count": 1 }, - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "forge:mod_loaded", - "modid": "basemetals" - }, - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:plates/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + }, + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:plates/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_item_filter_overflow.json b/src/main/resources/data/basepower/recipe/crushing_item_filter_overflow.json index 5a78fe08..7753ecb8 100644 --- a/src/main/resources/data/basepower/recipe/crushing_item_filter_overflow.json +++ b/src/main/resources/data/basepower/recipe/crushing_item_filter_overflow.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": { "item": "basepower:item_filter_overflow" }, @@ -7,21 +7,23 @@ "id": "basemetals:steel_plate", "count": 1 }, - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "forge:mod_loaded", - "modid": "basemetals" - }, - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:plates/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + }, + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:plates/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_item_filter_plant.json b/src/main/resources/data/basepower/recipe/crushing_item_filter_plant.json index 6d1c44af..2abe804c 100644 --- a/src/main/resources/data/basepower/recipe/crushing_item_filter_plant.json +++ b/src/main/resources/data/basepower/recipe/crushing_item_filter_plant.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": { "item": "basepower:item_filter_plant" }, @@ -7,21 +7,23 @@ "id": "basemetals:steel_plate", "count": 1 }, - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "forge:mod_loaded", - "modid": "basemetals" - }, - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:plates/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + }, + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:plates/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_item_filter_smelt.json b/src/main/resources/data/basepower/recipe/crushing_item_filter_smelt.json index 186812e2..2301d05c 100644 --- a/src/main/resources/data/basepower/recipe/crushing_item_filter_smelt.json +++ b/src/main/resources/data/basepower/recipe/crushing_item_filter_smelt.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": { "item": "basepower:item_filter_smelt" }, @@ -7,21 +7,23 @@ "id": "basemetals:steel_plate", "count": 1 }, - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "forge:mod_loaded", - "modid": "basemetals" - }, - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:plates/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + }, + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:plates/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/crushing_potato_starch.json b/src/main/resources/data/basepower/recipe/crushing_potato_starch.json index c512154d..235a4fbb 100644 --- a/src/main/resources/data/basepower/recipe/crushing_potato_starch.json +++ b/src/main/resources/data/basepower/recipe/crushing_potato_starch.json @@ -1,5 +1,5 @@ { - "type": "basemetals:crushing", + "type": "mmdlib:crushing", "ingredient": [ { "item": "minecraft:potato" @@ -12,8 +12,10 @@ "id": "basepower:starch", "count": 1 }, - "forge:condition": { - "type": "forge:mod_loaded", - "modid": "basemetals" - } + "neoforge:conditions": [ + { + "type": "neoforge:mod_loaded", + "modid": "basemetals" + } + ] } diff --git a/src/main/resources/data/basepower/recipe/fluid_discharge.json b/src/main/resources/data/basepower/recipe/fluid_discharge.json index f11ceb8b..f0c37184 100644 --- a/src/main/resources/data/basepower/recipe/fluid_discharge.json +++ b/src/main/resources/data/basepower/recipe/fluid_discharge.json @@ -7,41 +7,43 @@ ], "key": { "x": { - "tag": "forge:bars" + "tag": "c:bars" }, "w": { - "tag": "forge:plates/steel" + "tag": "c:plates/steel" }, "#": { - "tag": "forge:frames/steel" + "tag": "c:frames/steel" }, "p": { - "tag": "forge:pipes" + "tag": "c:pipes" } }, "result": { "id": "basepower:fluid_discharge" }, "group": "basepower:fluid_discharge", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:tag_not_empty", - "tag": "forge:bars" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:frames/steel" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:pipes" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:plates/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:bars" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:frames/steel" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:pipes" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:plates/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/fluid_drain.json b/src/main/resources/data/basepower/recipe/fluid_drain.json index 1e88fc2f..b3e81854 100644 --- a/src/main/resources/data/basepower/recipe/fluid_drain.json +++ b/src/main/resources/data/basepower/recipe/fluid_drain.json @@ -7,41 +7,43 @@ ], "key": { "x": { - "tag": "forge:bars" + "tag": "c:bars" }, "w": { - "tag": "forge:plates/steel" + "tag": "c:plates/steel" }, "#": { - "tag": "forge:frames/steel" + "tag": "c:frames/steel" }, "p": { - "tag": "forge:pipes" + "tag": "c:pipes" } }, "result": { "id": "basepower:fluid_drain" }, "group": "basepower:fluid_drain", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:tag_not_empty", - "tag": "forge:bars" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:frames/steel" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:pipes" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:plates/steel" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:bars" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:frames/steel" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:pipes" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:plates/steel" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/fluid_metal_tank_iron_normal.json b/src/main/resources/data/basepower/recipe/fluid_metal_tank_iron_normal.json index c542ca19..4b17326e 100644 --- a/src/main/resources/data/basepower/recipe/fluid_metal_tank_iron_normal.json +++ b/src/main/resources/data/basepower/recipe/fluid_metal_tank_iron_normal.json @@ -7,31 +7,33 @@ ], "key": { "x": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" }, "p": { - "tag": "forge:pipes" + "tag": "c:pipes" } }, "result": { "id": "basepower:fluid_metal_tank" }, "group": "basepower:fluid_metal_tank", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:recipe_mode", - "mode": "NORMAL" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/iron" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:pipes" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:recipe_mode", + "mode": "NORMAL" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/iron" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:pipes" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/fluid_metal_tank_steel.json b/src/main/resources/data/basepower/recipe/fluid_metal_tank_steel.json index 3bf46ef3..3666d54a 100644 --- a/src/main/resources/data/basepower/recipe/fluid_metal_tank_steel.json +++ b/src/main/resources/data/basepower/recipe/fluid_metal_tank_steel.json @@ -7,27 +7,29 @@ ], "key": { "x": { - "tag": "forge:ingots/steel" + "tag": "c:ingots/steel" }, "p": { - "tag": "forge:pipes" + "tag": "c:pipes" } }, "result": { "id": "basepower:fluid_metal_tank" }, "group": "basepower:fluid_metal_tank", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/steel" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:pipes" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/steel" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:pipes" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/fluid_pipe_copper_apocalyptic.json b/src/main/resources/data/basepower/recipe/fluid_pipe_copper_apocalyptic.json index 4c3063d2..c3bc59be 100644 --- a/src/main/resources/data/basepower/recipe/fluid_pipe_copper_apocalyptic.json +++ b/src/main/resources/data/basepower/recipe/fluid_pipe_copper_apocalyptic.json @@ -7,7 +7,7 @@ ], "key": { "x": { - "tag": "forge:ingots/copper" + "tag": "c:ingots/copper" } }, "result": { @@ -15,17 +15,19 @@ "count": 3 }, "group": "basepower:fluid_pipe", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/copper" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/copper" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/fluid_pipe_copper_normal.json b/src/main/resources/data/basepower/recipe/fluid_pipe_copper_normal.json index 5a01c2f0..0e65d005 100644 --- a/src/main/resources/data/basepower/recipe/fluid_pipe_copper_normal.json +++ b/src/main/resources/data/basepower/recipe/fluid_pipe_copper_normal.json @@ -7,7 +7,7 @@ ], "key": { "x": { - "tag": "forge:ingots/copper" + "tag": "c:ingots/copper" } }, "result": { @@ -15,17 +15,19 @@ "count": 6 }, "group": "basepower:fluid_pipe", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:recipe_mode", - "mode": "NORMAL" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/copper" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:recipe_mode", + "mode": "NORMAL" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/copper" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/fluid_pipe_iron_apocalyptic.json b/src/main/resources/data/basepower/recipe/fluid_pipe_iron_apocalyptic.json index 41c45631..0f13ad0b 100644 --- a/src/main/resources/data/basepower/recipe/fluid_pipe_iron_apocalyptic.json +++ b/src/main/resources/data/basepower/recipe/fluid_pipe_iron_apocalyptic.json @@ -7,7 +7,7 @@ ], "key": { "x": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" } }, "result": { @@ -15,17 +15,19 @@ "count": 3 }, "group": "basepower:fluid_pipe", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/iron" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/iron" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/fluid_pipe_iron_normal.json b/src/main/resources/data/basepower/recipe/fluid_pipe_iron_normal.json index 74d3213f..8507b47b 100644 --- a/src/main/resources/data/basepower/recipe/fluid_pipe_iron_normal.json +++ b/src/main/resources/data/basepower/recipe/fluid_pipe_iron_normal.json @@ -7,7 +7,7 @@ ], "key": { "x": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" } }, "result": { @@ -15,17 +15,19 @@ "count": 6 }, "group": "basepower:fluid_pipe", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:recipe_mode", - "mode": "NORMAL" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/iron" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:recipe_mode", + "mode": "NORMAL" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/iron" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/fluid_pipe_iron_tech.json b/src/main/resources/data/basepower/recipe/fluid_pipe_iron_tech.json index fa0bc1c4..530bd08e 100644 --- a/src/main/resources/data/basepower/recipe/fluid_pipe_iron_tech.json +++ b/src/main/resources/data/basepower/recipe/fluid_pipe_iron_tech.json @@ -7,7 +7,7 @@ ], "key": { "x": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" } }, "result": { @@ -15,17 +15,19 @@ "count": 6 }, "group": "basepower:fluid_pipe", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:recipe_mode", - "mode": "TECH_PROGRESSION" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/iron" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:recipe_mode", + "mode": "TECH_PROGRESSION" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/iron" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/fluid_pipe_lead_apocalyptic.json b/src/main/resources/data/basepower/recipe/fluid_pipe_lead_apocalyptic.json index 42751b1d..7ac81e03 100644 --- a/src/main/resources/data/basepower/recipe/fluid_pipe_lead_apocalyptic.json +++ b/src/main/resources/data/basepower/recipe/fluid_pipe_lead_apocalyptic.json @@ -7,7 +7,7 @@ ], "key": { "x": { - "tag": "forge:ingots/lead" + "tag": "c:ingots/lead" } }, "result": { @@ -15,17 +15,19 @@ "count": 3 }, "group": "basepower:fluid_pipe", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:recipe_mode", - "mode": "APOCALYPTIC" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/lead" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:recipe_mode", + "mode": "APOCALYPTIC" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/lead" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/fluid_storage_tank.json b/src/main/resources/data/basepower/recipe/fluid_storage_tank.json index f9d9633e..ae68054a 100644 --- a/src/main/resources/data/basepower/recipe/fluid_storage_tank.json +++ b/src/main/resources/data/basepower/recipe/fluid_storage_tank.json @@ -7,27 +7,29 @@ ], "key": { "x": { - "tag": "forge:ingots/plastic" + "tag": "c:ingots/plastic" }, "p": { - "tag": "forge:pipes" + "tag": "c:pipes" } }, "result": { "id": "basepower:fluid_storage_tank" }, "group": "basepower:fluid_storage_tank", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/plastic" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:pipes" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/plastic" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:pipes" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/fluid_switch.json b/src/main/resources/data/basepower/recipe/fluid_switch.json index 91a47304..527de308 100644 --- a/src/main/resources/data/basepower/recipe/fluid_switch.json +++ b/src/main/resources/data/basepower/recipe/fluid_switch.json @@ -9,27 +9,29 @@ "item": "minecraft:lever" }, "p": { - "tag": "forge:pipes" + "tag": "c:pipes" }, "f": { - "tag": "forge:frames/steel" + "tag": "c:frames/steel" } }, "result": { "id": "basepower:fluid_switch" }, "group": "basepower:fluid_switch", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:tag_not_empty", - "tag": "forge:frames/steel" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:pipes" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:frames/steel" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:pipes" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/item_conveyor.json b/src/main/resources/data/basepower/recipe/item_conveyor.json index a636d2de..9b7e8a4a 100644 --- a/src/main/resources/data/basepower/recipe/item_conveyor.json +++ b/src/main/resources/data/basepower/recipe/item_conveyor.json @@ -7,10 +7,10 @@ ], "key": { "x": { - "tag": "forge:plates/steel" + "tag": "c:plates/steel" }, "g": { - "tag": "forge:sprockets" + "tag": "c:sprockets" }, "h": { "item": "minecraft:hopper" @@ -21,17 +21,19 @@ "count": 5 }, "group": "basepower:item_conveyor", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:tag_not_empty", - "tag": "forge:plates/steel" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:sprockets" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:plates/steel" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:sprockets" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/item_filter_ore.json b/src/main/resources/data/basepower/recipe/item_filter_ore.json index b5279c3f..019920ed 100644 --- a/src/main/resources/data/basepower/recipe/item_filter_ore.json +++ b/src/main/resources/data/basepower/recipe/item_filter_ore.json @@ -10,7 +10,7 @@ "item": "basepower:item_conveyor" }, "y": { - "tag": "forge:ingots/gold" + "tag": "c:ingots/gold" }, "z": { "item": "minecraft:oak_pressure_plate" @@ -20,8 +20,10 @@ "id": "basepower:item_filter_ore" }, "group": "basepower:item_filter_ore", - "forge:condition": { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/gold" - } + "neoforge:conditions": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/gold" + } + ] } diff --git a/src/main/resources/data/basepower/recipe/rotator_tool.json b/src/main/resources/data/basepower/recipe/rotator_tool.json index 8f4b8f7b..fed618c1 100644 --- a/src/main/resources/data/basepower/recipe/rotator_tool.json +++ b/src/main/resources/data/basepower/recipe/rotator_tool.json @@ -7,27 +7,29 @@ ], "key": { "x": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" }, "*": { - "tag": "forge:sprockets" + "tag": "c:sprockets" } }, "result": { "id": "basepower:rotator_tool" }, "group": "basepower:rotator_tool", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/iron" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:sprockets" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/iron" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:sprockets" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/sprocket_bronze_nugget_tech_no_rod.json b/src/main/resources/data/basepower/recipe/sprocket_bronze_nugget_tech_no_rod.json index e642b9df..6dd91afd 100644 --- a/src/main/resources/data/basepower/recipe/sprocket_bronze_nugget_tech_no_rod.json +++ b/src/main/resources/data/basepower/recipe/sprocket_bronze_nugget_tech_no_rod.json @@ -7,10 +7,10 @@ ], "key": { "x": { - "tag": "forge:ingots/steel" + "tag": "c:ingots/steel" }, "/": { - "tag": "forge:nuggets/bronze" + "tag": "c:nuggets/bronze" } }, "result": { @@ -18,25 +18,27 @@ "count": 4 }, "group": "basepower:sprocket", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:recipe_mode", - "mode": "TECH_PROGRESSION" - }, - { - "type": "basepower:tag_empty", - "tag": "forge:rods" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/steel" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:nuggets/bronze" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:recipe_mode", + "mode": "TECH_PROGRESSION" + }, + { + "type": "basepower:tag_empty", + "tag": "c:rods" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/steel" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:nuggets/bronze" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/sprocket_rod_normal.json b/src/main/resources/data/basepower/recipe/sprocket_rod_normal.json index 1adaae36..9e595a96 100644 --- a/src/main/resources/data/basepower/recipe/sprocket_rod_normal.json +++ b/src/main/resources/data/basepower/recipe/sprocket_rod_normal.json @@ -7,10 +7,10 @@ ], "key": { "x": { - "tag": "forge:ingots/steel" + "tag": "c:ingots/steel" }, "/": { - "tag": "forge:rods" + "tag": "c:rods" } }, "result": { @@ -18,21 +18,23 @@ "count": 4 }, "group": "basepower:sprocket", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:recipe_mode", - "mode": "NORMAL" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/steel" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:rods" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:recipe_mode", + "mode": "NORMAL" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/steel" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:rods" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/sprocket_rod_tech.json b/src/main/resources/data/basepower/recipe/sprocket_rod_tech.json index c9454d7c..8bdfc613 100644 --- a/src/main/resources/data/basepower/recipe/sprocket_rod_tech.json +++ b/src/main/resources/data/basepower/recipe/sprocket_rod_tech.json @@ -7,10 +7,10 @@ ], "key": { "x": { - "tag": "forge:ingots/steel" + "tag": "c:ingots/steel" }, "/": { - "tag": "forge:rods" + "tag": "c:rods" } }, "result": { @@ -18,21 +18,23 @@ "count": 4 }, "group": "basepower:sprocket", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:recipe_mode", - "mode": "TECH_PROGRESSION" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/steel" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:rods" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:recipe_mode", + "mode": "TECH_PROGRESSION" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/steel" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:rods" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/sprocket_stickwood_normal.json b/src/main/resources/data/basepower/recipe/sprocket_stickwood_normal.json index 60cdda34..39fa3ae1 100644 --- a/src/main/resources/data/basepower/recipe/sprocket_stickwood_normal.json +++ b/src/main/resources/data/basepower/recipe/sprocket_stickwood_normal.json @@ -7,10 +7,10 @@ ], "key": { "x": { - "tag": "forge:ingots/steel" + "tag": "c:ingots/steel" }, "/": { - "tag": "forge:rods/wooden" + "tag": "c:rods/wooden" } }, "result": { @@ -18,21 +18,23 @@ "count": 4 }, "group": "basepower:sprocket", - "forge:condition": { - "type": "forge:and", - "values": [ - { - "type": "basepower:recipe_mode", - "mode": "NORMAL" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:ingots/steel" - }, - { - "type": "basepower:tag_not_empty", - "tag": "forge:rods/wooden" - } - ] - } + "neoforge:conditions": [ + { + "type": "neoforge:and", + "values": [ + { + "type": "basepower:recipe_mode", + "mode": "NORMAL" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:ingots/steel" + }, + { + "type": "basepower:tag_not_empty", + "tag": "c:rods/wooden" + } + ] + } + ] } diff --git a/src/main/resources/data/basepower/recipe/steel_frame.json b/src/main/resources/data/basepower/recipe/steel_frame.json index b2cbe868..9b32fe86 100644 --- a/src/main/resources/data/basepower/recipe/steel_frame.json +++ b/src/main/resources/data/basepower/recipe/steel_frame.json @@ -7,15 +7,17 @@ ], "key": { "x": { - "tag": "forge:bars/steel" + "tag": "c:bars/steel" } }, "result": { "id": "basepower:steel_frame" }, "group": "basepower:steel_frame", - "forge:condition": { - "type": "basepower:tag_not_empty", - "tag": "forge:bars/steel" - } + "neoforge:conditions": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:bars/steel" + } + ] } diff --git a/src/main/resources/data/basepower/recipe/still.json b/src/main/resources/data/basepower/recipe/still.json index 7ef75161..04029d05 100644 --- a/src/main/resources/data/basepower/recipe/still.json +++ b/src/main/resources/data/basepower/recipe/still.json @@ -9,7 +9,7 @@ "item": "minecraft:bucket" }, "p": { - "tag": "forge:pipes" + "tag": "c:pipes" }, "f": { "item": "minecraft:furnace" @@ -19,8 +19,10 @@ "id": "basepower:still" }, "group": "basepower:still", - "forge:condition": { - "type": "basepower:tag_not_empty", - "tag": "forge:pipes" - } + "neoforge:conditions": [ + { + "type": "basepower:tag_not_empty", + "tag": "c:pipes" + } + ] } diff --git a/src/main/resources/data/c/tags/item/bars.json b/src/main/resources/data/c/tags/item/bars.json new file mode 100644 index 00000000..f801f1ff --- /dev/null +++ b/src/main/resources/data/c/tags/item/bars.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "minecraft:iron_bars", + "#c:bars/steel" + ] +} diff --git a/src/main/resources/data/c/tags/item/bars/steel.json b/src/main/resources/data/c/tags/item/bars/steel.json new file mode 100644 index 00000000..e8c84989 --- /dev/null +++ b/src/main/resources/data/c/tags/item/bars/steel.json @@ -0,0 +1,9 @@ +{ + "replace": false, + "values": [ + { + "id": "basemetals:steel_bars", + "required": false + } + ] +} diff --git a/src/main/resources/data/c/tags/item/dusts/charcoal.json b/src/main/resources/data/c/tags/item/dusts/charcoal.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/dusts/charcoal.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/dusts/coal.json b/src/main/resources/data/c/tags/item/dusts/coal.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/dusts/coal.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/dusts/lead.json b/src/main/resources/data/c/tags/item/dusts/lead.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/dusts/lead.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/dusts/redstone.json b/src/main/resources/data/c/tags/item/dusts/redstone.json new file mode 100644 index 00000000..ffe4ba88 --- /dev/null +++ b/src/main/resources/data/c/tags/item/dusts/redstone.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:redstone" + ] +} diff --git a/src/main/resources/data/c/tags/item/dusts/silver.json b/src/main/resources/data/c/tags/item/dusts/silver.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/dusts/silver.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/dusts/tin.json b/src/main/resources/data/c/tags/item/dusts/tin.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/dusts/tin.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/frames/steel.json b/src/main/resources/data/c/tags/item/frames/steel.json new file mode 100644 index 00000000..2ec93a5c --- /dev/null +++ b/src/main/resources/data/c/tags/item/frames/steel.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "basepower:steel_frame" + ] +} diff --git a/src/main/resources/data/c/tags/item/gears.json b/src/main/resources/data/c/tags/item/gears.json new file mode 100644 index 00000000..28b81e98 --- /dev/null +++ b/src/main/resources/data/c/tags/item/gears.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "basepower:sprocket" + ] +} diff --git a/src/main/resources/data/c/tags/item/gears/steel.json b/src/main/resources/data/c/tags/item/gears/steel.json new file mode 100644 index 00000000..28b81e98 --- /dev/null +++ b/src/main/resources/data/c/tags/item/gears/steel.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "basepower:sprocket" + ] +} diff --git a/src/main/resources/data/c/tags/item/gems/diamond.json b/src/main/resources/data/c/tags/item/gems/diamond.json new file mode 100644 index 00000000..0b7f5224 --- /dev/null +++ b/src/main/resources/data/c/tags/item/gems/diamond.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:diamond" + ] +} diff --git a/src/main/resources/data/c/tags/item/gems/emerald.json b/src/main/resources/data/c/tags/item/gems/emerald.json new file mode 100644 index 00000000..0f3bdf92 --- /dev/null +++ b/src/main/resources/data/c/tags/item/gems/emerald.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:emerald" + ] +} diff --git a/src/main/resources/data/c/tags/item/governors.json b/src/main/resources/data/c/tags/item/governors.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/governors.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/ingots/brass.json b/src/main/resources/data/c/tags/item/ingots/brass.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/ingots/brass.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/ingots/copper.json b/src/main/resources/data/c/tags/item/ingots/copper.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/ingots/copper.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/ingots/gold.json b/src/main/resources/data/c/tags/item/ingots/gold.json new file mode 100644 index 00000000..74a63e9c --- /dev/null +++ b/src/main/resources/data/c/tags/item/ingots/gold.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:gold_ingot" + ] +} diff --git a/src/main/resources/data/c/tags/item/ingots/iron.json b/src/main/resources/data/c/tags/item/ingots/iron.json new file mode 100644 index 00000000..5e89bbc7 --- /dev/null +++ b/src/main/resources/data/c/tags/item/ingots/iron.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:iron_ingot" + ] +} diff --git a/src/main/resources/data/c/tags/item/ingots/lead.json b/src/main/resources/data/c/tags/item/ingots/lead.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/ingots/lead.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/ingots/nickel.json b/src/main/resources/data/c/tags/item/ingots/nickel.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/ingots/nickel.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/ingots/plastic.json b/src/main/resources/data/c/tags/item/ingots/plastic.json new file mode 100644 index 00000000..d922cf4f --- /dev/null +++ b/src/main/resources/data/c/tags/item/ingots/plastic.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "basepower:bioplastic_ingot" + ] +} diff --git a/src/main/resources/data/c/tags/item/ingots/refined_iron.json b/src/main/resources/data/c/tags/item/ingots/refined_iron.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/ingots/refined_iron.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/ingots/rubber.json b/src/main/resources/data/c/tags/item/ingots/rubber.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/ingots/rubber.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/ingots/steel.json b/src/main/resources/data/c/tags/item/ingots/steel.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/ingots/steel.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/ingots/zinc.json b/src/main/resources/data/c/tags/item/ingots/zinc.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/ingots/zinc.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/nuggets/bronze.json b/src/main/resources/data/c/tags/item/nuggets/bronze.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/nuggets/bronze.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/nuggets/copper.json b/src/main/resources/data/c/tags/item/nuggets/copper.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/nuggets/copper.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/nuggets/gold.json b/src/main/resources/data/c/tags/item/nuggets/gold.json new file mode 100644 index 00000000..3c978eae --- /dev/null +++ b/src/main/resources/data/c/tags/item/nuggets/gold.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:gold_nugget" + ] +} diff --git a/src/main/resources/data/c/tags/item/nuggets/iron.json b/src/main/resources/data/c/tags/item/nuggets/iron.json new file mode 100644 index 00000000..2e6bd5ff --- /dev/null +++ b/src/main/resources/data/c/tags/item/nuggets/iron.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:iron_nugget" + ] +} diff --git a/src/main/resources/data/c/tags/item/nuggets/lead.json b/src/main/resources/data/c/tags/item/nuggets/lead.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/nuggets/lead.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/nuggets/tin.json b/src/main/resources/data/c/tags/item/nuggets/tin.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/nuggets/tin.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/pipes.json b/src/main/resources/data/c/tags/item/pipes.json new file mode 100644 index 00000000..8c70e3c2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/pipes.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "basepower:fluid_pipe" + ] +} diff --git a/src/main/resources/data/c/tags/item/plastic.json b/src/main/resources/data/c/tags/item/plastic.json new file mode 100644 index 00000000..d922cf4f --- /dev/null +++ b/src/main/resources/data/c/tags/item/plastic.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "basepower:bioplastic_ingot" + ] +} diff --git a/src/main/resources/data/c/tags/item/plates/copper.json b/src/main/resources/data/c/tags/item/plates/copper.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/plates/copper.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/plates/iron.json b/src/main/resources/data/c/tags/item/plates/iron.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/plates/iron.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/plates/steel.json b/src/main/resources/data/c/tags/item/plates/steel.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/plates/steel.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/power_supply_units.json b/src/main/resources/data/c/tags/item/power_supply_units.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/power_supply_units.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/rods.json b/src/main/resources/data/c/tags/item/rods.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/rods.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/rods/copper.json b/src/main/resources/data/c/tags/item/rods/copper.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/rods/copper.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/rods/wooden.json b/src/main/resources/data/c/tags/item/rods/wooden.json new file mode 100644 index 00000000..90f5f079 --- /dev/null +++ b/src/main/resources/data/c/tags/item/rods/wooden.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:stick" + ] +} diff --git a/src/main/resources/data/c/tags/item/rubber.json b/src/main/resources/data/c/tags/item/rubber.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/rubber.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/c/tags/item/sprockets.json b/src/main/resources/data/c/tags/item/sprockets.json new file mode 100644 index 00000000..28b81e98 --- /dev/null +++ b/src/main/resources/data/c/tags/item/sprockets.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "basepower:sprocket" + ] +} diff --git a/src/main/resources/data/c/tags/item/sprockets/steel.json b/src/main/resources/data/c/tags/item/sprockets/steel.json new file mode 100644 index 00000000..28b81e98 --- /dev/null +++ b/src/main/resources/data/c/tags/item/sprockets/steel.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "basepower:sprocket" + ] +} diff --git a/src/main/resources/data/c/tags/item/stone.json b/src/main/resources/data/c/tags/item/stone.json new file mode 100644 index 00000000..0e81af11 --- /dev/null +++ b/src/main/resources/data/c/tags/item/stone.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:stone" + ] +} diff --git a/src/main/resources/data/c/tags/item/storage_blocks/diamond.json b/src/main/resources/data/c/tags/item/storage_blocks/diamond.json new file mode 100644 index 00000000..34d42073 --- /dev/null +++ b/src/main/resources/data/c/tags/item/storage_blocks/diamond.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:diamond_block" + ] +} diff --git a/src/main/resources/data/c/tags/item/storage_blocks/steel.json b/src/main/resources/data/c/tags/item/storage_blocks/steel.json new file mode 100644 index 00000000..5d341ba2 --- /dev/null +++ b/src/main/resources/data/c/tags/item/storage_blocks/steel.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} diff --git a/src/main/resources/data/forge/tags/block/stone.json b/src/main/resources/data/forge/tags/block/stone.json new file mode 100644 index 00000000..a3d31e10 --- /dev/null +++ b/src/main/resources/data/forge/tags/block/stone.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": ["minecraft:stone"] +} diff --git a/src/main/resources/data/forge/tags/item/bars.json b/src/main/resources/data/forge/tags/item/bars.json index e58980d9..f801f1ff 100644 --- a/src/main/resources/data/forge/tags/item/bars.json +++ b/src/main/resources/data/forge/tags/item/bars.json @@ -2,6 +2,6 @@ "replace": false, "values": [ "minecraft:iron_bars", - "#forge:bars/steel" + "#c:bars/steel" ] } diff --git a/src/main/resources/data/forge/loot_modifiers/global_loot_modifiers.json b/src/main/resources/data/neoforge/loot_modifiers/global_loot_modifiers.json similarity index 100% rename from src/main/resources/data/forge/loot_modifiers/global_loot_modifiers.json rename to src/main/resources/data/neoforge/loot_modifiers/global_loot_modifiers.json diff --git a/src/test/java/zone/moddev/mc/basepower/migration/LegacyEntityAttributeAliasesTest.java b/src/test/java/zone/moddev/mc/basepower/migration/LegacyEntityAttributeAliasesTest.java index f0fc8837..77026dfe 100644 --- a/src/test/java/zone/moddev/mc/basepower/migration/LegacyEntityAttributeAliasesTest.java +++ b/src/test/java/zone/moddev/mc/basepower/migration/LegacyEntityAttributeAliasesTest.java @@ -21,7 +21,7 @@ import net.minecraft.util.datafix.fixes.References; import net.minecraft.server.Bootstrap; import net.minecraft.server.level.ServerLevel; -import net.minecraftforge.common.ForgeMod; +import net.neoforged.neoforge.common.NeoForgeMod; import org.junit.BeforeClass; import org.junit.Test; @@ -41,7 +41,7 @@ public class LegacyEntityAttributeAliasesTest { LegacyEntityDataFixes.finish(root); CompoundTag actual = root.getCompound("Level").getList("Entities", 10).getCompound(0); CompoundTag expected = before.copy(); - expected.getList("Attributes", 10).getCompound(0).putString("Name", "forge:swim_speed"); + expected.getList("Attributes", 10).getCompound(0).putString("Name", "neoforge:swim_speed"); expected = LegacyForgeAttributeRegistryTest.nativeAttributeRecord(expected); assertEquals(expected, actual); assertEquals(before, entity); @@ -53,7 +53,7 @@ public class LegacyEntityAttributeAliasesTest { LegacyEntityDataFixes.finish(root); CompoundTag attribute = root.getCompound("Level").getList("Entities", 10).getCompound(0) .getList("attributes", 10).getCompound(0); - assertEquals("forge:swim_speed", attribute.getString("id")); + assertEquals("neoforge:swim_speed", attribute.getString("id")); assertEquals(2D, attribute.getDouble("base"), 0D); assertEquals("keep-attribute-field", attribute.getString("PrivateNote")); CompoundTag modifier = attribute.getList("modifiers", 10).getCompound(0); @@ -73,7 +73,7 @@ public class LegacyEntityAttributeAliasesTest { CompoundTag root = chunk(parent); LegacyEntityDataFixes.prepare(root); LegacyEntityDataFixes.finish(root); CompoundTag actual = root.getCompound("Level").getList("Entities", 10).getCompound(0); - assertEquals("forge:swim_speed", actual.getList("Passengers", 10).getCompound(0) + assertEquals("neoforge:swim_speed", actual.getList("Passengers", 10).getCompound(0) .getList("attributes", 10).getCompound(0).getString("id")); assertEquals(foreign, actual.getCompound("PrivateData")); assertEquals(foreign, actual.getCompound("ForgeData")); @@ -81,12 +81,12 @@ public class LegacyEntityAttributeAliasesTest { } @Test public void rejectsLegacyNativeCollisionWithoutChangingChunk() { - assertCollision("forge.swimSpeed", "forge:swim_speed"); + assertCollision("forge.swimSpeed", "neoforge:swim_speed"); } @Test public void rejectsDuplicateLegacyOrNativeAliasWithoutChangingChunk() { assertCollision("forge.swimSpeed", "forge.swimSpeed"); - assertCollision("forge:swim_speed", "forge:swim_speed"); + assertCollision("neoforge:swim_speed", "neoforge:swim_speed"); } @Test public void exactAliasDoesNotRenameOtherForgeOrUnknownAttributes() { @@ -131,16 +131,16 @@ public class LegacyEntityAttributeAliasesTest { CompoundTag source = player(vehicle), expected = source.copy(); CompoundTag result = LegacyPlayerDataFixes.update(new RecordingFixer(value -> { CompoundTag rootVehicle = value.getCompound("RootVehicle").getCompound("Entity"); - assertEquals("forge:swim_speed", rootVehicle.getList("Attributes", 10).getCompound(0).getString("Name")); - assertEquals("forge:swim_speed", rootVehicle.getList("Passengers", 10).getCompound(0) + assertEquals("neoforge:swim_speed", rootVehicle.getList("Attributes", 10).getCompound(0).getString("Name")); + assertEquals("neoforge:swim_speed", rootVehicle.getList("Passengers", 10).getCompound(0) .getList("Attributes", 10).getCompound(0).getString("Name")); return value; }), DataFixTypes.PLAYER, source, 512); assertEquals(expected, source); expected.getCompound("RootVehicle").getCompound("Entity").getList("Attributes", 10) - .getCompound(0).putString("Name", "forge:swim_speed"); + .getCompound(0).putString("Name", "neoforge:swim_speed"); expected.getCompound("RootVehicle").getCompound("Entity").getList("Passengers", 10).getCompound(0) - .getList("Attributes", 10).getCompound(0).putString("Name", "forge:swim_speed"); + .getList("Attributes", 10).getCompound(0).putString("Name", "neoforge:swim_speed"); assertEquals(expected, result); } @@ -161,7 +161,7 @@ public class LegacyEntityAttributeAliasesTest { @Test public void rootVehiclePassengerCollisionFailsWithoutChangingPlayer() { CompoundTag vehicle = entity("example:vehicle", true); CompoundTag child = entity("example:seat", true); - CompoundTag duplicate = attribute(false); duplicate.putString("Name", "forge:swim_speed"); + CompoundTag duplicate = attribute(false); duplicate.putString("Name", "neoforge:swim_speed"); child.getList("Attributes", 10).add(duplicate); ListTag passengers = new ListTag(); passengers.add(child); vehicle.put("Passengers", passengers); CompoundTag player = player(vehicle), before = player.copy(); @@ -179,7 +179,7 @@ public class LegacyEntityAttributeAliasesTest { CompoundTag fixed = result.getCompound("RootVehicle").getCompound("Entity"); for (CompoundTag actual : new CompoundTag[] {fixed, fixed.getList("Passengers", 10).getCompound(0)}) { CompoundTag attribute = actual.getList("attributes", 10).getCompound(0); - assertEquals("forge:swim_speed", attribute.getString("id")); + assertEquals("neoforge:swim_speed", attribute.getString("id")); assertEquals(2D, attribute.getDouble("base"), 0D); assertEquals("minecraft:" + MODIFIER, attribute.getList("modifiers", 10).getCompound(0).getString("id")); } @@ -194,7 +194,7 @@ public class LegacyEntityAttributeAliasesTest { CompoundTag before = player.copy(); CompoundTag result = LegacyPlayerDataFixes.update(DataFixers.getDataFixer(), DataFixTypes.PLAYER, player, 1343); CompoundTag attribute = result.getList("attributes", 10).getCompound(0); - assertEquals("forge:swim_speed", attribute.getString("id")); + assertEquals("neoforge:swim_speed", attribute.getString("id")); assertEquals(2D, attribute.getDouble("base"), 0D); assertEquals("minecraft:" + MODIFIER, attribute.getList("modifiers", 10).getCompound(0).getString("id")); assertEquals("keep-attribute-field", attribute.getString("PrivateNote")); @@ -206,7 +206,7 @@ public class LegacyEntityAttributeAliasesTest { @Test public void ownPlayerAttributeCollisionFailsWithoutMutatingCaller() { CompoundTag player = player(entity("example:vehicle", true)); ListTag attributes = entity("example:attributes", true).getList("Attributes", 10); - CompoundTag duplicate = attribute(false); duplicate.putString("Name", "forge:swim_speed"); attributes.add(duplicate); + CompoundTag duplicate = attribute(false); duplicate.putString("Name", "neoforge:swim_speed"); attributes.add(duplicate); player.put("Attributes", attributes); CompoundTag before = player.copy(); try { @@ -232,7 +232,7 @@ public class LegacyEntityAttributeAliasesTest { new Dynamic<>(NbtOps.INSTANCE, source.copy()), 1343, SharedConstants.getCurrentVersion().getDataVersion().getVersion()).getValue(); Wolf before = new Wolf(EntityType.WOLF, world); before.load(red); - var swimSpeed = ForgeMod.SWIM_SPEED.getHolder().orElseThrow(); + var swimSpeed = NeoForgeMod.SWIM_SPEED; assertEquals(1D, before.getAttribute(swimSpeed).getBaseValue(), 0D); CompoundTag root = chunk(source); LegacyEntityDataFixes.prepare(root); LegacyEntityDataFixes.finish(root); diff --git a/src/test/java/zone/moddev/mc/basepower/migration/LegacyEntityDataFixesTest.java b/src/test/java/zone/moddev/mc/basepower/migration/LegacyEntityDataFixesTest.java new file mode 100644 index 00000000..0c33bf78 --- /dev/null +++ b/src/test/java/zone/moddev/mc/basepower/migration/LegacyEntityDataFixesTest.java @@ -0,0 +1,127 @@ +package zone.moddev.mc.basepower.migration; + +import net.minecraft.SharedConstants; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.Tag; +import net.minecraft.server.Bootstrap; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; + +/** Forge 1.21.1 already uses native lowercase attribute records and the current data version. */ +public class LegacyEntityDataFixesTest { + @BeforeClass public static void bootstrap() { + SharedConstants.tryDetectVersion(); + Bootstrap.bootStrap(); + } + + @Test public void namespacedSwimAliasIsRenamedBeforeTheCurrentChunkVersionEarlyReturn() { + assertCurrentChunkAlias("forge:swim_speed", "neoforge:swim_speed", 2.5D); + } + + @Test public void namespacedNametagAliasIsRenamedBeforeTheCurrentChunkVersionEarlyReturn() { + assertCurrentChunkAlias("forge:nametag_distance", "neoforge:nametag_distance", 12.5D); + } + + @Test public void bothNamespacedAliasesAreIdempotentInCurrentNativeEntityRecords() { + CompoundTag root = chunk(entity("forge:swim_speed", 2.5D)); + attributes(firstEntity(root)).add(attribute("forge:nametag_distance", 12.5D)); + CompoundTag expected = root.copy(); + attributes(firstEntity(expected)).getCompound(0).putString("id", "neoforge:swim_speed"); + attributes(firstEntity(expected)).getCompound(1).putString("id", "neoforge:nametag_distance"); + LegacyEntityDataFixes.prepare(root); + LegacyEntityDataFixes.finish(root); + assertEquals(expected, root); + LegacyEntityDataFixes.prepare(root); + LegacyEntityDataFixes.finish(root); + assertEquals("Repeated native upgrades must not duplicate or alter attributes", expected, root); + } + + @Test public void currentPlayerRootVehicleAndPassengersKeepNativeModifiersAndPrivatePayload() { + CompoundTag player = entity("forge:swim_speed", 2.5D); + player.putInt("DataVersion", currentVersion()); + CompoundTag vehicle = new CompoundTag(); + vehicle.putString("Attach", "native-root-vehicle-witness"); + CompoundTag mount = entity("forge:nametag_distance", 12.5D); + ListTag passengers = new ListTag(); + passengers.add(entity("forge:swim_speed", 3.5D)); + mount.put("Passengers", passengers); + vehicle.put("Entity", mount); + player.put("RootVehicle", vehicle); + CompoundTag expected = player.copy(); + attributes(expected).getCompound(0).putString("id", "neoforge:swim_speed"); + CompoundTag expectedMount = expected.getCompound("RootVehicle").getCompound("Entity"); + attributes(expectedMount).getCompound(0).putString("id", "neoforge:nametag_distance"); + attributes(expectedMount.getList("Passengers", Tag.TAG_COMPOUND).getCompound(0)) + .getCompound(0).putString("id", "neoforge:swim_speed"); + LegacyEntityDataFixes.preparePlayerAttributes(player); + assertEquals("Only the three namespaced attribute identities may change", expected, player); + LegacyEntityDataFixes.preparePlayerAttributes(player); + assertEquals(expected, player); + } + + private static void assertCurrentChunkAlias(String oldId, String newId, double base) { + CompoundTag root = chunk(entity(oldId, base)); + CompoundTag expected = root.copy(); + attributes(firstEntity(expected)).getCompound(0).putString("id", newId); + LegacyEntityDataFixes.prepare(root); + LegacyEntityDataFixes.finish(root); + assertEquals("Current-version migration must retain every other native NBT field", expected, root); + assertEquals(currentVersion(), root.getInt("DataVersion")); + } + + private static int currentVersion() { + return SharedConstants.getCurrentVersion().getDataVersion().getVersion(); + } + + private static CompoundTag chunk(CompoundTag entity) { + CompoundTag root = new CompoundTag(); + root.putInt("DataVersion", currentVersion()); + root.putIntArray("Position", new int[] {68, 68}); + ListTag entities = new ListTag(); + entities.add(entity); + root.put("Entities", entities); + root.putString("PrivateChunkNote", "keep-current-chunk"); + return root; + } + + private static CompoundTag firstEntity(CompoundTag chunk) { + return chunk.getList("Entities", Tag.TAG_COMPOUND).getCompound(0); + } + + private static ListTag attributes(CompoundTag entity) { + return entity.getList("attributes", Tag.TAG_COMPOUND); + } + + private static CompoundTag entity(String attributeId, double base) { + CompoundTag entity = new CompoundTag(); + entity.putString("id", "example:native-attribute-fixture"); + entity.putIntArray("UUID", new int[] {0, 17, 0, 19}); + entity.putString("CustomName", "{\"text\":\"Keep native name\"}"); + CompoundTag persistent = new CompoundTag(); + persistent.putString("Owner", "keep-persistent-data"); + persistent.putByteArray("Payload", new byte[] {1, 3, 5}); + entity.put("NeoForgeData", persistent); + ListTag attributes = new ListTag(); + attributes.add(attribute(attributeId, base)); + entity.put("attributes", attributes); + return entity; + } + + private static CompoundTag attribute(String id, double base) { + CompoundTag attribute = new CompoundTag(); + attribute.putString("id", id); + attribute.putDouble("base", base); + attribute.putString("PrivateNote", "keep-native-attribute"); + CompoundTag modifier = new CompoundTag(); + modifier.putString("id", "example:stable_modifier"); + modifier.putDouble("amount", 0.125D); + modifier.putString("operation", "add_value"); + modifier.putString("PrivateNote", "keep-native-modifier"); + ListTag modifiers = new ListTag(); + modifiers.add(modifier); + attribute.put("modifiers", modifiers); + return attribute; + } +} diff --git a/src/test/java/zone/moddev/mc/basepower/migration/LegacyForgeAttributeRegistryTest.java b/src/test/java/zone/moddev/mc/basepower/migration/LegacyForgeAttributeRegistryTest.java index 39c892e7..06e5c4cb 100644 --- a/src/test/java/zone/moddev/mc/basepower/migration/LegacyForgeAttributeRegistryTest.java +++ b/src/test/java/zone/moddev/mc/basepower/migration/LegacyForgeAttributeRegistryTest.java @@ -16,17 +16,18 @@ import net.minecraft.util.datafix.fixes.References; import net.minecraft.server.Bootstrap; import net.minecraft.server.level.ServerLevel; -import net.minecraftforge.common.ForgeMod; +import net.neoforged.neoforge.common.NeoForgeMod; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.registries.ForgeRegistries; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; import org.junit.BeforeClass; import org.junit.Test; import zone.moddev.mc.advantageworks.unit.ForgeUnitRegistries; public class LegacyForgeAttributeRegistryTest { private static final String[][] ALIASES = { - {"forge.swimSpeed", "forge:swim_speed"}, - {"forge.nameTagDistance", "forge:nametag_distance"}, + {"forge.swimSpeed", "neoforge:swim_speed"}, + {"forge.nameTagDistance", "neoforge:nametag_distance"}, {"forge.entity_gravity", "minecraft:generic.gravity"}, {"generic.reachDistance", "minecraft:player.block_interaction_range"} }; @@ -39,8 +40,8 @@ public class LegacyForgeAttributeRegistryTest { static void registerForgeAttributes() throws ReflectiveOperationException { ForgeUnitRegistries.registerVanillaFluidTypes(); - if (ForgeMod.SWIM_SPEED.isPresent()) return; - ForgeUnitRegistries.registerForgeEntries("ATTRIBUTES", ForgeRegistries.Keys.ATTRIBUTES, ForgeRegistries.ATTRIBUTES); + if (NeoForgeMod.SWIM_SPEED.isBound()) return; + ForgeUnitRegistries.registerForgeEntries("ATTRIBUTES", Registries.ATTRIBUTE, BuiltInRegistries.ATTRIBUTE); } @@ -66,7 +67,7 @@ static void registerForgeAttributes() throws ReflectiveOperationException { new Dynamic<>(NbtOps.INSTANCE, source.copy()), 1343, SharedConstants.getCurrentVersion().getDataVersion().getVersion()).getValue(); Wolf negative = new Wolf(EntityType.WOLF, world); negative.load(raw); - AttributeInstance old = negative.getAttribute(ForgeRegistries.ATTRIBUTES.getHolder( + AttributeInstance old = negative.getAttribute(BuiltInRegistries.ATTRIBUTE.getHolder( ResourceLocation.parse(ALIASES[index][1])).orElseThrow()); assertNotEquals(ALIASES[index][0], values[index], old.getBaseValue(), 0D); CompoundTag root = chunk(source); @@ -86,7 +87,7 @@ static void registerForgeAttributes() throws ReflectiveOperationException { CompoundTag value = actual.getList("attributes", 10).getCompound(0); assertEquals("minecraft:player.block_interaction_range", value.getString("id")); var reach = net.minecraft.world.entity.ai.attributes.Attributes.BLOCK_INTERACTION_RANGE; - assertSame(reach.value(), ForgeRegistries.ATTRIBUTES.getValue( + assertSame(reach.value(), BuiltInRegistries.ATTRIBUTE.get( ResourceLocation.parse(value.getString("id")))); AttributeInstance nativeAttribute = new AttributeInstance(reach, unused -> {}); nativeAttribute.load(value); @@ -177,7 +178,7 @@ static CompoundTag nativeAttributeRecord(CompoundTag source) { CompoundTag converted = fixedEntity(root); Wolf nativeReader = new Wolf(EntityType.WOLF, NativeWolfTestWorld.create()); nativeReader.load(converted); - AttributeInstance speed = nativeReader.getAttribute(ForgeMod.SWIM_SPEED.getHolder().orElseThrow()); + AttributeInstance speed = nativeReader.getAttribute(NeoForgeMod.SWIM_SPEED); assertEquals(2D, speed.getBaseValue(), 0D); assertNotNull(speed.getModifier(modifierId())); assertEquals(2.125D, speed.getValue(), 0D); diff --git a/src/test/java/zone/moddev/mc/basepower/migration/LegacyMachineItemsTest.java b/src/test/java/zone/moddev/mc/basepower/migration/LegacyMachineItemsTest.java index c05cd17a..06d89046 100644 --- a/src/test/java/zone/moddev/mc/basepower/migration/LegacyMachineItemsTest.java +++ b/src/test/java/zone/moddev/mc/basepower/migration/LegacyMachineItemsTest.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.migration; +import net.minecraft.core.registries.BuiltInRegistries; + import com.mojang.datafixers.DSL; import com.mojang.datafixers.DataFixer; import com.mojang.datafixers.schemas.Schema; @@ -33,7 +35,7 @@ public class LegacyMachineItemsTest { @BeforeClass public static void bootstrap() { net.minecraft.SharedConstants.tryDetectVersion(); net.minecraft.server.Bootstrap.bootStrap(); - net.minecraftforge.registries.GameData.unfreezeData(); + net.neoforged.neoforge.registries.GameData.unfreezeData(); registryLookup = net.minecraft.data.registries.VanillaRegistries.createLookup(); AdvantageLegacyMigrations.registerPowerAdvantage(); } @@ -241,9 +243,9 @@ private static net.minecraft.core.HolderLookup.Provider registries() { @Test public void registeredForeignToolKeepsWearInDirectAndNestedMachineSlots() { String id = "advantageworks_unit:legacy_foreign_tool"; - net.minecraftforge.registries.GameData.unfreezeData(); + net.neoforged.neoforge.registries.GameData.unfreezeData(); var tool = new net.minecraft.world.item.Item(new net.minecraft.world.item.Item.Properties().durability(250)); - net.minecraftforge.registries.ForgeRegistries.ITEMS.register(net.minecraft.resources.ResourceLocation.parse(id), tool); + net.minecraft.core.Registry.register(BuiltInRegistries.ITEM, net.minecraft.resources.ResourceLocation.parse(id), tool); CompoundTag foreign = stack(id, 9, 1); CompoundTag payload = new CompoundTag(); payload.putInt("Fixture", 31); diff --git a/src/test/java/zone/moddev/mc/basepower/migration/LegacyPlayerTransformerTest.java b/src/test/java/zone/moddev/mc/basepower/migration/LegacyPlayerTransformerTest.java index d97d7d1e..07903e4f 100644 --- a/src/test/java/zone/moddev/mc/basepower/migration/LegacyPlayerTransformerTest.java +++ b/src/test/java/zone/moddev/mc/basepower/migration/LegacyPlayerTransformerTest.java @@ -21,7 +21,7 @@ import net.minecraft.util.datafix.DataFixers; import net.minecraft.util.datafix.fixes.References; import net.minecraft.world.level.validation.DirectoryValidator; -import net.minecraftforge.fml.ModList; +import net.neoforged.fml.ModList; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; diff --git a/src/test/java/zone/moddev/mc/basepower/migration/LegacyTransformerOrderTest.java b/src/test/java/zone/moddev/mc/basepower/migration/LegacyTransformerOrderTest.java index b03f1c23..d473cd40 100644 --- a/src/test/java/zone/moddev/mc/basepower/migration/LegacyTransformerOrderTest.java +++ b/src/test/java/zone/moddev/mc/basepower/migration/LegacyTransformerOrderTest.java @@ -187,7 +187,11 @@ static ClassNode nativeClass(String internalName) throws IOException { } static InputStream resource(String name) { - InputStream input = LegacyTransformerOrderTest.class.getResourceAsStream(name); + InputStream input = name.endsWith(".class") + ? zone.moddev.mc.advantageworks.unit.NativeClassResources.open(name) + : name.contains("basemetals_") + ? zone.moddev.mc.basemetals.BaseMetals.class.getResourceAsStream(name) + : LegacyTransformerOrderTest.class.getResourceAsStream(name); assertNotNull("Missing pinned native dependency resource " + name, input); return input; } diff --git a/src/test/java/zone/moddev/mc/basepower/migration/NativePersistentDataTest.java b/src/test/java/zone/moddev/mc/basepower/migration/NativePersistentDataTest.java new file mode 100644 index 00000000..c68ec7f5 --- /dev/null +++ b/src/test/java/zone/moddev/mc/basepower/migration/NativePersistentDataTest.java @@ -0,0 +1,43 @@ +package zone.moddev.mc.basepower.migration; + +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.TagParser; +import org.junit.Test; +import static org.junit.Assert.*; + +public class NativePersistentDataTest { + @Test public void chunkEntitiesTilesPassengersAndNestedItemsRetainTheirPayload() throws Exception { + CompoundTag source = TagParser.parseTag("{Level:{Entities:[{ForgeData:{Witness:1},Passengers:[{ForgeData:{Witness:2}}]}]," + + "TileEntities:[{ForgeData:{Witness:3},Items:[{id:'minecraft:chest',Count:1b,tag:{BlockEntityTag:{ForgeData:{Witness:4}}}}]}]}}"); + CompoundTag copy = source.copy(); + assertEquals(4, NativePersistentData.prepare(copy, false)); + assertTrue(source.toString().contains("ForgeData")); + CompoundTag level = copy.getCompound("Level"); + assertEquals(1, level.getList("Entities", 10).getCompound(0).getCompound("NeoForgeData").getInt("Witness")); + assertEquals(2, level.getList("Entities", 10).getCompound(0).getList("Passengers", 10).getCompound(0) + .getCompound("NeoForgeData").getInt("Witness")); + assertEquals(3, level.getList("TileEntities", 10).getCompound(0).getCompound("NeoForgeData").getInt("Witness")); + assertEquals(4, level.getList("TileEntities", 10).getCompound(0).getList("Items", 10).getCompound(0) + .getCompound("tag").getCompound("BlockEntityTag").getCompound("NeoForgeData").getInt("Witness")); + assertEquals(0, NativePersistentData.prepare(copy, false)); + } + + @Test public void playerAndNativeItemContainersMigrateButOpaqueCustomDataDoesNot() throws Exception { + CompoundTag player = TagParser.parseTag("{ForgeData:{Witness:7},Inventory:[{id:'minecraft:chest',count:1," + + "components:{'minecraft:block_entity_data':{ForgeData:{Witness:8}}," + + "'minecraft:custom_data':{ForgeData:{Opaque:9}}}}]}"); + assertEquals(2, NativePersistentData.prepare(player, true)); + assertEquals(7, player.getCompound("NeoForgeData").getInt("Witness")); + CompoundTag components = player.getList("Inventory", 10).getCompound(0).getCompound("components"); + assertEquals(8, components.getCompound("minecraft:block_entity_data").getCompound("NeoForgeData").getInt("Witness")); + assertEquals(9, components.getCompound("minecraft:custom_data").getCompound("ForgeData").getInt("Opaque")); + } + + @Test public void conflictingPayloadsFailWithoutOverwritingEitherValue() throws Exception { + CompoundTag player = TagParser.parseTag("{ForgeData:{Witness:1},NeoForgeData:{Witness:2}}"); + CompoundTag before = player.copy(); + try { NativePersistentData.prepare(player, true); fail("Conflict was accepted"); } + catch (IllegalStateException expected) { assertTrue(expected.getMessage().contains("Conflicting")); } + assertEquals(before, player); + } +} diff --git a/src/test/java/zone/moddev/mc/basepower/migration/VanillaRegistryMappingEventTest.java b/src/test/java/zone/moddev/mc/basepower/migration/VanillaRegistryMappingEventTest.java index e18bcdf9..df45e340 100644 --- a/src/test/java/zone/moddev/mc/basepower/migration/VanillaRegistryMappingEventTest.java +++ b/src/test/java/zone/moddev/mc/basepower/migration/VanillaRegistryMappingEventTest.java @@ -1,153 +1,65 @@ package zone.moddev.mc.basepower.migration; -import java.lang.reflect.Proxy; -import java.util.Collections; -import net.minecraft.resources.ResourceLocation; +import com.mojang.serialization.Lifecycle; +import cyano.poweradvantage.api.migration.LegacyMigrationApi; +import java.lang.reflect.Constructor; +import net.minecraft.core.MappedRegistry; import net.minecraft.core.Registry; +import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceKey; -import net.minecraftforge.registries.MissingMappingsEvent; -import net.minecraftforge.registries.IForgeRegistry; +import net.minecraft.resources.ResourceLocation; +import net.neoforged.neoforge.registries.RegisterEvent; import org.junit.Test; import static org.junit.Assert.*; +/** NeoForge uses native aliases, not Forge's staging-registry MissingMappingsEvent. */ public class VanillaRegistryMappingEventTest { - private static final ResourceLocation SOURCE = ResourceLocation.parse("minecraft:zombie_pigman_spawn_egg"); - private static final ResourceLocation TARGET = ResourceLocation.parse("minecraft:zombified_piglin_spawn_egg"); - - @Test public void resolvesTheTargetFromActiveNotTheIncompleteStagingRegistry() { - Entry target = new Entry(); - IForgeRegistry staging = registry(null, false), active = registry(target, true); - MissingMappingsEvent.Mapping mapping = new MissingMappingsEvent.Mapping<>(staging, active, SOURCE, 42); - VanillaRegistryRemaps.remap(event(staging, mapping), active); - assertEquals(MissingMappingsEvent.Action.REMAP, property(mapping, "action")); - assertSame(target, property(mapping, "target")); - assertEquals(42, mapping.getId()); - } - - @Test public void aLaterExplicitForgeDecisionOverridesTheCompatibilityMapping() { - IForgeRegistry active = registry(new Entry(), true); - MissingMappingsEvent.Mapping mapping = new MissingMappingsEvent.Mapping<>(active, active, SOURCE, 42); - var bus = net.minecraftforge.eventbus.api.BusBuilder.builder().build(); - bus.addListener(net.minecraftforge.eventbus.api.EventPriority.HIGHEST, - (MissingMappingsEvent event) -> VanillaRegistryRemaps.remap(event, active)); - bus.addListener(net.minecraftforge.eventbus.api.EventPriority.NORMAL, - (MissingMappingsEvent event) -> mapping.ignore()); - bus.start(); - bus.post(event(active, mapping)); - assertEquals(MissingMappingsEvent.Action.IGNORE, property(mapping, "action")); - } - - @Test public void leavesUnrecognizedEntriesUnresolvedForForgeToReport() { - IForgeRegistry active = registry(new Entry(), true); - MissingMappingsEvent.Mapping mapping = new MissingMappingsEvent.Mapping<>(active, active, - ResourceLocation.parse("othermod:zombie_pigman_spawn_egg"), 42); - VanillaRegistryRemaps.remap(event(active, mapping), active); - assertEquals(MissingMappingsEvent.Action.DEFAULT, property(mapping, "action")); - } - - @Test public void neverSubstitutesARegistryDefaultForAMissingTarget() { - IForgeRegistry absent = registry(new Entry(), false); - MissingMappingsEvent.Mapping mapping = new MissingMappingsEvent.Mapping<>(absent, absent, SOURCE, 42); - try { - VanillaRegistryRemaps.remap(event(absent, mapping), absent); - fail("A registry default must not replace the missing item"); - } catch (IllegalStateException expected) { - assertEquals(MissingMappingsEvent.Action.DEFAULT, property(mapping, "action")); - } + private static ResourceLocation id(String value) { return ResourceLocation.parse(value); } + + private static Registry registry() { + LegacyMigrationApi.registerNamespaceAlias("poweradvantage", "basepower"); + @SuppressWarnings("unchecked") + ResourceKey> key = (ResourceKey>) (ResourceKey) Registries.ITEM; + Registry registry = new MappedRegistry<>(key, Lifecycle.stable()); + Registry.register(registry, id("basepower:fixture"), "fixture"); + return registry; } - @Test public void retiresOnlyTheTwoNonSerializedVanillaMemoryIndexes() { - IForgeRegistry active = registry(null, false, "minecraft:memory_module_type"); - for (String name : new String[] {"golem_last_seen_time", "opened_doors"}) { - MissingMappingsEvent.Mapping mapping = new MissingMappingsEvent.Mapping<>(active, active, - ResourceLocation.fromNamespaceAndPath("minecraft", name), 42); - MissingMappingsEvent event = new MissingMappingsEvent(key("minecraft:memory_module_type"), - active, Collections.singletonList(mapping)); - VanillaRegistryRemaps.remap(event, active); - assertEquals(MissingMappingsEvent.Action.IGNORE, property(mapping, "action")); - assertNull(property(mapping, "target")); - } + private static void register(Registry registry) throws Exception { + Constructor ctor = RegisterEvent.class.getDeclaredConstructor(ResourceKey.class, Registry.class); + ctor.setAccessible(true); + VanillaRegistryRemaps.registerAliases(ctor.newInstance(registry.key(), registry)); } - @Test public void neverRetiresOtherModsOrCurrentMemoryTypes() { - ResourceLocation registry = ResourceLocation.parse("minecraft:memory_module_type"); - assertFalse(VanillaRegistryRemaps.retiredTransientMemory(registry, ResourceLocation.parse("othermod:opened_doors"))); - assertFalse(VanillaRegistryRemaps.retiredTransientMemory(registry, ResourceLocation.parse("minecraft:golem_detected_recently"))); - assertFalse(VanillaRegistryRemaps.retiredTransientMemory(ResourceLocation.parse("minecraft:item"), - ResourceLocation.parse("minecraft:opened_doors"))); + @Test public void legacyNamespaceResolvesTheSameLiveNativeValue() throws Exception { + Registry registry = registry(); register(registry); + assertEquals("fixture", registry.get(id("poweradvantage:fixture"))); + assertEquals("fixture", registry.get(id("basepower:fixture"))); } - @Test public void retiresOnlyTheTwoPointsOfInterestRemovedByVanilla() { - IForgeRegistry active = registry(null, false, "minecraft:point_of_interest_type"); - for (String id : new String[] {"minecraft:nitwit", "minecraft:unemployed", "minecraft:home", "othermod:nitwit"}) { - var mapping = new MissingMappingsEvent.Mapping<>(active, active, ResourceLocation.parse(id), 42); - VanillaRegistryRemaps.remap(event(active, mapping), active); - boolean retired = id.equals("minecraft:nitwit") || id.equals("minecraft:unemployed"); - assertEquals(id, retired ? MissingMappingsEvent.Action.IGNORE : MissingMappingsEvent.Action.DEFAULT, - property(mapping, "action")); - assertNull(property(mapping, "target")); - } + @Test public void aliasesDoNotReplaceARealRegistration() throws Exception { + Registry registry = registry(); + Registry.register(registry, id("poweradvantage:fixture"), "existing"); + register(registry); + assertEquals("existing", registry.get(id("poweradvantage:fixture"))); } - @Test public void retiresOnlyTheRemovedVanillaEmptyPotionIndex() { - IForgeRegistry active = registry(null, false, "minecraft:potion"); - for (String id : new String[] {"minecraft:empty", "minecraft:water", "othermod:empty"}) { - var mapping = new MissingMappingsEvent.Mapping<>(active, active, ResourceLocation.parse(id), 42); - VanillaRegistryRemaps.remap(event(active, mapping), active); - assertEquals(id, id.equals("minecraft:empty") ? MissingMappingsEvent.Action.IGNORE - : MissingMappingsEvent.Action.DEFAULT, property(mapping, "action")); - assertNull(property(mapping, "target")); - } + @Test public void registrationDoesNotInventUnknownReplacementItems() throws Exception { + Registry registry = registry(); register(registry); + assertTrue(registry.getOptional(id("poweradvantage:absent")).isEmpty()); + assertTrue(registry.getOptional(id("example:fixture")).isEmpty()); } - @Test public void movedPaintingsRetireOnlyTheirKnownStaticIndexes() { - IForgeRegistry active = registry(null, false, "minecraft:painting_variant"); - for (String id : new String[] {"minecraft:alban", "minecraft:aztec", "minecraft:unknown", "othermod:alban"}) { - var mapping = new MissingMappingsEvent.Mapping<>(active, active, ResourceLocation.parse(id), 42); - VanillaRegistryRemaps.remap(event(active, mapping), active); - assertEquals(id, id.equals("minecraft:alban") || id.equals("minecraft:aztec") - ? MissingMappingsEvent.Action.IGNORE : MissingMappingsEvent.Action.DEFAULT, property(mapping, "action")); - assertNull(property(mapping, "target")); - } + @Test public void registryAliasesAreIdempotent() throws Exception { + Registry registry = registry(); register(registry); register(registry); + assertEquals("fixture", registry.get(id("poweradvantage:fixture"))); + assertEquals(1, registry.size()); } - private static MissingMappingsEvent event(IForgeRegistry staging, MissingMappingsEvent.Mapping mapping) { - return new MissingMappingsEvent(staging.getRegistryKey(), staging, Collections.singletonList(mapping)); + @Test public void foreignNamespacesRemainUntouched() throws Exception { + Registry registry = registry(); + Registry.register(registry, id("example:fixture"), "foreign"); register(registry); + assertEquals("foreign", registry.get(id("example:fixture"))); + assertEquals(2, registry.size()); } - - private static ResourceKey> key(String id) { - return ResourceKey.createRegistryKey(ResourceLocation.parse(id)); - } - - // Forge keeps the result fields package-private for its snapshot loader. - private static Object property(MissingMappingsEvent.Mapping mapping, String name) { - try { - var field = mapping.getClass().getDeclaredField(name); - field.setAccessible(true); - return field.get(mapping); - } catch (ReflectiveOperationException failure) { - throw new AssertionError(failure); - } - } - - private static IForgeRegistry registry(Entry target, boolean contains) { - return registry(target, contains, "minecraft:item"); - } - - @SuppressWarnings("unchecked") - private static IForgeRegistry registry(Entry target, boolean contains, String id) { - return (IForgeRegistry) Proxy.newProxyInstance(IForgeRegistry.class.getClassLoader(), - new Class[] {IForgeRegistry.class}, (proxy, method, args) -> { - switch (method.getName()) { - case "getRegistryKey": return key(id); - case "getRegistryName": return ResourceLocation.parse(id); - case "containsKey": return contains && TARGET.equals(args[0]); - case "getValue": return target; - case "getKey": return args[0] == target ? TARGET : null; - default: throw new UnsupportedOperationException(method.getName()); - } - }); - } - - private static final class Entry {} } diff --git a/src/test/java/zone/moddev/mc/basepower/migration/VanillaRegistryRemapsTest.java b/src/test/java/zone/moddev/mc/basepower/migration/VanillaRegistryRemapsTest.java index 7ec556d0..3973666e 100644 --- a/src/test/java/zone/moddev/mc/basepower/migration/VanillaRegistryRemapsTest.java +++ b/src/test/java/zone/moddev/mc/basepower/migration/VanillaRegistryRemapsTest.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.migration; +import net.minecraft.core.registries.BuiltInRegistries; + import com.mojang.serialization.Dynamic; import com.mojang.serialization.JsonOps; import net.minecraft.SharedConstants; @@ -21,7 +23,7 @@ public class VanillaRegistryRemapsTest { var actual = VanillaRegistryRemaps.replacement(registry, net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("minecraft", pair[0])); assertEquals(net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("minecraft", pair[1]), actual); - assertTrue(net.minecraftforge.registries.ForgeRegistries.SOUND_EVENTS.containsKey(actual)); + assertTrue(BuiltInRegistries.SOUND_EVENT.containsKey(actual)); } assertNull(VanillaRegistryRemaps.replacement(registry, net.minecraft.resources.ResourceLocation.parse("othermod:block.trial_spawner.charge_activate"))); diff --git a/src/test/java/zone/moddev/mc/basepower/recipe/MaterialPolicyPackTest.java b/src/test/java/zone/moddev/mc/basepower/recipe/MaterialPolicyPackTest.java index d36c6e05..2e7abb3d 100644 --- a/src/test/java/zone/moddev/mc/basepower/recipe/MaterialPolicyPackTest.java +++ b/src/test/java/zone/moddev/mc/basepower/recipe/MaterialPolicyPackTest.java @@ -25,7 +25,7 @@ public class MaterialPolicyPackTest { int index = 0; for (String metal : new String[] {"lead", "tin", "silver"}) { JsonObject entry = solder.getAsJsonArray("values").get(index++).getAsJsonObject(); - assertEquals("#forge:ingots/" + metal, entry.get("id").getAsString()); + assertEquals("#c:ingots/" + metal, entry.get("id").getAsString()); assertFalse(entry.get("required").getAsBoolean()); } } @@ -41,13 +41,13 @@ public class MaterialPolicyPackTest { @Test public void policyOnlySuppliesServerDataAndHonoursResourceDiscovery() { MaterialPolicyPack pack = new MaterialPolicyPack(true, false); - ResourceLocation rubber = ResourceLocation.fromNamespaceAndPath("forge", "tags/item/rubber.json"); + ResourceLocation rubber = ResourceLocation.fromNamespaceAndPath("c", "tags/item/rubber.json"); assertNotNull(pack.getResource(PackType.SERVER_DATA, rubber)); assertNull(pack.getResource(PackType.CLIENT_RESOURCES, rubber)); - assertEquals(Set.of(rubber, ResourceLocation.parse("forge:tags/item/ingots/rubber.json"), - ResourceLocation.parse("forge:tags/item/solder.json")), list(pack, PackType.SERVER_DATA, "forge")); + assertEquals(Set.of(rubber, ResourceLocation.parse("c:tags/item/ingots/rubber.json"), + ResourceLocation.parse("c:tags/item/solder.json")), list(pack, PackType.SERVER_DATA, "c")); assertTrue(list(pack, PackType.SERVER_DATA, "basepower").isEmpty()); - assertTrue(list(pack, PackType.CLIENT_RESOURCES, "forge").isEmpty()); + assertTrue(list(pack, PackType.CLIENT_RESOURCES, "c").isEmpty()); } private static Set list(MaterialPolicyPack pack, PackType type, String namespace) { @@ -58,7 +58,7 @@ private static Set list(MaterialPolicyPack pack, PackType type private static JsonObject read(MaterialPolicyPack pack, String path) throws Exception { try (InputStream stream = pack.getResource(PackType.SERVER_DATA, - ResourceLocation.fromNamespaceAndPath("forge", "tags/item/" + path + ".json")).get()) { + ResourceLocation.fromNamespaceAndPath("c", "tags/item/" + path + ".json")).get()) { return new JsonParser().parse(new String(stream.readAllBytes(), StandardCharsets.UTF_8)).getAsJsonObject(); } } diff --git a/src/test/java/zone/moddev/mc/basepower/recipe/MaterialTagsTest.java b/src/test/java/zone/moddev/mc/basepower/recipe/MaterialTagsTest.java index d3ec729a..bf6d406c 100644 --- a/src/test/java/zone/moddev/mc/basepower/recipe/MaterialTagsTest.java +++ b/src/test/java/zone/moddev/mc/basepower/recipe/MaterialTagsTest.java @@ -35,7 +35,7 @@ public class MaterialTagsTest { } private static Set resolve(MaterialPolicyPack pack, String path, String userEntries) throws Exception { - var resource = ResourceLocation.fromNamespaceAndPath("forge", "tags/item/" + path + ".json"); + var resource = ResourceLocation.fromNamespaceAndPath("c", "tags/item/" + path + ".json"); JsonObject policy; try (var reader = new InputStreamReader(pack.getResource(PackType.SERVER_DATA, resource).get(), StandardCharsets.UTF_8)) { @@ -45,7 +45,7 @@ private static Set resolve(MaterialPolicyPack pack, String path, String us Map items = Map.of("minecraft:stick", Items.STICK, "minecraft:redstone", Items.REDSTONE, "basepower:bioplastic_ingot", Items.APPLE); Map> tags = Map.of( - "forge:ingots/lead", List.of(Items.IRON_INGOT), "forge:ingots/tin", List.of(Items.GOLD_INGOT)); + "c:ingots/lead", List.of(Items.IRON_INGOT), "c:ingots/tin", List.of(Items.GOLD_INGOT)); return NativeTestTags.resolve(id -> items.get(id.toString()), id -> tags.get(id.toString()), policy, JsonParser.parseString("{\"values\":" + userEntries + "}")); } diff --git a/src/test/java/zone/moddev/mc/basepower/registry/MachineGuiTitleTest.java b/src/test/java/zone/moddev/mc/basepower/registry/MachineGuiTitleTest.java index de01ac93..45ee992a 100644 --- a/src/test/java/zone/moddev/mc/basepower/registry/MachineGuiTitleTest.java +++ b/src/test/java/zone/moddev/mc/basepower/registry/MachineGuiTitleTest.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.registry; +import net.minecraft.core.registries.BuiltInRegistries; + import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.ChestBlockEntity; import net.minecraft.world.level.block.entity.BlockEntity; diff --git a/src/test/java/zone/moddev/mc/basepower/resources/BuildWorkflowContractTest.java b/src/test/java/zone/moddev/mc/basepower/resources/BuildWorkflowContractTest.java index 11307d16..98fe4014 100644 --- a/src/test/java/zone/moddev/mc/basepower/resources/BuildWorkflowContractTest.java +++ b/src/test/java/zone/moddev/mc/basepower/resources/BuildWorkflowContractTest.java @@ -7,11 +7,15 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Properties; +import java.util.HashSet; +import java.util.Set; import java.util.regex.Pattern; import java.util.stream.Stream; +import com.google.gson.JsonParser; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertEquals; public class BuildWorkflowContractTest { @Test public void testFixturesDoNotImportRestrictedUnsafeTypes() throws Exception { @@ -19,7 +23,7 @@ public class BuildWorkflowContractTest { assertTrue(restrictedImport.matcher("import sun.misc.Unsafe;").find()); assertTrue(restrictedImport.matcher("import static sun.misc.Unsafe.INVALID_FIELD_OFFSET;").find()); assertFalse(restrictedImport.matcher("Class.forName(\"sun.misc.Unsafe\")").find()); - try (Stream sources = Files.walk(Paths.get("src/test/java"))) { + try (Stream sources = Files.walk(zone.moddev.mc.advantageworks.unit.TestProject.path("src/test/java"))) { for (Path path : (Iterable) sources.filter(p -> p.toString().endsWith(".java"))::iterator) { String source = new String(Files.readAllBytes(path), StandardCharsets.UTF_8); assertFalse(path.toString(), restrictedImport.matcher(source).find()); @@ -27,27 +31,31 @@ public class BuildWorkflowContractTest { } } - @Test public void pinnedDependencyCheckoutPolicyPrecedesCheckout() throws Exception { + @Test public void nativeDependencyPolicyPrecedesNetworkAndBuild() throws Exception { Properties pins = new Properties(); - try (var input = Files.newBufferedReader(Paths.get("gradle.properties"), StandardCharsets.UTF_8)) { + try (var input = Files.newBufferedReader(zone.moddev.mc.advantageworks.unit.TestProject.path("gradle.properties"), StandardCharsets.UTF_8)) { pins.load(input); } for (String name : new String[] {"ci.yml", "codeql-analysis.yml"}) { - String workflow = new String(Files.readAllBytes(Paths.get(".github/workflows", name)), + String workflow = new String(Files.readAllBytes(zone.moddev.mc.advantageworks.unit.TestProject.path(".github/workflows", name)), StandardCharsets.UTF_8); int policy = workflow.indexOf("run: git config --global core.autocrlf false"); - int checkout = workflow.indexOf("- name: Check out pinned Base Metals"); - assertTrue(name, policy >= 0 && checkout > policy); - assertTrue(name, workflow.contains("ref: " + pins.getProperty("basemetals_source_commit"))); - assertTrue(name, workflow.contains("build/libs/BaseMetals-" + pins.getProperty("basemetals_version") + ".jar")); - assertTrue(name, workflow.contains("build/libs/OreSpawn-" + pins.getProperty("orespawn_version") + ".jar")); - assertTrue(name, workflow.contains("ref: " + pins.getProperty("orespawn_source_commit"))); - assertTrue(name, workflow.contains("(cd \"$basemetals\" && bash gradle/stage-orespawn-release.sh \"$mirror\")")); - assertTrue(name, workflow.contains("master-" + pins.getProperty("minecraft_version"))); - assertTrue(name, workflow.contains("java-version: '25.0.3+9.0.LTS'")); + int guardTests = workflow.indexOf("run: ./.github/test-native-dependencies.ps1"); + int dependencyGate = workflow.indexOf("run: ./.github/verify-native-dependencies.ps1"); + int compile = workflow.indexOf("./gradlew $MMD_GRADLE_TOOLCHAINS "); + assertTrue(name, policy >= 0 && guardTests > policy && dependencyGate > guardTests && compile > dependencyGate); + assertTrue(name, workflow.contains("fetch-depth: 0")); + assertTrue(name, workflow.contains("master-" + pins.getProperty("minecraft_version") + "-neo")); assertTrue(name, workflow.contains("java-version: '" + pins.getProperty("java_setup_version") + ".0.LTS'")); - assertTrue(name, workflow.contains("java-version: '8.0.502+7'")); + assertFalse(name, workflow.contains("25.0.3")); + assertFalse(name, workflow.contains("8.0.502")); assertFalse(name, workflow.contains("JAVA_HOME_16_X64")); + assertFalse(name, workflow.contains("stage-orespawn-release")); + assertFalse(name, workflow.contains("forge52Mavenizer")); + assertTrue(name, workflow.contains("-I .github/pinned-native-inputs.gradle")); + assertTrue(name, workflow.contains("-PbaseMetalsJar=$BASE_METALS_JAR")); + assertTrue(name, workflow.contains("-PmmdlibJar=$MMDLIB_JAR")); + assertTrue(name, workflow.contains("-PoreSpawnJar=$ORESPAWN_JAR")); assertTrue(name, workflow.contains("-Porg.gradle.java.installations.paths=")); assertTrue(name, workflow.contains("-Porg.gradle.java.installations.auto-detect=false")); assertTrue(name, workflow.contains("-Porg.gradle.java.installations.auto-download=false")); @@ -58,5 +66,59 @@ public class BuildWorkflowContractTest { } } } + var root = zone.moddev.mc.advantageworks.unit.TestProject.path(".github"); + var lock = JsonParser.parseString(Files.readString(root.resolve("native-dependencies.json"))).getAsJsonObject(); + var target = lock.getAsJsonObject("target"); + assertEquals("21.1.265", target.get("neoforge").getAsString()); + assertEquals("HOSTED_INPUTS_READY", lock.get("status").getAsString()); + assertEquals("21", target.get("java").getAsString()); + assertEquals("2.0.148", target.get("moddev").getAsString()); + assertEquals("9.8.0", target.get("gradle").getAsString()); + Set ids = new HashSet<>(); + for (var entry : lock.getAsJsonArray("dependencies")) { + var pin = entry.getAsJsonObject(); + String id = pin.get("id").getAsString(); + assertTrue("Duplicate native dependency " + id, ids.add(id)); + assertEquals(pins.getProperty(pin.get("versionProperty").getAsString()), pin.get("version").getAsString()); + if (pin.get("state").getAsString().equals("PUBLISHED")) { + String sha = pin.get("sha256").getAsString(); + assertTrue(id, sha.matches("[A-F0-9]{64}")); + assertEquals(id, pins.getProperty(pin.get("hashProperty").getAsString()), sha); + } else { + assertEquals("basemetals", id); + assertEquals("BOOTSTRAP_LOCAL_ONLY", lock.get("status").getAsString()); + assertEquals("LOCAL_SOURCE_UNCOMMITTED", pin.get("state").getAsString()); + assertTrue(pin.get("sha256").isJsonNull()); + assertTrue(pin.get("mavenVersion").isJsonNull()); + assertTrue(pin.getAsJsonObject("source").get("commit").isJsonNull()); + } + } + assertEquals(Set.of("basemetals", "mmdlib", "orespawn"), ids); + assertEquals(3, lock.getAsJsonArray("dependencies").size()); + String gate = Files.readString(root.resolve("verify-native-dependencies.ps1")); + assertTrue(gate.indexOf("Read-NativeDependencyPins") < gate.indexOf("Invoke-WebRequest")); + assertTrue(gate.indexOf("Assert-NativeSourceAncestry $pin") < gate.indexOf("Invoke-WebRequest")); + assertTrue(gate.indexOf("Assert-NativeDependencyArchive $path $pin") > gate.indexOf("Invoke-WebRequest")); + String module = Files.readString(root.resolve("NativeDependencyPins.psm1")); + assertTrue(module.contains("BOOTSTRAP_BLOCKED:")); + assertTrue(module.contains("HOSTED_INPUTS_READY")); + assertTrue(module.contains("gh api $Uri --jq '.status'")); + assertTrue(module.contains("@('identical', 'ahead')")); + assertTrue(module.contains("SHA-256 mismatch")); + assertTrue(module.contains("META-INF/neoforge.mods.toml")); + assertTrue(module.contains("zone/moddev/mc/basemetals/migration/LegacyWorldDataHook.class")); + String metadata = Files.readString(zone.moddev.mc.advantageworks.unit.TestProject.path( + "src/main/resources/META-INF/neoforge.mods.toml")); + for (String id : ids) { + assertTrue("Mandatory native dependency " + id, Pattern.compile( + "(?s)\\[\\[dependencies\\.basepower\\]\\]\\s*modId=\"" + id + "\"\\s*type=\"required\"") + .matcher(metadata).find()); + } + String build = Files.readString(zone.moddev.mc.advantageworks.unit.TestProject.path("build.gradle")); + assertTrue(build.contains("id 'net.neoforged.moddev' version '2.0.148'")); + String wrapper = Files.readString(zone.moddev.mc.advantageworks.unit.TestProject.path( + "gradle/wrapper/gradle-wrapper.properties")); + assertTrue(wrapper.contains("gradle-9.8.0-bin.zip")); + assertTrue(wrapper.contains("bafd5ce9cfaea0fbccfdc8439a1ac42fbd4cd9c89dc9a988228d8a2639a58e6c")); } } diff --git a/src/test/java/zone/moddev/mc/basepower/resources/ClientResourceContractTest.java b/src/test/java/zone/moddev/mc/basepower/resources/ClientResourceContractTest.java index 7a836406..0c094f67 100644 --- a/src/test/java/zone/moddev/mc/basepower/resources/ClientResourceContractTest.java +++ b/src/test/java/zone/moddev/mc/basepower/resources/ClientResourceContractTest.java @@ -19,7 +19,7 @@ import static org.junit.Assert.*; public class ClientResourceContractTest { - private static final Path ROOT = Paths.get("src/main/resources"); + private static final Path ROOT = zone.moddev.mc.advantageworks.unit.TestProject.path("src/main/resources"); private static final Path ASSETS = ROOT.resolve("assets/basepower"); @Test public void blockstatesResolveLiteralModelPaths() throws IOException { diff --git a/src/test/java/zone/moddev/mc/basepower/resources/CreativeTabInitializationTest.java b/src/test/java/zone/moddev/mc/basepower/resources/CreativeTabInitializationTest.java index 76933538..48a0ff5b 100644 --- a/src/test/java/zone/moddev/mc/basepower/resources/CreativeTabInitializationTest.java +++ b/src/test/java/zone/moddev/mc/basepower/resources/CreativeTabInitializationTest.java @@ -13,9 +13,8 @@ import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistry; -import net.minecraftforge.registries.RegisterEvent; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.neoforged.neoforge.registries.RegisterEvent; import org.junit.Test; import zone.moddev.mc.basepower.init.ItemGroups; import static org.junit.Assert.*; @@ -26,18 +25,14 @@ public class CreativeTabInitializationTest { net.minecraft.server.Bootstrap.bootStrap(); assertSame(Items.STICK, ItemGroups.show(Items.STICK)); var registry = new MappedRegistry<>(Registries.CREATIVE_MODE_TAB, Lifecycle.stable()); - var event = RegisterEvent.class.getDeclaredConstructor(ResourceKey.class, ForgeRegistry.class, Registry.class); + var event = RegisterEvent.class.getDeclaredConstructor(ResourceKey.class, Registry.class); event.setAccessible(true); // Plain JUnit runs without the ModLauncher event bus transformer. var tabs = ItemGroups.class.getDeclaredField("TABS"); tabs.setAccessible(true); - var dispatcher = Class.forName("net.minecraftforge.registries.DeferredRegister$EventDispatcher"); - var constructor = dispatcher.getDeclaredConstructor(DeferredRegister.class); - constructor.setAccessible(true); - var handleEvent = dispatcher.getDeclaredMethod("handleEvent", RegisterEvent.class); + var handleEvent = DeferredRegister.class.getDeclaredMethod("addEntries", RegisterEvent.class); handleEvent.setAccessible(true); - handleEvent.invoke(constructor.newInstance(tabs.get(null)), - event.newInstance(Registries.CREATIVE_MODE_TAB, null, registry)); + handleEvent.invoke(tabs.get(null), event.newInstance(Registries.CREATIVE_MODE_TAB, registry)); ItemGroups.show(Items.IRON_INGOT); ItemGroups.show(Items.STICK); var id = ResourceLocation.parse("basepower:machines"); diff --git a/src/test/java/zone/moddev/mc/basepower/resources/NativeBlockEntityFactoryTest.java b/src/test/java/zone/moddev/mc/basepower/resources/NativeBlockEntityFactoryTest.java index 40544005..cc9524b7 100644 --- a/src/test/java/zone/moddev/mc/basepower/resources/NativeBlockEntityFactoryTest.java +++ b/src/test/java/zone/moddev/mc/basepower/resources/NativeBlockEntityFactoryTest.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.resources; +import net.minecraft.core.registries.BuiltInRegistries; + import cyano.poweradvantage.api.GUIBlock; import java.io.InputStream; import net.minecraft.core.BlockPos; @@ -21,7 +23,7 @@ public class NativeBlockEntityFactoryTest { @BeforeClass public static void bootstrap() { net.minecraft.SharedConstants.tryDetectVersion(); net.minecraft.server.Bootstrap.bootStrap(); - net.minecraftforge.registries.GameData.unfreezeData(); + net.neoforged.neoforge.registries.GameData.unfreezeData(); } @Test public void nativeFactoriesKeepTheActualPositionAndFacing() { diff --git a/src/test/java/zone/moddev/mc/basepower/resources/NativeLootContractTest.java b/src/test/java/zone/moddev/mc/basepower/resources/NativeLootContractTest.java index 1efa0062..93d3ba5e 100644 --- a/src/test/java/zone/moddev/mc/basepower/resources/NativeLootContractTest.java +++ b/src/test/java/zone/moddev/mc/basepower/resources/NativeLootContractTest.java @@ -10,7 +10,18 @@ import static org.junit.Assert.*; public class NativeLootContractTest { - private static final Path ROOT = Paths.get("src/main/resources"); + private static final Path ROOT = zone.moddev.mc.advantageworks.unit.TestProject.path("src/main/resources"); + + @Test public void chestPartsModifierUsesTheNativeLoaderIndex() throws Exception { + assertFalse("NeoForge never reads the Forge index", Files.exists( + ROOT.resolve("data/forge/loot_modifiers/global_loot_modifiers.json"))); + JsonObject index = read(ROOT.resolve("data/neoforge/loot_modifiers/global_loot_modifiers.json")); + assertFalse("Do not remove other mods' loot modifiers", index.get("replace").getAsBoolean()); + assertEquals(1, index.getAsJsonArray("entries").size()); + assertEquals("basepower:vanilla_chest_parts", index.getAsJsonArray("entries").get(0).getAsString()); + JsonObject modifier = read(ROOT.resolve("data/basepower/loot_modifiers/vanilla_chest_parts.json")); + assertEquals("basepower:vanilla_chest_parts", modifier.get("type").getAsString()); + } @Test public void everyRegisteredBlockHasANativeLootTable() throws Exception { try (java.util.stream.Stream states = Files.list(ROOT.resolve("assets/basepower/blockstates"))) { diff --git a/src/test/java/zone/moddev/mc/basepower/resources/NativeMachinePropertyTest.java b/src/test/java/zone/moddev/mc/basepower/resources/NativeMachinePropertyTest.java index efb2cfaf..9d3f9996 100644 --- a/src/test/java/zone/moddev/mc/basepower/resources/NativeMachinePropertyTest.java +++ b/src/test/java/zone/moddev/mc/basepower/resources/NativeMachinePropertyTest.java @@ -21,7 +21,7 @@ public class NativeMachinePropertyTest { net.minecraft.SharedConstants.tryDetectVersion(); Bootstrap.bootStrap(); // Plain JUnit does not open the registry event that allows block construction. - net.minecraftforge.registries.GameData.unfreezeData(); + net.neoforged.neoforge.registries.GameData.unfreezeData(); } @Test public void machineDefaultsKeepPistonResistanceAndNonOccludingRendering() { diff --git a/src/test/java/zone/moddev/mc/basepower/resources/NativePlatformContractTest.java b/src/test/java/zone/moddev/mc/basepower/resources/NativePlatformContractTest.java index 35b66811..420a3acf 100644 --- a/src/test/java/zone/moddev/mc/basepower/resources/NativePlatformContractTest.java +++ b/src/test/java/zone/moddev/mc/basepower/resources/NativePlatformContractTest.java @@ -16,12 +16,12 @@ public class NativePlatformContractTest { @Test public void onlyPreDatafixMigrationStillUsesACoremod() throws Exception { - String json = new String(Files.readAllBytes(Paths.get("src/main/resources/META-INF/coremods.json")), StandardCharsets.UTF_8); + String json = new String(Files.readAllBytes(zone.moddev.mc.advantageworks.unit.TestProject.path("src/main/resources/META-INF/coremods.json")), StandardCharsets.UTF_8); JsonObject coremods = new JsonParser().parse(json).getAsJsonObject(); assertEquals(1, coremods.size()); assertEquals("coremods/poweradvantage_118_migration.js", coremods.get("poweradvantage_118_migration").getAsString()); for (String removed : new String[] {"oil_renderer", "material_tags", "parts_loot"}) - assertFalse(Files.exists(Paths.get("src/main/resources/coremods/poweradvantage_" + removed + ".js"))); + assertFalse(Files.exists(zone.moddev.mc.advantageworks.unit.TestProject.path("src/main/resources/coremods/poweradvantage_" + removed + ".js"))); } @Test public void pinnedForgeFiresTagEventAfterBindingNativeCollections() throws Exception { @@ -35,6 +35,7 @@ public class NativePlatformContractTest { int events = 0; for (MethodNode method : node.methods) { boolean installed = false; + boolean tagEventConstructed = false; for (AbstractInsnNode instruction : method.instructions.toArray()) { if (instruction instanceof MethodInsnNode) { MethodInsnNode call = (MethodInsnNode) instruction; @@ -42,11 +43,16 @@ public class NativePlatformContractTest { if (call.name.equals("forEach")) installed = true; } } - if (instruction instanceof MethodInsnNode call - && call.owner.equals("net/minecraftforge/event/ForgeEventFactory") - && call.name.equals("onTagsUpdated")) { + if (instruction instanceof org.objectweb.asm.tree.TypeInsnNode type + && type.getOpcode() == org.objectweb.asm.Opcodes.NEW + && type.desc.equals("net/neoforged/neoforge/event/TagsUpdatedEvent")) { assertTrue("Bind tags before notifying observers", installed); + tagEventConstructed = true; + } + if (instruction instanceof MethodInsnNode call && tagEventConstructed + && call.owner.equals("net/neoforged/bus/api/IEventBus") && call.name.equals("post")) { events++; + tagEventConstructed = false; } } } @@ -59,8 +65,8 @@ public class NativePlatformContractTest { for (MethodNode method : node.methods) for (AbstractInsnNode instruction : method.instructions.toArray()) { if (instruction instanceof MethodInsnNode call) { assertNotEquals("zone/moddev/mc/basepower/recipe/PartsLoot", call.owner); - if (call.owner.equals("net/minecraftforge/event/ForgeEventFactory") - && call.name.equals("onLoadLootTable")) calls++; + if (call.owner.equals("net/neoforged/neoforge/event/EventHooks") + && call.name.equals("loadLootTable")) calls++; } } assertEquals(1, calls); @@ -68,7 +74,7 @@ public class NativePlatformContractTest { private static ClassNode read(String name) throws Exception { ClassNode node = new ClassNode(); - try (InputStream input = NativePlatformContractTest.class.getResourceAsStream("/" + name + ".class")) { + try (InputStream input = zone.moddev.mc.advantageworks.unit.NativeClassResources.open("/" + name + ".class")) { assertNotNull(input); new ClassReader(input).accept(node, 0); } diff --git a/src/test/java/zone/moddev/mc/basepower/resources/NativeTagReaderContractTest.java b/src/test/java/zone/moddev/mc/basepower/resources/NativeTagReaderContractTest.java index f78867cf..5ae4e531 100644 --- a/src/test/java/zone/moddev/mc/basepower/resources/NativeTagReaderContractTest.java +++ b/src/test/java/zone/moddev/mc/basepower/resources/NativeTagReaderContractTest.java @@ -22,7 +22,7 @@ public class NativeTagReaderContractTest { @BeforeClass public static void bootstrap() { net.minecraft.SharedConstants.tryDetectVersion(); net.minecraft.server.Bootstrap.bootStrap(); } @Test public void optionalSteelBarsUseTheNativeParserWithAndWithoutBaseMetals() throws Exception { - JsonObject json = new JsonParser().parse(new String(Files.readAllBytes(Paths.get( + JsonObject json = new JsonParser().parse(new String(Files.readAllBytes(zone.moddev.mc.advantageworks.unit.TestProject.path( "src/main/resources/data/forge/tags/item/bars/steel.json")), StandardCharsets.UTF_8)).getAsJsonObject(); assertFalse("Do not silently ignore an obsolete optional array", json.has("optional")); assertTrue(NativeTestTags.resolve(id -> null, id -> null, json).isEmpty()); diff --git a/src/test/java/zone/moddev/mc/basepower/resources/RecipeRegistrationThreadTest.java b/src/test/java/zone/moddev/mc/basepower/resources/RecipeRegistrationThreadTest.java index 53e1f057..af0fb85a 100644 --- a/src/test/java/zone/moddev/mc/basepower/resources/RecipeRegistrationThreadTest.java +++ b/src/test/java/zone/moddev/mc/basepower/resources/RecipeRegistrationThreadTest.java @@ -18,7 +18,7 @@ public class RecipeRegistrationThreadTest { if (instruction instanceof MethodInsnNode call && call.owner.equals(conditions) && call.name.equals("register")) { assertEquals("Subscribe during mod construction, before the registry event", "", method.name); - assertEquals("(Lnet/minecraftforge/eventbus/api/IEventBus;)V", call.desc); + assertEquals("(Lnet/neoforged/bus/api/IEventBus;)V", call.desc); subscriptions++; } } @@ -28,12 +28,12 @@ public class RecipeRegistrationThreadTest { MethodNode register = codecs.methods.stream().filter(method -> method.name.equals("register")) .findFirst().orElseThrow(); assertTrue(java.util.Arrays.stream(register.instructions.toArray()).anyMatch(instruction -> - instruction instanceof MethodInsnNode call && call.owner.equals("net/minecraftforge/registries/DeferredRegister") - && call.name.equals("register") && call.desc.equals("(Lnet/minecraftforge/eventbus/api/IEventBus;)V"))); + instruction instanceof MethodInsnNode call && call.owner.equals("net/neoforged/neoforge/registries/DeferredRegister") + && call.name.equals("register") && call.desc.equals("(Lnet/neoforged/bus/api/IEventBus;)V"))); assertTrue(codecs.methods.stream().flatMap(method -> java.util.Arrays.stream(method.instructions.toArray())) .anyMatch(instruction -> instruction instanceof org.objectweb.asm.tree.FieldInsnNode field - && field.owner.equals("net/minecraftforge/registries/ForgeRegistries$Keys") - && field.name.equals("CONDITION_SERIALIZERS"))); + && field.owner.equals("net/neoforged/neoforge/registries/NeoForgeRegistries$Keys") + && field.name.equals("CONDITION_CODECS"))); } private ClassNode read(String type) throws Exception { diff --git a/src/test/java/zone/moddev/mc/basepower/resources/RecipeUnlockContractTest.java b/src/test/java/zone/moddev/mc/basepower/resources/RecipeUnlockContractTest.java index a57b11ca..d0ae8fa1 100644 --- a/src/test/java/zone/moddev/mc/basepower/resources/RecipeUnlockContractTest.java +++ b/src/test/java/zone/moddev/mc/basepower/resources/RecipeUnlockContractTest.java @@ -1,5 +1,7 @@ package zone.moddev.mc.basepower.resources; +import net.minecraft.core.registries.BuiltInRegistries; + import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,9 +24,9 @@ public class RecipeUnlockContractTest { private static final String MOD = "basepower"; - private static final Path DATA = Paths.get("src/main/resources/data", MOD); + private static final Path DATA = zone.moddev.mc.advantageworks.unit.TestProject.path("src/main/resources/data", MOD); private static final Set IGNORED = new LinkedHashSet<>(java.util.Arrays.asList( - "item:minecraft:stick", "item:minecraft:string", "item:minecraft:feather", "tag:forge:rods/wooden")); + "item:minecraft:stick", "item:minecraft:string", "item:minecraft:feather", "tag:c:rods/wooden")); @Test public void everyCraftingRecipeHasExactlyOneUnlockAndProcessingHasNone() throws IOException { Set expected = new LinkedHashSet<>(); diff --git a/src/test/java/zone/moddev/mc/basepower/resources/StarchRecipeTest.java b/src/test/java/zone/moddev/mc/basepower/resources/StarchRecipeTest.java index 087c79cc..79a22cef 100644 --- a/src/test/java/zone/moddev/mc/basepower/resources/StarchRecipeTest.java +++ b/src/test/java/zone/moddev/mc/basepower/resources/StarchRecipeTest.java @@ -25,14 +25,14 @@ public class StarchRecipeTest { @Test public void existingCrushingKeepsBothPotatoesAndItsOneToOneRatio() throws Exception { JsonObject recipe = read("crushing_potato_starch"); - assertEquals("basemetals:crushing", recipe.get("type").getAsString()); + assertEquals("mmdlib:crushing", recipe.get("type").getAsString()); assertEquals(potatoes(), items(recipe.getAsJsonArray("ingredient"))); assertEquals("basepower:starch", recipe.getAsJsonObject("result").get("id").getAsString()); assertEquals(1, recipe.getAsJsonObject("result").get("count").getAsInt()); } private static JsonObject read(String name) throws Exception { - return new JsonParser().parse(new String(Files.readAllBytes(Paths.get( + return new JsonParser().parse(new String(Files.readAllBytes(zone.moddev.mc.advantageworks.unit.TestProject.path( "src/main/resources/data/basepower/recipe/" + name + ".json")), StandardCharsets.UTF_8)).getAsJsonObject(); } private static Set potatoes() { diff --git a/src/test/java/zone/moddev/mc/basepower/util/ForgeFluidAdapterTest.java b/src/test/java/zone/moddev/mc/basepower/util/ForgeFluidAdapterTest.java index fbf679b3..1bd05d09 100644 --- a/src/test/java/zone/moddev/mc/basepower/util/ForgeFluidAdapterTest.java +++ b/src/test/java/zone/moddev/mc/basepower/util/ForgeFluidAdapterTest.java @@ -8,7 +8,7 @@ import net.minecraft.world.level.material.WaterFluid; import net.minecraft.nbt.CompoundTag; import net.minecraft.core.Direction; -import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction; +import net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction; import org.junit.Test; import org.junit.BeforeClass; import static org.junit.Assert.*; @@ -25,30 +25,30 @@ public class ForgeFluidAdapterTest { TankHandler tank = new TankHandler(); int[] changes = {0}; ForgeFluidAdapter adapter = new ForgeFluidAdapter(tank, Direction.NORTH, () -> changes[0]++); - net.minecraftforge.fluids.FluidStack offered = new net.minecraftforge.fluids.FluidStack(WATER, 1500); + net.neoforged.neoforge.fluids.FluidStack offered = new net.neoforged.neoforge.fluids.FluidStack(WATER, 1500); CompoundTag tag = new CompoundTag(); tag.putString("Owner", "preserve-me"); - offered.setTag(tag); + offered.set(net.minecraft.core.component.DataComponents.CUSTOM_DATA, net.minecraft.world.item.component.CustomData.of(tag)); assertEquals(1000, adapter.fill(offered, FluidAction.SIMULATE)); assertEquals(0, tank.tank.getFluidAmount()); assertEquals(0, changes[0]); assertEquals(1000, adapter.fill(offered, FluidAction.EXECUTE)); assertEquals(1000, tank.tank.getFluidAmount()); assertEquals(1500, offered.getAmount()); - assertEquals(tag, offered.getTag()); + assertEquals(tag, offered.getOrDefault(net.minecraft.core.component.DataComponents.CUSTOM_DATA, net.minecraft.world.item.component.CustomData.EMPTY).copyTag()); assertEquals(1, changes[0]); tank.tank.getFluid().tag.putString("Owner", "changed-in-tank"); - assertEquals("preserve-me", offered.getTag().getString("Owner")); + assertEquals("preserve-me", offered.getOrDefault(net.minecraft.core.component.DataComponents.CUSTOM_DATA, net.minecraft.world.item.component.CustomData.EMPTY).copyTag().getString("Owner")); } @Test public void keepsSidedRestrictionsAndRejectsEmptyOrInvalidRequests() { TankHandler tank = new TankHandler(); ForgeFluidAdapter adapter = new ForgeFluidAdapter(tank, Direction.SOUTH, () -> fail("Changed blocked tank")); - assertFalse(adapter.isFluidValid(0, new net.minecraftforge.fluids.FluidStack(WATER, 10))); - assertEquals(0, adapter.fill(new net.minecraftforge.fluids.FluidStack(WATER, 10), FluidAction.EXECUTE)); - assertEquals(0, adapter.fill(net.minecraftforge.fluids.FluidStack.EMPTY, FluidAction.EXECUTE)); + assertFalse(adapter.isFluidValid(0, new net.neoforged.neoforge.fluids.FluidStack(WATER, 10))); + assertEquals(0, adapter.fill(new net.neoforged.neoforge.fluids.FluidStack(WATER, 10), FluidAction.EXECUTE)); + assertEquals(0, adapter.fill(net.neoforged.neoforge.fluids.FluidStack.EMPTY, FluidAction.EXECUTE)); assertTrue(adapter.drain(-1, FluidAction.EXECUTE).isEmpty()); - assertTrue(adapter.drain(net.minecraftforge.fluids.FluidStack.EMPTY, FluidAction.EXECUTE).isEmpty()); + assertTrue(adapter.drain(net.neoforged.neoforge.fluids.FluidStack.EMPTY, FluidAction.EXECUTE).isEmpty()); assertEquals(0, adapter.getTankCapacity(-1)); assertTrue(adapter.getFluidInTank(8).isEmpty()); } @@ -58,13 +58,13 @@ public class ForgeFluidAdapterTest { tank.tank.fill(new FluidStack(WATER, 900), true); int[] changes = {0}; ForgeFluidAdapter adapter = new ForgeFluidAdapter(tank, Direction.NORTH, () -> changes[0]++); - net.minecraftforge.fluids.FluidStack view = adapter.getFluidInTank(0); + net.neoforged.neoforge.fluids.FluidStack view = adapter.getFluidInTank(0); view.setAmount(1); assertEquals(900, tank.tank.getFluidAmount()); assertEquals(300, adapter.drain(300, FluidAction.SIMULATE).getAmount()); assertEquals(900, tank.tank.getFluidAmount()); assertEquals(0, changes[0]); - net.minecraftforge.fluids.FluidStack request = new net.minecraftforge.fluids.FluidStack(WATER, 250); + net.neoforged.neoforge.fluids.FluidStack request = new net.neoforged.neoforge.fluids.FluidStack(WATER, 250); assertEquals(250, adapter.drain(request, FluidAction.EXECUTE).getAmount()); assertEquals(250, request.getAmount()); assertEquals(650, tank.tank.getFluidAmount()); @@ -77,12 +77,12 @@ public class ForgeFluidAdapterTest { FluidStack source = new FluidStack(WATER, 700); source.tag = new CompoundTag(); source.tag.putInt("batch", 7); - net.minecraftforge.fluids.FluidStack nativeStack = ForgeFluidAdapter.toForge(source); + net.neoforged.neoforge.fluids.FluidStack nativeStack = ForgeFluidAdapter.toForge(source); FluidStack copy = ForgeFluidAdapter.fromForge(nativeStack); copy.tag.putInt("batch", 8); assertEquals(7, source.tag.getInt("batch")); - assertEquals(7, nativeStack.getTag().getInt("batch")); - assertNull(ForgeFluidAdapter.fromForge(net.minecraftforge.fluids.FluidStack.EMPTY)); + assertEquals(7, nativeStack.getOrDefault(net.minecraft.core.component.DataComponents.CUSTOM_DATA, net.minecraft.world.item.component.CustomData.EMPTY).copyTag().getInt("batch")); + assertNull(ForgeFluidAdapter.fromForge(net.neoforged.neoforge.fluids.FluidStack.EMPTY)); assertTrue(ForgeFluidAdapter.toForge(null).isEmpty()); } diff --git a/src/test/java/zone/moddev/mc/basepower/util/MachineCapabilitiesLifecycleTest.java b/src/test/java/zone/moddev/mc/basepower/util/MachineCapabilitiesLifecycleTest.java index a4c4c2b5..13e5815a 100644 --- a/src/test/java/zone/moddev/mc/basepower/util/MachineCapabilitiesLifecycleTest.java +++ b/src/test/java/zone/moddev/mc/basepower/util/MachineCapabilitiesLifecycleTest.java @@ -1,167 +1,320 @@ package zone.moddev.mc.basepower.util; -import java.lang.reflect.Constructor; -import java.util.concurrent.Callable; -import java.util.concurrent.atomic.AtomicBoolean; +import cyano.poweradvantage.api.modsupport.rf.TileEntityRFConverter; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.RegistryAccess; +import net.minecraft.core.component.DataComponents; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; -import net.minecraft.core.Direction; -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.energy.IEnergyStorage; -import org.junit.AfterClass; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.component.CustomData; +import net.minecraft.world.level.material.Fluids; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction; +import net.neoforged.neoforge.items.IItemHandler; import org.junit.BeforeClass; import org.junit.Test; -import zone.moddev.mc.basepower.machines.fluidmachines.MetalTankTileEntity; -import zone.moddev.mc.basepower.machines.conveyors.TileEntityConveyor; +import zone.moddev.mc.basepower.init.Blocks; import zone.moddev.mc.basepower.init.Entities; +import zone.moddev.mc.basepower.init.ModSupport; +import zone.moddev.mc.basepower.machines.conveyors.TileEntityConveyor; +import zone.moddev.mc.basepower.machines.fluidmachines.MetalTankTileEntity; import static org.junit.Assert.*; +/** Adapter-unit witnesses; NativeInteropProbe separately proves placed-world capability caches. */ public class MachineCapabilitiesLifecycleTest { - private static BlockEntityType previousTank; - private static BlockEntityType previousConveyor; + @BeforeClass public static void requireNativeModRegistration() { + net.minecraft.SharedConstants.tryDetectVersion(); + net.minecraft.server.Bootstrap.bootStrap(); + assertNotNull(Capabilities.FluidHandler.BLOCK); + assertNotNull(Capabilities.ItemHandler.BLOCK); + assertNotNull(Capabilities.EnergyStorage.BLOCK); + assertNotSame((Object) Capabilities.FluidHandler.BLOCK, Capabilities.ItemHandler.BLOCK); + assertNotNull("Run through ModDevGradle unitTest with the actual basePower mod", Entities.METAL_TANK); + assertNotNull(Entities.CONVEYOR); + assertNotNull(Entities.RF_STEAM_CONVERTER); + } - @BeforeClass public static void nativeCapabilityTokens() throws Exception { - net.minecraft.SharedConstants.tryDetectVersion(); net.minecraft.server.Bootstrap.bootStrap(); - assertNotNull(ForgeCapabilities.FLUID_HANDLER); - assertNotNull(ForgeCapabilities.ITEM_HANDLER); - assertNotNull(ForgeCapabilities.ENERGY); - previousTank = Entities.METAL_TANK; - previousConveyor = Entities.CONVEYOR; - Entities.METAL_TANK = BlockEntityType.Builder.of(MetalTankTileEntity::new, Blocks.IRON_BLOCK).build(null); - Entities.CONVEYOR = BlockEntityType.Builder.of(TileEntityConveyor::new, Blocks.HOPPER).build(null); + @Test public void adaptersAreStablePerSideAndSeparateAcrossOwners() { + MetalTankTileEntity tank = tank(); + MachineCapabilities caps = tank.machineCapabilities(); + assertTrue(caps.isValid()); + IFluidHandler up = caps.fluids(Direction.UP); + IItemHandler down = caps.items(Direction.DOWN); + assertNotNull(up); + assertNotNull(down); + assertSame(up, caps.fluids(Direction.UP)); + assertSame(down, caps.items(Direction.DOWN)); + assertNotSame(up, caps.fluids(Direction.DOWN)); + assertNotSame(down, caps.items(Direction.UP)); + assertSame(caps.fluids(null), caps.fluids(null)); + assertSame(caps.items(null), caps.items(null)); + assertNotSame(up, tank().machineCapabilities().fluids(Direction.UP)); + assertNotSame(down, tank().machineCapabilities().items(Direction.DOWN)); } - @AfterClass public static void restoreNativeTypes() { - Entities.METAL_TANK = previousTank; - Entities.CONVEYOR = previousConveyor; + @Test public void explicitInvalidationBlocksEverySidedAndUnsidedRequest() { + MetalTankTileEntity tank = tank(); + assertNotNull(tank.machineCapabilities().fluids(null)); + assertNotNull(tank.machineCapabilities().items(null)); + tank.invalidateCaps(); + assertClosed(tank.machineCapabilities()); + assertFalse(tank.isRemoved()); } @Test public void chunkUnloadCannotRecreateAdaptersOnAnUnremovedTile() { - TestTank tank = new TestTank(); - LazyOptional fluid = tank.getCapability(ForgeCapabilities.FLUID_HANDLER, Direction.UP); - LazyOptional item = tank.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.DOWN); - assertTrue(fluid.isPresent()); - assertTrue(item.isPresent()); + MetalTankTileEntity tank = tank(); + assertNotNull(tank.machineCapabilities().fluids(Direction.UP)); + assertNotNull(tank.machineCapabilities().items(Direction.DOWN)); tank.onChunkUnloaded(); assertFalse(tank.isRemoved()); - assertFalse(fluid.isPresent()); - assertFalse(item.isPresent()); - assertFalse(tank.getCapability(ForgeCapabilities.FLUID_HANDLER, Direction.UP).isPresent()); - assertFalse(tank.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.DOWN).isPresent()); + assertClosed(tank.machineCapabilities()); } - @Test public void explicitInvalidationBlocksEverySidedAndUnsidedRequest() { - TestTank tank = new TestTank(); - tank.invalidateNow(); - for (Direction face : Direction.values()) { - assertFalse(tank.getCapability(ForgeCapabilities.FLUID_HANDLER, face).isPresent()); - assertFalse(tank.getCapability(ForgeCapabilities.ITEM_HANDLER, face).isPresent()); - } - assertFalse(tank.getCapability(ForgeCapabilities.FLUID_HANDLER, null).isPresent()); - assertFalse(tank.getCapability(ForgeCapabilities.ITEM_HANDLER, null).isPresent()); - } - - @Test public void clearRemovedCreatesFreshOptionalsWithoutRevivingOldOnes() { - TestTank tank = new TestTank(); - tank.getTank().setFluid(new cyano.poweradvantage.api.fluid.FluidStack(net.minecraft.world.level.material.Fluids.WATER, 500)); - LazyOptional old = tank.getCapability(ForgeCapabilities.FLUID_HANDLER, null); + @Test public void clearRemovedCreatesFreshAdaptersWithoutChangingNativePayloadOrInventory() { + MetalTankTileEntity tank = tank(); + MachineCapabilities caps = tank.machineCapabilities(); + FluidStack offered = payload(750); + Tag original = offered.save(registries()); + IFluidHandler oldFluid = caps.fluids(null); + IItemHandler oldItems = caps.items(null); + assertEquals(750, oldFluid.fill(offered, FluidAction.EXECUTE)); + tank.setItem(0, new ItemStack(Items.WATER_BUCKET)); + CompoundTag internal = tank.getTank().writeToNBT(new CompoundTag()); + Tag inventory = tank.getItem(0).save(registries()); tank.onChunkUnloaded(); + assertClosed(caps); tank.clearRemoved(); - LazyOptional current = tank.getCapability(ForgeCapabilities.FLUID_HANDLER, null); - assertTrue(current.isPresent()); - assertNotSame(old, current); - assertFalse(old.isPresent()); - assertEquals(500, tank.getTank().getFluidAmount()); + assertTrue(caps.isValid()); + IFluidHandler currentFluid = caps.fluids(null); + IItemHandler currentItems = caps.items(null); + assertNotNull(currentFluid); + assertNotNull(currentItems); + assertNotSame(oldFluid, currentFluid); + assertNotSame(oldItems, currentItems); + assertEquals(internal, tank.getTank().writeToNBT(new CompoundTag())); + assertEquals(original, currentFluid.getFluidInTank(0).save(registries())); + assertEquals(inventory, currentItems.getStackInSlot(0).save(registries())); + assertEquals(original, offered.save(registries())); } - @Test public void invalidationListenersCannotReacquireAnotherAdapter() { - TestTank tank = new TestTank(); - LazyOptional fluid = tank.getCapability(ForgeCapabilities.FLUID_HANDLER, null); - tank.getCapability(ForgeCapabilities.ITEM_HANDLER, null); - AtomicBoolean called = new AtomicBoolean(), reacquired = new AtomicBoolean(); - fluid.addListener(ignored -> { - called.set(true); - reacquired.set(tank.getCapability(ForgeCapabilities.ITEM_HANDLER, null).isPresent()); - }); - tank.onChunkUnloaded(); - assertTrue(called.get()); - assertFalse(reacquired.get()); + @Test public void repeatedInvalidationCannotReacquireAnotherAdapterBeforeRevival() { + MachineCapabilities caps = tank().machineCapabilities(); + IFluidHandler oldFluid = caps.fluids(null); + IItemHandler oldItems = caps.items(null); + caps.invalidate(); + assertClosed(caps); + caps.invalidate(); + assertClosed(caps); + caps.revive(); + assertTrue(caps.isValid()); + assertNotSame(oldFluid, caps.fluids(null)); + assertNotSame(oldItems, caps.items(null)); } - @Test public void removedTilesStillRefuseCapabilitiesUntilCleared() { - TestTank tank = new TestTank(); + @Test public void removedTilesStillRefuseAdaptersUntilCleared() { + MetalTankTileEntity tank = tank(); + IFluidHandler oldFluid = tank.machineCapabilities().fluids(null); + IItemHandler oldItems = tank.machineCapabilities().items(null); tank.setRemoved(); - tank.reviveNow(); - assertFalse(tank.getCapability(ForgeCapabilities.FLUID_HANDLER, null).isPresent()); - assertFalse(tank.getCapability(ForgeCapabilities.ITEM_HANDLER, null).isPresent()); + tank.reviveCaps(); + assertTrue(tank.isRemoved()); + assertUnavailable(tank.machineCapabilities()); tank.clearRemoved(); - assertTrue(tank.getCapability(ForgeCapabilities.FLUID_HANDLER, null).isPresent()); + assertFalse(tank.isRemoved()); + assertNotNull(tank.machineCapabilities().fluids(null)); + assertNotNull(tank.machineCapabilities().items(null)); + assertNotSame(oldFluid, tank.machineCapabilities().fluids(null)); + assertNotSame(oldItems, tank.machineCapabilities().items(null)); } - @Test public void conveyorsFollowTheSameUnloadAndRevivalContract() { - zone.moddev.mc.basepower.machines.conveyors.TileEntityConveyor conveyor = - new zone.moddev.mc.basepower.machines.conveyors.TileEntityConveyor(net.minecraft.core.BlockPos.ZERO, net.minecraft.world.level.block.Blocks.HOPPER.defaultBlockState()); - LazyOptional old = conveyor.getCapability(ForgeCapabilities.ITEM_HANDLER, null); - assertTrue(old.isPresent()); + @Test public void conveyorsKeepExactItemsAcrossUnloadRevivalAndSimulatedTransfers() { + TileEntityConveyor conveyor = Entities.CONVEYOR.create(BlockPos.ZERO, Blocks.item_conveyor.defaultBlockState()); + assertNotNull(conveyor); + MachineCapabilities caps = conveyor.machineCapabilities(); + IItemHandler old = caps.items(null); + assertNotNull(old); + ItemStack offered = new ItemStack(Items.DIRT, 32); + assertTrue(old.insertItem(0, offered, true).isEmpty()); + assertTrue(conveyor.isEmpty()); + assertEquals(32, offered.getCount()); + assertTrue(old.insertItem(0, offered, false).isEmpty()); + assertEquals(32, offered.getCount()); + assertEquals(32, conveyor.getItem(0).getCount()); conveyor.onChunkUnloaded(); assertFalse(conveyor.isRemoved()); - assertFalse(old.isPresent()); - assertFalse(conveyor.getCapability(ForgeCapabilities.ITEM_HANDLER, null).isPresent()); + assertClosed(caps); conveyor.clearRemoved(); - LazyOptional current = conveyor.getCapability(ForgeCapabilities.ITEM_HANDLER, null); - assertTrue(current.isPresent()); + IItemHandler current = caps.items(null); + assertNotNull(current); assertNotSame(old, current); + assertEquals(32, current.getStackInSlot(0).getCount()); + ItemStack preview = current.extractItem(0, 7, true); + assertTrue(preview.is(Items.DIRT)); + assertEquals(7, preview.getCount()); + assertEquals(32, current.getStackInSlot(0).getCount()); + ItemStack extracted = current.extractItem(0, 7, false); + assertTrue(extracted.is(Items.DIRT)); + assertEquals(7, extracted.getCount()); + assertEquals(25, conveyor.getItem(0).getCount()); + assertEquals(32, extracted.getCount() + conveyor.getItem(0).getCount()); } - @Test public void explicitNativeRevivalRestoresConverterEnergyWithoutLosingItsBuffer() { - TestConverter converter = new TestConverter(); - converter.receiveEnergy(200, false); - LazyOptional old = converter.getCapability(ForgeCapabilities.ENERGY, null); - assertTrue(old.isPresent()); - converter.onChunkUnloaded(); - assertFalse(old.isPresent()); - assertFalse(converter.getCapability(ForgeCapabilities.ENERGY, null).isPresent()); - converter.reviveNow(); - LazyOptional current = converter.getCapability(ForgeCapabilities.ENERGY, null); - assertTrue(current.isPresent()); - assertNotSame(old, current); + @Test public void explicitRevivalConservesConverterEnergyAndSimulationDoesNotChangeItsBuffer() { + TileEntityRFConverter converter = converter(); + assertEquals(200, converter.receiveEnergy(200, true)); + assertEquals(0, converter.getEnergyStored()); + assertEquals(200, converter.receiveEnergy(200, false)); + IItemHandler old = converter.machineCapabilities().items(null); + assertNotNull(old); + converter.invalidateCaps(); + assertClosed(converter.machineCapabilities()); assertEquals(200, converter.getEnergyStored()); + converter.reviveCaps(); + assertTrue(converter.machineCapabilities().isValid()); + assertNotNull(converter.machineCapabilities().items(null)); + assertNotSame(old, converter.machineCapabilities().items(null)); + assertEquals(75, converter.extractEnergy(75, true)); + assertEquals(200, converter.getEnergyStored()); + assertEquals(75, converter.extractEnergy(75, false)); + assertEquals(125, converter.getEnergyStored()); + assertEquals(200, 75 + converter.getEnergyStored()); } - @Test public void converterEnergyIsUnavailableDuringOtherAdapterNotifications() { - TestConverter converter = new TestConverter(); - LazyOptional item = converter.getCapability(ForgeCapabilities.ITEM_HANDLER, null); - AtomicBoolean called = new AtomicBoolean(), reacquired = new AtomicBoolean(); - item.addListener(ignored -> { - called.set(true); - reacquired.set(converter.getCapability(ForgeCapabilities.ENERGY, null).isPresent()); - }); + @Test public void converterUnloadClosesItsAdaptersWithoutLosingItsEnergy() { + TileEntityRFConverter converter = converter(); + assertEquals(200, converter.receiveEnergy(200, false)); + assertNotNull(converter.machineCapabilities().items(null)); converter.onChunkUnloaded(); - assertTrue(called.get()); - assertFalse(reacquired.get()); + assertFalse(converter.isRemoved()); + assertClosed(converter.machineCapabilities()); + assertEquals(200, converter.getEnergyStored()); + converter.reviveCaps(); + assertTrue(converter.machineCapabilities().isValid()); + assertNotNull(converter.machineCapabilities().items(null)); + assertEquals(200, converter.getEnergyStored()); + } + + @Test public void nativePayloadRoundTripPreservesEveryComponentAndMakesIndependentCopies() { + FluidStack offered = payload(700); + Tag original = offered.save(registries()); + cyano.poweradvantage.api.fluid.FluidStack legacy = ForgeFluidAdapter.fromForge(offered); + assertNotNull(legacy); + assertNotNull(legacy.tag); + CompoundTag expectedCustomData = offered.get(DataComponents.CUSTOM_DATA).copyTag(); + for (String key : expectedCustomData.getAllKeys()) { + assertEquals("Legacy custom data must survive: " + key, expectedCustomData.get(key), legacy.tag.get(key)); + } + FluidStack returned = ForgeFluidAdapter.toForge(legacy); + assertNotSame(offered, returned); + assertEquals(original, returned.save(registries())); + CompoundTag changed = returned.get(DataComponents.CUSTOM_DATA).copyTag(); + changed.getCompound("details").putInt("batch", 8); + returned.set(DataComponents.CUSTOM_DATA, CustomData.of(changed)); + returned.setAmount(1); + assertEquals(original, offered.save(registries())); + assertEquals(original, ForgeFluidAdapter.toForge(legacy).save(registries())); + assertEquals(700, legacy.amount); + } + + @Test public void legacyTagsSurviveTheNativePayloadEnvelopeWithoutAssumingTheOldRepresentation() { + cyano.poweradvantage.api.fluid.FluidStack source = + new cyano.poweradvantage.api.fluid.FluidStack(Fluids.WATER, 500); + source.tag = customData(); + CompoundTag original = source.tag.copy(); + FluidStack nativeStack = ForgeFluidAdapter.toForge(source); + assertEquals(original, nativeStack.get(DataComponents.CUSTOM_DATA).copyTag()); + cyano.poweradvantage.api.fluid.FluidStack returned = ForgeFluidAdapter.fromForge(nativeStack); + assertEquals(nativeStack.save(registries()), ForgeFluidAdapter.toForge(returned).save(registries())); + returned.tag.getCompound("basepower:neoforge_fluid").putInt("amount", 1); + assertEquals(original, source.tag); + assertEquals(500, nativeStack.getAmount()); + assertEquals(original, nativeStack.get(DataComponents.CUSTOM_DATA).copyTag()); + } + + @Test public void partialNativeRequestsConserveComponentsAndDoNotTreatAmountAsFluidIdentity() { + MetalTankTileEntity tank = tank(); + IFluidHandler adapter = tank.machineCapabilities().fluids(null); + FluidStack offered = payload(750); + Tag original = offered.save(registries()); + assertEquals(750, adapter.fill(offered, FluidAction.SIMULATE)); + assertEquals(0, tank.getTank().getFluidAmount()); + assertEquals(750, adapter.fill(offered, FluidAction.EXECUTE)); + FluidStack request = offered.copy(); + request.setAmount(250); + Tag requested = request.save(registries()); + FluidStack preview = adapter.drain(request, FluidAction.SIMULATE); + assertEquals(requested, preview.save(registries())); + assertEquals(750, tank.getTank().getFluidAmount()); + FluidStack extracted = adapter.drain(request, FluidAction.EXECUTE); + assertEquals(requested, extracted.save(registries())); + assertEquals(500, tank.getTank().getFluidAmount()); + assertEquals(750, extracted.getAmount() + tank.getTank().getFluidAmount()); + FluidStack remaining = offered.copy(); + remaining.setAmount(500); + assertEquals(remaining.save(registries()), adapter.getFluidInTank(0).save(registries())); + assertEquals(original, offered.save(registries())); + assertEquals(requested, request.save(registries())); + tank.invalidateCaps(); + assertClosed(tank.machineCapabilities()); + tank.reviveCaps(); + IFluidHandler revived = tank.machineCapabilities().fluids(null); + assertNotSame(adapter, revived); + assertEquals(remaining.save(registries()), revived.getFluidInTank(0).save(registries())); } - private static final class TestTank extends MetalTankTileEntity { - TestTank() { super(net.minecraft.core.BlockPos.ZERO, net.minecraft.world.level.block.Blocks.IRON_BLOCK.defaultBlockState()); } - void invalidateNow() { invalidateCaps(); } - void reviveNow() { reviveCaps(); } + private static MetalTankTileEntity tank() { + MetalTankTileEntity tank = Entities.METAL_TANK.create(BlockPos.ZERO, Blocks.metal_storage_tank.defaultBlockState()); + assertNotNull(tank); + assertTrue(Entities.METAL_TANK.isValid(tank.getBlockState())); + return tank; } - private static final class TestConverter extends cyano.poweradvantage.api.modsupport.rf.TileEntityRFConverter { - private static final BlockEntityType TYPE = - BlockEntityType.Builder.of(TestConverter::new, Blocks.IRON_BLOCK).build(null); - TestConverter() { this(BlockPos.ZERO, Blocks.IRON_BLOCK.defaultBlockState()); } - TestConverter(BlockPos pos, BlockState state) { - super(TYPE, pos, state, new cyano.poweradvantage.api.ConduitType("test-power"), 100, 1000, "test"); + private static TileEntityRFConverter converter() { + TileEntityRFConverter converter = Entities.RF_STEAM_CONVERTER.create( + BlockPos.ZERO, ModSupport.converter_rf_steam.defaultBlockState()); + assertNotNull(converter); + return converter; + } + + private static RegistryAccess.Frozen registries() { + return RegistryAccess.fromRegistryOfRegistries(BuiltInRegistries.REGISTRY); + } + + private static CompoundTag customData() { + CompoundTag data = new CompoundTag(); + data.putString("Owner", "native-lifecycle"); + CompoundTag details = new CompoundTag(); + details.putInt("batch", 7); + details.putIntArray("sequence", new int[] {3, 5, 8}); + data.put("details", details); + return data; + } + + private static FluidStack payload(int amount) { + FluidStack stack = new FluidStack(Fluids.WATER, amount); + stack.set(DataComponents.CUSTOM_DATA, CustomData.of(customData())); + stack.set(DataComponents.CUSTOM_NAME, Component.literal("Lifecycle water")); + return stack; + } + + private static void assertClosed(MachineCapabilities caps) { + assertFalse("Invalidated adapters must not become available again without revival", caps.isValid()); + assertUnavailable(caps); + } + + private static void assertUnavailable(MachineCapabilities caps) { + for (Direction face : Direction.values()) { + assertNull(caps.fluids(face)); + assertNull(caps.items(face)); } - void reviveNow() { reviveCaps(); } + assertNull(caps.fluids(null)); + assertNull(caps.items(null)); } } diff --git a/src/test/java/zone/moddev/mc/basepower/util/NativeBucketContentTest.java b/src/test/java/zone/moddev/mc/basepower/util/NativeBucketContentTest.java new file mode 100644 index 00000000..ff670d81 --- /dev/null +++ b/src/test/java/zone/moddev/mc/basepower/util/NativeBucketContentTest.java @@ -0,0 +1,24 @@ +package zone.moddev.mc.basepower.util; + +import org.junit.Test; +import static org.junit.Assert.*; +import zone.moddev.mc.basepower.init.Fluids; +import zone.moddev.mc.basepower.init.Items; + +public class NativeBucketContentTest { + @Test public void oilBucketsResolveToTheSourceEvenWhenFlowingWasRegisteredFirst() { + assertNotSame(Fluids.crude_oil, Fluids.flowing_crude_oil); + assertNotSame(Fluids.refined_oil, Fluids.flowing_refined_oil); + assertSame(Fluids.crude_oil, FluidContainerHelper.fluidForBucket(Items.crude_oil_bucket)); + assertSame(Fluids.refined_oil, FluidContainerHelper.fluidForBucket(Items.refined_oil_bucket)); + } + + @Test public void vanillaWaterLavaAndEmptyBucketsKeepTheirNativeIdentity() { + assertSame(net.minecraft.world.level.material.Fluids.WATER, + FluidContainerHelper.fluidForBucket(net.minecraft.world.item.Items.WATER_BUCKET)); + assertSame(net.minecraft.world.level.material.Fluids.LAVA, + FluidContainerHelper.fluidForBucket(net.minecraft.world.item.Items.LAVA_BUCKET)); + assertNull(FluidContainerHelper.fluidForBucket(net.minecraft.world.item.Items.BUCKET)); + assertNull(FluidContainerHelper.fluidForBucket(net.minecraft.world.item.Items.DIRT)); + } +} diff --git a/test-rig/build.gradle b/test-rig/build.gradle index b5bfae6e..838be307 100644 --- a/test-rig/build.gradle +++ b/test-rig/build.gradle @@ -1,332 +1,82 @@ -import org.apache.tools.ant.filters.FixCrLfFilter - +import java.security.MessageDigest plugins { id 'java' - id 'net.minecraftforge.gradle' version '7.0.34' -} - -ext.forge52MavenizerDefault = '../../../../MinecraftMineralogy/OS1211/OreSpawn/ci-fixtures/tools/minecraft-mavenizer-0.5.21-orespawn-compat.jar' -apply from: '../gradle/forge52-mavenizer.gradle' - -// Saves, pinned inputs and evidence are siblings, never Gradle cleanup targets. -layout.buildDirectory = layout.projectDirectory.dir('build/gradle') -tasks.named('clean', Delete) { - doFirst { - File expected = file('build/gradle').canonicalFile - if (layout.buildDirectory.get().asFile.canonicalFile != expected - || targetFiles.files.any { it.canonicalFile != expected }) { - throw new GradleException('Refusing to clean outside the isolated harness compiler output') - } - } + id 'net.neoforged.moddev' version '2.0.148' } - group = 'zone.moddev.mc.advantageworks' -version = project.harness_version +version = harness_version base.archivesName = 'AdvantageWorksTestHarness' - -java { - toolchain.languageVersion = JavaLanguageVersion.of(21) -} - -tasks.withType(JavaCompile).configureEach { - javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(21) - } - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - options.encoding = 'UTF-8' - options.compilerArgs.addAll(['-Xmaxerrs', '1000']) -} - -tasks.withType(AbstractArchiveTask).configureEach { - preserveFileTimestamps = false - reproducibleFileOrder = true -} - +// Generated worlds and sealed evidence are siblings, never clean-task targets. +layout.buildDirectory = layout.projectDirectory.dir('build/gradle') +java.toolchain.languageVersion = JavaLanguageVersion.of(21) sourceSets { main.java.srcDir 'shared-probe' test.java.srcDir 'unit-support' - // Preserve the 1.15 source oracle; its native 1.16 API copy runs instead. + test.java.srcDir 'src/runner/java' + // Retain the historical 1.15 oracle; Native117HarvestIsolationTest runs its native counterpart. test.java.exclude '**/NativeHarvestIsolationTest.java' - runner { - java.srcDir 'src/runner/java' - resources.srcDir 'src/runner/resources' - } -} - -minecraft { - mappings channel: project.mapping_channel, version: project.mapping_version + runner { java.srcDir 'src/runner/java'; resources.srcDir 'src/runner/resources' } } - -repositories { - minecraft.mavenizer(it) - maven fg.forgeMaven - maven fg.minecraftLibsMaven - mavenCentral() - maven { - name = 'MinecraftLibraries' - url = 'https://libraries.minecraft.net/' - } -} - -def powerCompileJar = file(project.findProperty('powerAdvantageReleaseJar') - ?: '../build/libs/basePower-2.4.14.121011.jar') -def exploratoryPowerSha = providers.gradleProperty('worksExploratoryPowerSha256') -def powerCompileSha = exploratoryPowerSha.orElse(providers.gradleProperty('works_power_sha256')) - +repositories { mavenCentral(); maven { url = 'https://maven.moddev.zone/releases' } } +def powerJar = file(providers.gradleProperty('powerAdvantageReleaseJar') + .getOrElse('../build/libs/basePower-2.4.19.121012.jar')) dependencies { - implementation minecraft.dependency( - "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}") + implementation files(powerJar) + implementation 'zone.moddev.mc.basemetals:BaseMetals:4.0.1.121012+Neo' + implementation 'zone.moddev.mc.lib:mmdlib:2.0.2.121012+Neo' + implementation 'zone.moddev.mc.orespawn:OreSpawn:4.1.1.121012' runnerImplementation 'com.google.code.gson:gson:2.8.0' - testImplementation sourceSets.runner.output testImplementation 'junit:junit:4.13.2' - compileOnly files(powerCompileJar) + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.11.4' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } - -def compileUnitBootstrap = tasks.register('compileUnitBootstrap', JavaCompile) { - source fileTree('unit-bootstrap') - classpath = files() - destinationDirectory = layout.buildDirectory.dir('unit-bootstrap/classes') +neoForge { + version = '21.1.265' + mods { advantageworkstest { sourceSet sourceSets.main } } + unitTest { enable(); testedMod = mods.advantageworkstest } } -def unitBootstrapJar = tasks.register('unitBootstrapJar', Jar) { - dependsOn compileUnitBootstrap - archiveFileName = 'forge-native-unit-bootstrap.jar' - destinationDirectory = layout.buildDirectory.dir('unit-bootstrap') - from compileUnitBootstrap.flatMap { it.destinationDirectory } - manifest.attributes('Premain-Class': 'zone.moddev.mc.advantageworks.unit.ForgeCapabilityBootstrap') +neoForge.addModdingDependenciesTo(sourceSets.test) + +tasks.named('test', Test) { + useJUnitPlatform() + maxHeapSize = '2G' + maxParallelForks = 1 + systemProperty 'advantage.test.projectDir', projectDir.absolutePath + jvmArgs '-XX:ActiveProcessorCount=4' + testLogging { events 'failed'; exceptionFormat = 'short' } } -tasks.withType(Test).configureEach { - dependsOn unitBootstrapJar - doFirst { jvmArgs "-javaagent:${unitBootstrapJar.get().archiveFile.get().asFile}" } +tasks.withType(JavaCompile).configureEach { + options.release = 21 + options.encoding = 'UTF-8' + options.compilerArgs.addAll(['-Xmaxerrs','1000']) } +tasks.withType(AbstractArchiveTask).configureEach { preserveFileTimestamps = false; reproducibleFileOrder = true } -tasks.register('verifyWorksCompileInputPin') { - group = 'verification' - description = 'Checks the exact parent-supplied Power API artifact before harness compilation.' - inputs.file(powerCompileJar) - inputs.property('powerSha256', powerCompileSha.orElse('')) - doLast { - if (!powerCompileJar.isFile()) throw new GradleException("Missing 1.21.1 Power compile input: ${powerCompileJar}") - if (!(powerCompileSha.getOrElse('') ==~ /[A-Fa-f0-9]{64}/)) { - throw new GradleException('Missing or invalid Power SHA-256 pin') - } - String actual = java.security.MessageDigest.getInstance('SHA-256') - .digest(powerCompileJar.bytes).encodeHex().toString().toUpperCase(Locale.ROOT) - if (!actual.equalsIgnoreCase(powerCompileSha.get())) { - throw new GradleException("Power compile input changed: ${actual}; obtain a new parent pin") - } - String status = exploratoryPowerSha.isPresent() ? 'EXPLORATORY_UNQUALIFIED' : 'Pinned' - logger.lifecycle("${status} Power compile/runtime input: ${actual}") +tasks.named('clean', Delete) { + doFirst { + File expected = layout.projectDirectory.dir('build/gradle').asFile.canonicalFile + if (targetFiles.files.any { it.canonicalFile != expected }) + throw new GradleException('Refusing to clean outside the isolated harness compiler output') } } -tasks.named('compileJava') { dependsOn tasks.named('verifyWorksCompileInputPin') } - -tasks.named('test', Test) { - def temp = layout.buildDirectory.dir('test-temp') - doFirst { temp.get().asFile.mkdirs() } - systemProperty 'java.io.tmpdir', temp.get().asFile.absolutePath +tasks.named('processRunnerResources') { + from('src/main/resources') { include 'assets/advantageworkstest/works/flat-generator.json' } } - -tasks.named('processResources', ProcessResources) { - filteringCharset = 'UTF-8' +tasks.named('processResources') { inputs.property('version', project.version) - inputs.property('mcversion', project.minecraft_version) - filesMatching('META-INF/mods.toml') { - expand version: project.version - } - filesMatching(['**/*.json', '**/*.info', '**/*.properties', '**/*.md']) { - filter(FixCrLfFilter, - eol: FixCrLfFilter.CrLf.newInstance('lf'), - eof: FixCrLfFilter.AddAsisRemove.newInstance('asis')) - } + filesMatching('META-INF/neoforge.mods.toml') { expand version: project.version } } - tasks.named('jar', Jar) { - manifest { - attributes([ - 'Implementation-Title': base.archivesName.get(), - 'Implementation-Version': project.version, - 'Built-On': "${project.minecraft_version}-${project.forge_version}", - 'Power-Input-Status': 'EXPLORATORY_UNQUALIFIED', - 'Power-Input-SHA256': powerCompileSha.getOrElse('').toUpperCase(Locale.ROOT) - ]) - } + inputs.file(powerJar) + manifest.attributes('Implementation-Version': project.version, 'Built-On': '1.21.1-NeoForge-21.1.265', + 'Power-Input-Status': 'EXPLORATORY_UNQUALIFIED', + 'Power-Input-SHA256': MessageDigest.getInstance('SHA-256').digest(powerJar.bytes).encodeHex().toString().toUpperCase(Locale.ROOT)) } - -tasks.named('processRunnerResources', ProcessResources) { - from('src/main/resources') { - include 'assets/advantageworkstest/works/flat-generator.json' - } -} - tasks.register('runnerJar', Jar) { dependsOn tasks.named('runnerClasses') archiveClassifier = 'runner' from sourceSets.runner.output manifest.attributes('Main-Class': 'zone.moddev.mc.advantageworks.runner.WorksRunner') } - -tasks.named('assemble') { - dependsOn tasks.named('runnerJar') -} - -def configurePreparedSeedArgs = { JavaExec task -> - def options = [ - worksServerSeed: '--prepared-server-seed', - worksServerInventory: '--prepared-server-seed-inventory', - worksServerInventorySha256: '--prepared-server-seed-sha256' - ] - options.each { key, option -> - if (project.hasProperty(key)) { - String value = project.property(key).toString() - task.args option, key.endsWith('Sha256') ? value : file(value).absolutePath - } - } -} - -def registerWorksRunner = { String taskName, String profileName, boolean automated, String taskDescription -> - tasks.register(taskName, JavaExec) { - group = 'verification' - description = taskDescription - dependsOn tasks.named('jar') - dependsOn tasks.named('runnerClasses') - classpath = sourceSets.runner.runtimeClasspath - mainClass = 'zone.moddev.mc.advantageworks.runner.WorksRunner' - if (!automated) standardInput = System.in - doFirst { JavaExec task -> - String pin = providers.gradleProperty('worksProfileFile').orNull - if (!pin) throw new GradleException("Generate the pinned ${profileName} profile with migration/native1211.py profile and set -PworksProfileFile") - File profile = file(pin) - if (new groovy.json.JsonSlurper().parse(profile).name != profileName) { - throw new GradleException("Expected profile ${profileName}: ${profile}") - } - args '--profile', profile.absolutePath - configurePreparedSeedArgs(task) - } - if (automated) args '--automated' - if (project.hasProperty('worksStations')) { - args '--stations', project.property('worksStations').toString() - } - if (project.hasProperty('worksRunSeconds')) { - args '--run-seconds', project.property('worksRunSeconds').toString() - } - if (project.hasProperty('worksServerPort')) { - args '--server-port', project.property('worksServerPort').toString() - } - } -} - -registerWorksRunner('runWorksDev', 'dev-core', false, - 'Builds and launches a disposable interactive 1.21.1 Advantage Works development server.') -registerWorksRunner('verifyWorksDev', 'dev-core', true, - 'Generates, checks, restarts, and rechecks the disposable development works.') -registerWorksRunner('verifyWorksTechProgression', 'dev-core-tech-progression', true, - 'Checks registration and construction with TECH_PROGRESSION recipes.') -registerWorksRunner('verifyWorksApocalyptic', 'dev-core-apocalyptic', true, - 'Checks registration and construction with APOCALYPTIC recipes.') -registerWorksRunner('verifyWorksPackagedCurrent', 'packaged-current', true, - 'Runs packaged Advantage mods with current BaseMetals and pinned OreSpawn 4.') -registerWorksRunner('verifyWorksPackagedDecoupled', 'packaged-decoupled', true, - 'Runs packaged Advantage mods without BaseMetals or Mineralogy, retaining required OreSpawn 4.') -registerWorksRunner('verifyWorksPackagedMineralogy', 'packaged-mineralogy', true, - 'Runs Mineralogy crude oil through packaged Power distillation and Steam boilers.') -registerWorksRunner('verifyWorksPackagedOptionalPower', 'packaged-optional-power', true, - 'Exercises the preserved RF- and Tech Reborn-labelled converter IDs through Forge Energy.') -registerWorksRunner('verifyWorksWorldgenAdvantage', 'worldgen-advantage', true, - 'Samples Advantage fallback ores and desert oil, then verifies profile overrides through restart.') -registerWorksRunner('verifyWorksWorldgenMineralogy', 'worldgen-mineralogy', true, - 'Samples Mineralogy-owned sulfur/ocean oil and Advantage fallbacks through restart.') -registerWorksRunner('verifyWorksWorldgenLegacyImport', 'worldgen-legacy-import', true, - 'Imports legacy Power/Electric OreSpawn files and rejects duplicate active modern rules.') -registerWorksRunner('runWorksPackagedCurrent', 'packaged-current', false, - 'Launches the complete packaged works on localhost for manual inspection.') - -tasks.register('verifyWorksNative1211Inputs', JavaExec) { - group = 'verification' - description = 'Checks 1.21.1 candidate identities and hashes without creating or opening a world.' - dependsOn tasks.named('runnerClasses'), tasks.named('jar') - classpath = sourceSets.runner.runtimeClasspath - mainClass = 'zone.moddev.mc.advantageworks.runner.WorksRunner' - doFirst { JavaExec task -> - String pin = providers.gradleProperty('worksProfileFile').orNull - if (!pin) throw new GradleException('Set -PworksProfileFile to a generated Forge 52 profile') - args '--profile', file(pin).absolutePath, '--validate-only' - configurePreparedSeedArgs(task) - } -} - -tasks.register('verifyHarnessIsolation') { - group = 'verification' - description = 'Confirms the PowerAdvantage release contains no test-harness content.' - doLast { - File powerJar = powerCompileJar - if (!powerJar.isFile()) { - throw new GradleException("Build PowerAdvantage first: ${powerJar}") - } - def forbidden = ['zone/moddev/mc/advantageworks/', 'assets/advantageworkstest/'] - def zip = new java.util.zip.ZipFile(powerJar) - try { - def leaked = zip.entries().findAll { entry -> forbidden.any { entry.name.startsWith(it) } } - if (leaked) { - throw new GradleException("Harness content leaked into PowerAdvantage: ${leaked*.name}") - } - } finally { - zip.close() - } - } -} - -tasks.named('check') { - dependsOn tasks.named('verifyHarnessIsolation') -} - -def nativeControlClasspath = configurations.compileClasspath.minus(files(powerCompileJar)) -def compileUnitSupport = tasks.register('compileUnitSupport', JavaCompile) { - source fileTree('unit-support') - classpath = nativeControlClasspath - destinationDirectory = layout.buildDirectory.dir('unit-support/classes') -} -tasks.register('verifyForge52UnitBootstrap', JavaExec) { - group = 'verification' - dependsOn compileUnitSupport, unitBootstrapJar - classpath = files(compileUnitSupport.flatMap { it.destinationDirectory }) + nativeControlClasspath - mainClass = 'zone.moddev.mc.advantageworks.unit.Forge52UnitControl' - javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(21) } - doFirst { jvmArgs "-javaagent:${unitBootstrapJar.get().archiveFile.get().asFile}" } -} -def compilePlatformControls = tasks.register('compilePlatformControls', JavaCompile) { - source fileTree('platform-controls') - dependsOn compileUnitSupport - classpath = nativeControlClasspath + files(compileUnitSupport.flatMap { it.destinationDirectory }) - destinationDirectory = layout.buildDirectory.dir('platform-controls/classes') -} -tasks.register('verifyNativeWolfPlatform', JavaExec) { - group = 'verification' - dependsOn compilePlatformControls, unitBootstrapJar - classpath = files(compilePlatformControls.flatMap { it.destinationDirectory }, - compileUnitSupport.flatMap { it.destinationDirectory }) + nativeControlClasspath - mainClass = 'NativeWolfPlatformControl' - javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(21) } - doFirst { - def output = providers.gradleProperty('nativeControlOutput').orNull - if (!output || file(output).exists()) throw new GradleException('Supply a new -PnativeControlOutput directory') - args file(output).absolutePath - jvmArgs "-javaagent:${unitBootstrapJar.get().archiveFile.get().asFile}" - } -} - -tasks.register('verifyNativeLeashKnotPlatform', JavaExec) { - group = 'verification' - dependsOn compilePlatformControls, unitBootstrapJar - classpath = files(compilePlatformControls.flatMap { it.destinationDirectory }, - compileUnitSupport.flatMap { it.destinationDirectory }) + nativeControlClasspath - mainClass = 'NativeLeashKnotPlatformControl' - javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(21) } - doFirst { - def output = providers.gradleProperty('nativeControlOutput').orNull - if (!output || file(output).exists()) throw new GradleException('Supply a new -PnativeControlOutput directory') - args file(output).absolutePath - jvmArgs "-javaagent:${unitBootstrapJar.get().archiveFile.get().asFile}" - } -} +tasks.named('assemble') { dependsOn tasks.named('runnerJar') } diff --git a/test-rig/client-integration/README.md b/test-rig/client-integration/README.md new file mode 100644 index 00000000..78b70b0d --- /dev/null +++ b/test-rig/client-integration/README.md @@ -0,0 +1,73 @@ +# Marked Native Client Integration + +This test-only helper is separate from the worldless resource probe and from +the packaged harness. It loads a copied world through Minecraft 1.21.1's real +`Minecraft.createWorldOpenFlows().openWorld(String, Runnable)` API. It never +constructs a fake level/player, calls machine ticks, replaces entity methods, +or drives Windows UI. Backup/datapack/experimental confirmation screens are +not accepted or bypassed: an aborted or timed-out load fails qualification. + +The native source inspection used `WorldOpenFlows`, `Minecraft`, +`MultiPlayerGameMode` and `PauseScreen` in the generated NeoForge 21.1.247 +sources jar. `gameMode.useItemOn` sends `ServerboundUseItemOnPacket` through the +real connection. MachineGUIRegistry's real menu factory and open-menu packet +must establish matching positive client/server container IDs and a real screen. + +## Evidence And Scope + +The only approved source is the **closed** F-operations +`test-rig/build/neo1211-operations-f/AdvantageWorksMigration` copy. Preparation +requires its passing report, obtains its native session lock, fingerprints all +world data except the lock itself, copies into a fresh `build/client-integration` +directory, and rechecks source hashes. It never uses a live endurance or original +fixture world. Each phase is explicitly marked; previous receipts are retained. + +The first process places one isolated tank/platform on the disposable copy, +seeds 1,375 mB of water and typed persistent witnesses on the real server thread, +and teleports the genuine joined player within normal interaction range. No +client tank or menu is fabricated. The helper then issues a real right-click, +checks the actual screen, menu IDs/type, server validity and synchronized client +tank reading, closes the menu, and uses the normal disconnect/save-and-quit path. + +The reload process does **not** reseed the tank. Before opening its real menu, +it checks the cold-loaded typed tank compound against the initial receipt and +requires the typed persistent witnesses. Its process ID must differ. Both +phases verify recorded native runtime jars, staged mod jars, and production +class/resource hashes before and after the flow. This is dev-classpath proof, +not a claim that the player jar itself was the loaded Power code. + +The disposable profile disables first-run accessibility onboarding and pause on +lost focus through normal local options. No global Minecraft settings change. +There is a 180-second in-process timeout. A FAIL or missing receipt is never PASS. + +## Commands + +Coordinate the Power Gradle cache before either invocation. From the Power root: + +This probe is a Gradle-only diagnostic with explicit world-selection properties. +It is not an IDE launch, and Eclipse synchronization must not prepare its world. + +```powershell +$env:JAVA_HOME = 'C:/Users/johnb/.jdks/temurin-21.0.7+6' +$env:GRADLE_USER_HOME = 'D:/PowerAdvantage/.gradle-power1211neo' +./gradlew.bat runClientIntegration ` + -PclientIntegrationDirectory=build/client-integration/ ` + -PclientIntegrationSourceWorld=test-rig/build/neo1211-operations-f/AdvantageWorksMigration ` + -PclientIntegrationPhase=initial --console=plain +``` + +For a second **full client process**, keep the same copied world and directory: + +```powershell +./gradlew.bat runClientIntegration ` + -PclientIntegrationDirectory=build/client-integration/native-f-04 ` + -PclientIntegrationPhase=reload --console=plain +``` + +Both `native-f-04/client-integration-initial.json` (PID 44320) and +`native-f-04/client-integration-reload.json` (PID 68160) passed. The second full +client process cold-loaded the identical typed tank compound containing 1,375 mB +of water, established matching positive client/server menu ID 1, and completed +normal save-and-quit. Earlier compile/staging failures and the terminated +pre-world onboarding attempt are retained in +`build/client-integration-*.log`; none qualifies as gameplay proof. diff --git a/test-rig/client-integration/java/zone/moddev/mc/advantageworks/integration/NativeClientIntegration.java b/test-rig/client-integration/java/zone/moddev/mc/advantageworks/integration/NativeClientIntegration.java new file mode 100644 index 00000000..879a4043 --- /dev/null +++ b/test-rig/client-integration/java/zone/moddev/mc/advantageworks/integration/NativeClientIntegration.java @@ -0,0 +1,221 @@ +package zone.moddev.mc.advantageworks.integration; + +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import cyano.poweradvantage.api.fluid.FluidStack; +import cyano.poweradvantage.api.simple.SimpleMachineGUI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.security.MessageDigest; +import java.util.HexFormat; +import java.util.TreeMap; +import java.util.concurrent.CompletableFuture; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.screens.TitleScreen; +import net.minecraft.client.gui.screens.GenericMessageScreen; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.TagParser; +import net.minecraft.network.chat.Component; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.material.Fluids; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.Vec3; +import net.neoforged.fml.ModList; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.client.event.ClientTickEvent; +import zone.moddev.mc.basepower.machines.fluidmachines.StorageTankTileEntity; +import zone.moddev.mc.basepower.registry.MachineGUIRegistry; + +/** Marked real integrated-server flow; deliberately separate from the worldless resource probe. */ +@Mod("advantage_client_integration") +public final class NativeClientIntegration { + private static final BlockPos POS = new BlockPos(50004, 90, 50004); + private final long started = System.nanoTime(); + private JsonObject marker, result; + private Path root, output; + private String phase; + private int state, age; + private CompletableFuture pending; + private int lastState = -1; + + public NativeClientIntegration() { + if (Boolean.getBoolean("advantageworks.clientIntegration")) NeoForge.EVENT_BUS.addListener(this::tick); + } + + private void tick(ClientTickEvent.Post event) { + Minecraft mc = Minecraft.getInstance(); + try { + if (state == 99) return; + if (root == null) root = mc.gameDirectory.toPath().toRealPath(); + if (lastState != state) { + com.mojang.logging.LogUtils.getLogger().info("NATIVE_CLIENT_INTEGRATION state={} screen={}", state, + mc.screen == null ? "null" : mc.screen.getClass().getName()); + lastState = state; + } + if ((System.nanoTime() - started) / 1_000_000_000L > 180) throw new IllegalStateException("Native integration timed out at state " + state + " screen=" + mc.screen); + if (state == 0) { + if (!(mc.screen instanceof TitleScreen) || mc.getOverlay() != null) return; + root = mc.gameDirectory.toPath().toRealPath(); + marker = JsonParser.parseString(Files.readString(root.resolve("client-integration.allow.json"))).getAsJsonObject(); + require(marker.get("schema").getAsInt() == 1 && marker.get("disposable").getAsBoolean(), "Unmarked integration directory"); + phase = marker.get("phase").getAsString(); + require(phase.equals("initial") || phase.equals("reload"), "Unknown integration phase"); + output = root.resolve("client-integration-" + phase + ".json"); + require(!Files.exists(output), "Refusing to replace an integration receipt"); + verifyInputs(); + result = new JsonObject(); + result.addProperty("status", "RUNNING"); + result.addProperty("phase", phase); + result.addProperty("pid", ProcessHandle.current().pid()); + result.add("input", marker.deepCopy()); + var mods = new TreeMap(); + ModList.get().getMods().forEach(mod -> mods.put(mod.getModId(), mod.getVersion().toString())); + require(mods.keySet().containsAll(java.util.Set.of("basepower", "basesteam", "baseelectric", "basemetals", "mmdlib", "orespawn", "advantage_client_integration")), "Missing integrated-client mod: " + mods); + require(!mods.containsKey("advantageclientresources") && !mods.containsKey("advantageworkstest"), "Worldless probe/harness must not be loaded"); + result.add("loadedMods", new com.google.gson.Gson().toJsonTree(mods)); + if (phase.equals("reload")) require(previous().get("pid").getAsLong() != ProcessHandle.current().pid(), "Reload must use a different full client process"); + state = 1; + mc.options.pauseOnLostFocus = false; + mc.createWorldOpenFlows().openWorld("ClientIntegrationWorld", () -> fail(new IllegalStateException("Normal world-open flow aborted"))); + return; + } + if (state == 1) { + if (mc.level == null || mc.player == null || mc.getSingleplayerServer() == null || mc.player.connection == null) return; + var server = mc.getSingleplayerServer(); + final CompoundTag previousTank = phase.equals("reload") ? TagParser.parseTag(previous().get("tankNbt").getAsString()) : null; + pending = server.submit(() -> { + var level = server.overworld(); + var player = server.getPlayerList().getPlayer(mc.player.getUUID()); + require(player != null && player.connection != null, "No real integrated-server player"); + if (phase.equals("initial")) { + require(level.isEmptyBlock(POS), "Integration witness location was not empty"); + for (int x = -1; x <= 1; x++) for (int z = -1; z <= 3; z++) { + BlockPos floor = POS.offset(x, -1, z); + require(level.isEmptyBlock(floor), "Integration platform would overwrite a fixture"); + level.setBlockAndUpdate(floor, net.minecraft.world.level.block.Blocks.BEDROCK.defaultBlockState()); + } + var block = BuiltInRegistries.BLOCK.get(net.minecraft.resources.ResourceLocation.parse("basepower:fluid_storage_tank")); + level.setBlockAndUpdate(POS, block.defaultBlockState()); + var tank = (StorageTankTileEntity) level.getBlockEntity(POS); + tank.getTank().setFluid(new FluidStack(Fluids.WATER, 1375)); + tank.getPersistentData().putInt("ClientIntegrationTypedInt", 1375); + tank.getPersistentData().putString("ClientIntegrationWitness", "real-menu-two-process"); + tank.setChanged(); + } + var tank = (StorageTankTileEntity) level.getBlockEntity(POS); + require(tank != null, "Persisted tank is absent"); + CompoundTag nbt = tank.saveWithFullMetadata(level.registryAccess()); + require(nbt.getCompound("Tank").contains("Amount", 3) && nbt.getCompound("Tank").contains("FluidName", 8), "Wrong tank NBT types"); + require(tank.getTank().getFluidAmount() == 1375 && tank.getTank().getFluid().getFluid() == Fluids.WATER, "Wrong persisted tank fluid/volume"); + require(tank.getPersistentData().getInt("ClientIntegrationTypedInt") == 1375 && tank.getPersistentData().contains("ClientIntegrationTypedInt", 3), "Persistent typed witness changed"); + require("real-menu-two-process".equals(tank.getPersistentData().getString("ClientIntegrationWitness")), "Persistent string witness changed"); + if (previousTank != null) require(nbt.getCompound("Tank").equals(previousTank), "Cold-reload typed tank data changed"); + player.setItemInHand(InteractionHand.MAIN_HAND, ItemStack.EMPTY); + player.teleportTo(level, POS.getX() + 0.5, POS.getY(), POS.getZ() + 2.5, java.util.Set.of(), 180, 15); + JsonObject observed = new JsonObject(); + observed.addProperty("tankNbt", nbt.getCompound("Tank").toString()); + observed.addProperty("serverPlayerUuid", player.getUUID().toString()); + observed.addProperty("serverGameTime", level.getGameTime()); + return observed; + }); + state = 2; + return; + } + if (state == 2) { + if (!pending.isDone()) return; + JsonObject observed = pending.join(); + observed.entrySet().forEach(entry -> result.add(entry.getKey(), entry.getValue())); + if (mc.player.distanceToSqr(Vec3.atCenterOf(POS)) > 20 || !mc.level.hasChunkAt(POS)) return; + if (!(mc.level.getBlockEntity(POS) instanceof StorageTankTileEntity tank) || tank.getTank().getFluidAmount() != 1375) return; + mc.player.setShiftKeyDown(false); + mc.gameMode.useItemOn(mc.player, InteractionHand.MAIN_HAND, new BlockHitResult( + Vec3.atCenterOf(POS).add(0, 0, 0.5), Direction.SOUTH, POS, false)); + state = 3; + return; + } + if (state == 3) { + if (!(mc.screen instanceof SimpleMachineGUI.GUIContainer) || !(mc.player.containerMenu instanceof SimpleMachineGUI.Container)) return; + require(mc.player.containerMenu.getType() == MachineGUIRegistry.TYPE && mc.player.containerMenu.containerId > 0, "Wrong real client menu"); + int clientId = mc.player.containerMenu.containerId; + var clientTank = (StorageTankTileEntity) mc.level.getBlockEntity(POS); + require(clientTank.getTank().getFluidAmount() == 1375 && clientTank.getTank().getFluid().getFluid() == Fluids.WATER, "Client tank reading did not synchronize"); + result.addProperty("clientMenuId", clientId); + result.addProperty("clientMenuClass", mc.player.containerMenu.getClass().getName()); + result.addProperty("clientScreenClass", mc.screen.getClass().getName()); + var server = mc.getSingleplayerServer(); + pending = server.submit(() -> { + var player = server.getPlayerList().getPlayer(mc.player.getUUID()); + require(player.containerMenu.getType() == MachineGUIRegistry.TYPE && player.containerMenu.containerId == clientId, "Server/client menu handshake IDs disagree"); + require(player.containerMenu.stillValid(player), "Server menu is invalid"); + JsonObject observed = new JsonObject(); + observed.addProperty("serverMenuId", player.containerMenu.containerId); + observed.addProperty("serverMenuClass", player.containerMenu.getClass().getName()); + return observed; + }); + state = 4; + return; + } + if (state == 4) { + if (!pending.isDone()) return; + pending.join().entrySet().forEach(entry -> result.add(entry.getKey(), entry.getValue())); + if (++age < 40) return; + mc.player.closeContainer(); + mc.level.disconnect(); + mc.disconnect(new GenericMessageScreen(Component.literal("Saving disposable integration world"))); + mc.setScreen(new TitleScreen()); + state = 5; + return; + } + if (state == 5) { + require(mc.level == null && mc.getSingleplayerServer() == null, "Integrated server has not shut down"); + verifyInputs(); + result.addProperty("status", "PASS"); + result.addProperty("gracefulSaveAndQuit", true); + Files.writeString(output, new GsonBuilder().setPrettyPrinting().create().toJson(result) + "\n", StandardOpenOption.CREATE_NEW); + state = 99; + mc.stop(); + } + } catch (Throwable failure) { fail(failure); } + } + + private JsonObject previous() throws Exception { + JsonObject prior = JsonParser.parseString(Files.readString(root.resolve("client-integration-initial.json"))).getAsJsonObject(); + require("PASS".equals(prior.get("status").getAsString()), "Initial process did not pass"); + return prior; + } + + private void verifyInputs() throws Exception { + for (var entry : marker.getAsJsonObject("inputSha256").entrySet()) { + String actual = HexFormat.of().formatHex(MessageDigest.getInstance("SHA-256").digest(Files.readAllBytes(Path.of(entry.getKey())))); + require(actual.equalsIgnoreCase(entry.getValue().getAsString()), "Input changed: " + entry.getKey()); + } + } + + private void fail(Throwable error) { + error.printStackTrace(); + try { + if (root != null) { + JsonObject failure = result == null ? new JsonObject() : result; + failure.addProperty("status", "FAIL"); + failure.addProperty("error", error.toString()); + failure.addProperty("state", state); + Files.writeString(root.resolve("client-integration-failure-" + ProcessHandle.current().pid() + ".json"), + new GsonBuilder().setPrettyPrinting().create().toJson(failure), StandardOpenOption.CREATE_NEW); + } + } catch (Exception receiptFailure) { receiptFailure.printStackTrace(); } + state = 99; + Minecraft mc = Minecraft.getInstance(); + try { if (mc.level != null) mc.level.disconnect(); mc.disconnect(); } finally { mc.stop(); } + } + + private static void require(boolean condition, String message) { + if (!condition) throw new IllegalStateException(message); + } +} diff --git a/test-rig/client-integration/resources/META-INF/neoforge.mods.toml b/test-rig/client-integration/resources/META-INF/neoforge.mods.toml new file mode 100644 index 00000000..4dc9f364 --- /dev/null +++ b/test-rig/client-integration/resources/META-INF/neoforge.mods.toml @@ -0,0 +1,13 @@ +modLoader="javafml" +loaderVersion="[4,)" +license="GPL-3.0-only" +[[mods]] +modId="advantage_client_integration" +version="1.0.0" +displayName="Marked Native Client Integration" +[[dependencies.advantage_client_integration]] +modId="basepower" +type="required" +versionRange="[2.4.19.121012]" +ordering="AFTER" +side="CLIENT" diff --git a/test-rig/client-resources/README.md b/test-rig/client-resources/README.md index 0331a8f3..30188496 100644 --- a/test-rig/client-resources/README.md +++ b/test-rig/client-resources/README.md @@ -1,5 +1,44 @@ # Native Client Resource Check +## NeoForge 1.21.1 Local Port + +The probe Java and resources now target NeoForge 21.1.265 and Power +2.4.19.121012, with Steam/Electric 2.2.20.121012. They compile against Java 21 +and the native ModDevGradle classpath. No Power Gradle build was started by the +probe worker. The parent can rebuild `clientResourceProbeJar` in its own build. + +The complete body/import preservation test is bound to released Forge 1.21.1 +commit `8d9937b3c0c9ef28a231b90fc2ff6adfea1af733`, with explicit reviewed +NeoForge adapters only. The 26 independent full-gauge sprite comparisons, +351 combined caption cases and 355 deliberately broken caption controls remain +unchanged. Static mutation tests do not establish rendered-client acceptance. + +Each recipe-book packet requires its own `recipes-