From 36e33f28893d0480a7a844ee2cb16a33fa22454b Mon Sep 17 00:00:00 2001 From: JohnBraham Date: Wed, 11 Nov 2026 11:04:23 +0000 Subject: [PATCH 1/3] Port baseElectric to Forge 1.21.1 --- .github/verify-published-pins.sh | 22 +++- .github/workflows/ci.yml | 24 ++-- .github/workflows/codeql-analysis.yml | 12 +- .github/workflows/validate-gradle-build.yml | 4 +- CHANGELOG.txt | 6 + README.md | 37 +++--- build.gradle | 123 ++++++++++-------- docs/NATIVE1211.md | 46 +++++++ gradle.properties | 55 ++++---- ...enizer.gradle => forge52-mavenizer.gradle} | 10 +- .../mc/baseelectric/ElectricAdvantage.java | 4 +- .../moddev/mc/baseelectric/blocks/Ore.java | 4 +- .../baseelectric/compat/BaseMetalsCompat.java | 7 +- .../baseelectric/graphics/BufferedQuads.java | 8 +- .../graphics/ElectricRenderTypes.java | 3 +- .../graphics/HydroturbineRenderer.java | 2 +- .../graphics/LaserDrillRenderer.java | 2 +- .../graphics/LaserTurretRenderer.java | 2 +- .../mc/baseelectric/gui/ArcFurnaceGUI.java | 2 +- .../mc/baseelectric/gui/BatteryArrayGUI.java | 2 +- .../mc/baseelectric/gui/ElectricDrillGUI.java | 2 +- .../mc/baseelectric/gui/ElectricPumpGUI.java | 2 +- .../mc/baseelectric/gui/ElectricStillGUI.java | 2 +- .../mc/baseelectric/gui/FabricatorGUI.java | 2 +- .../baseelectric/gui/GenericMachineGUI.java | 2 +- .../gui/GrowthChamberControllerGUI.java | 2 +- .../mc/baseelectric/gui/GrowthChamberGUI.java | 2 +- .../moddev/mc/baseelectric/gui/OvenGUI.java | 2 +- .../baseelectric/gui/PlasticRefineryGUI.java | 2 +- .../baseelectric/gui/PowerGeneratorGUI.java | 2 +- .../mc/baseelectric/gui/RockCrusherGUI.java | 2 +- .../moddev/mc/baseelectric/init/Blocks.java | 4 +- .../moddev/mc/baseelectric/init/Entities.java | 4 +- .../moddev/mc/baseelectric/init/Items.java | 2 +- .../baseelectric/init/OreSpawnWorldGen.java | 14 +- .../moddev/mc/baseelectric/init/Power.java | 2 +- .../machines/ElectricMachineTileEntity.java | 6 +- .../GrowthChamberControllerTileEntity.java | 2 +- .../machines/LaserTurretTileEntity.java | 2 +- .../machines/PlasticRefineryTileEntity.java | 2 +- .../migration/ElectricLegacyMigrations.java | 2 +- .../util/crafting/ItemMatcher.java | 6 +- .../util/crafting/RecipeDeconstructor.java | 1 - .../util/farming/VirtualCrop.java | 2 +- src/main/resources/META-INF/mods.toml | 4 +- .../recipes/alkaline_battery.json | 0 .../blank_circuit_board_ingot_normal.json | 0 .../recipes/blank_circuit_board_plate.json | 0 .../recipes/control_circuit.json | 0 .../recipes/electric_battery_array.json | 0 .../electric_conduit_plastic_ingot.json | 0 .../recipes/electric_conduit_plastic_rod.json | 0 .../electric_conduit_rubber_ingot.json | 0 .../recipes/electric_conduit_rubber_rod.json | 0 .../recipes/electric_crusher.json | 0 .../recipes/electric_drill.json | 0 .../recipes/electric_fabricator.json | 0 .../recipes/electric_furnace.json | 0 .../recipes/electric_oven.json | 0 .../recipes/electric_pump.json | 0 .../recipes/electric_still.json | 0 .../recipes/electric_switch.json | 0 .../recipes/electric_track.json | 0 .../recipes/growth_chamber.json | 0 .../recipes/growth_chamber_controller.json | 0 .../recipes/hydroelectric_generator.json | 0 .../integrated_circuit_copper_normal.json | 0 .../integrated_circuit_copper_tech.json | 0 .../integrated_circuit_gold_normal.json | 0 .../recipes/integrated_circuit_gold_tech.json | 0 .../integrated_circuit_tin_normal.json | 0 .../recipes/integrated_circuit_tin_tech.json | 0 .../recipes/laser_turret_diamond_emerald.json | 0 .../recipes/laser_turret_emerald_diamond.json | 0 .../lead_acid_battery_dust_sulfur.json | 0 .../recipes/lead_acid_battery_sulfur.json | 0 .../recipes/led_bar.json | 0 .../recipes/lithium_battery.json | 0 .../recipes/lithium_ingot_from_nuggets.json | 0 .../recipes/lithium_ingot_from_ore.json | 0 .../recipes/lithium_ingot_from_powder.json | 0 .../recipes/lithium_nuggets.json | 0 .../recipes/nickel_hydride_battery.json | 0 .../recipes/photovoltaic_generator.json | 0 .../recipes/plastic_refinery.json | 0 .../power_supply_unit_iron_normal.json | 0 ...r_supply_unit_plate_steel_apocalyptic.json | 0 .../power_supply_unit_plate_steel_tech.json | 0 .../power_supply_unit_steel_normal.json | 0 .../recipes/silicon_blend.json | 0 .../recipes/silicon_ingot_from_blend.json | 0 .../recipes/solder_blend_tin_lead.json | 0 .../recipes/solder_blend_tin_silver.json | 0 .../recipes/solder_from_blend.json | 0 .../recipes/steam_powered_generator.json | 0 .../blocks/electric_battery_array.json | 0 .../blocks/electric_conduit.json | 0 .../blocks/electric_crusher.json | 0 .../blocks/electric_drill.json | 0 .../blocks/electric_fabricator.json | 0 .../blocks/electric_furnace.json | 0 .../blocks/electric_oven.json | 0 .../blocks/electric_pump.json | 0 .../blocks/electric_still.json | 0 .../blocks/electric_switch.json | 0 .../blocks/electric_track.json | 0 .../blocks/growth_chamber.json | 0 .../blocks/growth_chamber_controller.json | 0 .../blocks/hydroelectric_generator.json | 0 .../blocks/laser_turret.json | 0 .../blocks/laser_turret_evil.json | 0 .../blocks/led_bar.json | 0 .../blocks/photovoltaic_generator.json | 0 .../blocks/plastic_refinery.json | 0 .../blocks/steam_powered_generator.json | 0 .../chests/advantage_parts.json | 0 .../{recipes => recipe}/alkaline_battery.json | 0 .../blank_circuit_board_ingot_normal.json | 0 .../blank_circuit_board_plate.json | 0 .../{recipes => recipe}/control_circuit.json | 0 .../crushing_control_circuit.json | 0 .../crushing_electric_furnace.json | 0 .../crushing_lithium_ingot.json | 0 .../crushing_lithium_ore.json | 0 .../crushing_photovoltaic_generator.json | 0 .../{recipes => recipe}/crushing_psu.json | 0 .../crushing_steam_powered_generator.json | 0 .../crushing_sulfur_ore.json | 0 .../electric_battery_array.json | 0 .../electric_conduit_plastic_ingot.json | 0 .../electric_conduit_plastic_rod.json | 0 .../electric_conduit_rubber_ingot.json | 0 .../electric_conduit_rubber_rod.json | 0 .../{recipes => recipe}/electric_crusher.json | 0 .../{recipes => recipe}/electric_drill.json | 0 .../electric_fabricator.json | 0 .../{recipes => recipe}/electric_furnace.json | 0 .../{recipes => recipe}/electric_oven.json | 0 .../{recipes => recipe}/electric_pump.json | 0 .../{recipes => recipe}/electric_still.json | 0 .../{recipes => recipe}/electric_switch.json | 0 .../{recipes => recipe}/electric_track.json | 0 .../{recipes => recipe}/growth_chamber.json | 0 .../growth_chamber_controller.json | 0 .../hydroelectric_generator.json | 0 .../integrated_circuit_copper_normal.json | 0 .../integrated_circuit_copper_tech.json | 0 .../integrated_circuit_gold_normal.json | 0 .../integrated_circuit_gold_tech.json | 0 .../integrated_circuit_tin_normal.json | 0 .../integrated_circuit_tin_tech.json | 0 .../laser_turret_diamond_emerald.json | 0 .../laser_turret_emerald_diamond.json | 0 .../lead_acid_battery_dust_sulfur.json | 0 .../lead_acid_battery_sulfur.json | 0 .../{recipes => recipe}/led_bar.json | 0 .../{recipes => recipe}/lithium_battery.json | 0 .../lithium_ingot_from_nuggets.json | 0 .../lithium_ingot_from_ore.json | 0 .../lithium_ingot_from_powder.json | 0 .../{recipes => recipe}/lithium_nuggets.json | 0 .../nickel_hydride_battery.json | 0 .../photovoltaic_generator.json | 0 .../{recipes => recipe}/plastic_refinery.json | 0 .../power_supply_unit_iron_normal.json | 0 ...r_supply_unit_plate_steel_apocalyptic.json | 0 .../power_supply_unit_plate_steel_tech.json | 0 .../power_supply_unit_steel_normal.json | 0 .../{recipes => recipe}/silicon_blend.json | 0 .../silicon_ingot_from_blend.json | 0 .../solder_blend_tin_lead.json | 0 .../solder_blend_tin_silver.json | 0 .../solder_from_blend.json | 0 .../steam_powered_generator.json | 0 .../tags/{blocks => block}/ores/lithium.json | 0 .../tags/{blocks => block}/ores/sulfur.json | 0 .../tags/{blocks => block}/ores/sulphur.json | 0 .../tags/{items => item}/circuit_boards.json | 0 .../tags/{items => item}/conduits/steam.json | 0 .../tags/{items => item}/dusts/carbon.json | 0 .../tags/{items => item}/dusts/lithium.json | 0 .../tags/{items => item}/dusts/sulfur.json | 0 .../tags/{items => item}/dusts/sulphur.json | 0 .../tags/{items => item}/glass_panes.json | 0 .../forge/tags/{items => item}/governors.json | 0 .../tags/{items => item}/ingots/lithium.json | 0 .../tags/{items => item}/ingots/plastic.json | 0 .../tags/{items => item}/ingots/silicon.json | 0 .../tags/{items => item}/microchips.json | 0 .../tags/{items => item}/nuggets/lithium.json | 0 .../tags/{items => item}/ores/lithium.json | 0 .../tags/{items => item}/ores/sulfur.json | 0 .../tags/{items => item}/ores/sulphur.json | 0 .../forge/tags/{items => item}/plastic.json | 0 .../{items => item}/power_supply_units.json | 0 .../forge/tags/{items => item}/rubber.json | 0 .../data/forge/tags/{items => item}/sand.json | 0 .../forge/tags/{items => item}/solder.json | 0 .../forge/tags/{items => item}/sulfur.json | 0 .../forge/tags/{items => item}/sulphur.json | 0 .../forge/tags/{items => item}/wires.json | 0 .../{blocks => block}/mineable/pickaxe.json | 0 .../{blocks => block}/needs_stone_tool.json | 0 src/main/resources/pack.mcmeta | 4 +- .../blocks/OreHarvestContractTest.java | 2 +- ...tricOperationalHydroturbineAnchorTest.java | 2 +- .../entities/HydroturbinePersistenceTest.java | 11 +- .../graphics/RendererBufferContractTest.java | 33 ++--- .../ElectricDrillPersistenceTest.java | 14 +- .../ElectricOperationalNativeDefectsTest.java | 8 +- .../ElectricOperationalPumpPickupTest.java | 6 +- .../ElectricOperationalRedstoneCacheTest.java | 8 +- ...ElectricOperationalSoundBroadcastTest.java | 10 +- .../ElectricOperationalStillCapacityTest.java | 6 +- .../GrowthChamberPersistenceTest.java | 8 +- .../machines/Native118ConstructionTest.java | 13 +- .../BaseMetalsRawRecipeContractTest.java | 2 +- .../resources/BlockLootResourceTest.java | 8 +- .../resources/BuildWorkflowContractTest.java | 8 +- .../resources/DatapackLayoutTest.java | 36 +++++ .../resources/RecipeResourceTest.java | 6 +- .../resources/RecipeUnlockContractTest.java | 14 +- .../verification/NativeMachineFixture.java | 85 ++++++++++++ .../NativeMachineFixtureTest.java | 49 +++++++ .../verification/NativeTestBootstrap.java | 4 +- tools/generate-recipe-unlocks.js | 4 +- .../Invoke-ElectricPackagedSmoke.ps1 | 12 +- tools/verification/Verify-ElectricEcj.ps1 | 64 ++++----- tools/verify-native-port.js | 78 +++++------ 229 files changed, 620 insertions(+), 325 deletions(-) create mode 100644 docs/NATIVE1211.md rename gradle/{forge50-mavenizer.gradle => forge52-mavenizer.gradle} (62%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/alkaline_battery.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/blank_circuit_board_ingot_normal.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/blank_circuit_board_plate.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/control_circuit.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_battery_array.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_conduit_plastic_ingot.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_conduit_plastic_rod.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_conduit_rubber_ingot.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_conduit_rubber_rod.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_crusher.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_drill.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_fabricator.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_furnace.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_oven.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_pump.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_still.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_switch.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/electric_track.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/growth_chamber.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/growth_chamber_controller.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/hydroelectric_generator.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/integrated_circuit_copper_normal.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/integrated_circuit_copper_tech.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/integrated_circuit_gold_normal.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/integrated_circuit_gold_tech.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/integrated_circuit_tin_normal.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/integrated_circuit_tin_tech.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/laser_turret_diamond_emerald.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/laser_turret_emerald_diamond.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/lead_acid_battery_dust_sulfur.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/lead_acid_battery_sulfur.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/led_bar.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/lithium_battery.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/lithium_ingot_from_nuggets.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/lithium_ingot_from_ore.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/lithium_ingot_from_powder.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/lithium_nuggets.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/nickel_hydride_battery.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/photovoltaic_generator.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/plastic_refinery.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/power_supply_unit_iron_normal.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/power_supply_unit_plate_steel_apocalyptic.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/power_supply_unit_plate_steel_tech.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/power_supply_unit_steel_normal.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/silicon_blend.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/silicon_ingot_from_blend.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/solder_blend_tin_lead.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/solder_blend_tin_silver.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/solder_from_blend.json (100%) rename src/main/resources/data/baseelectric/{advancements => advancement}/recipes/steam_powered_generator.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/electric_battery_array.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/electric_conduit.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/electric_crusher.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/electric_drill.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/electric_fabricator.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/electric_furnace.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/electric_oven.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/electric_pump.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/electric_still.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/electric_switch.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/electric_track.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/growth_chamber.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/growth_chamber_controller.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/hydroelectric_generator.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/laser_turret.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/laser_turret_evil.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/led_bar.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/photovoltaic_generator.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/plastic_refinery.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/blocks/steam_powered_generator.json (100%) rename src/main/resources/data/baseelectric/{loot_tables => loot_table}/chests/advantage_parts.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/alkaline_battery.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/blank_circuit_board_ingot_normal.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/blank_circuit_board_plate.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/control_circuit.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/crushing_control_circuit.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/crushing_electric_furnace.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/crushing_lithium_ingot.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/crushing_lithium_ore.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/crushing_photovoltaic_generator.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/crushing_psu.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/crushing_steam_powered_generator.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/crushing_sulfur_ore.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_battery_array.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_conduit_plastic_ingot.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_conduit_plastic_rod.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_conduit_rubber_ingot.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_conduit_rubber_rod.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_crusher.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_drill.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_fabricator.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_furnace.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_oven.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_pump.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_still.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_switch.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/electric_track.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/growth_chamber.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/growth_chamber_controller.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/hydroelectric_generator.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/integrated_circuit_copper_normal.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/integrated_circuit_copper_tech.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/integrated_circuit_gold_normal.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/integrated_circuit_gold_tech.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/integrated_circuit_tin_normal.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/integrated_circuit_tin_tech.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/laser_turret_diamond_emerald.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/laser_turret_emerald_diamond.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/lead_acid_battery_dust_sulfur.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/lead_acid_battery_sulfur.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/led_bar.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/lithium_battery.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/lithium_ingot_from_nuggets.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/lithium_ingot_from_ore.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/lithium_ingot_from_powder.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/lithium_nuggets.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/nickel_hydride_battery.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/photovoltaic_generator.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/plastic_refinery.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/power_supply_unit_iron_normal.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/power_supply_unit_plate_steel_apocalyptic.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/power_supply_unit_plate_steel_tech.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/power_supply_unit_steel_normal.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/silicon_blend.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/silicon_ingot_from_blend.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/solder_blend_tin_lead.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/solder_blend_tin_silver.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/solder_from_blend.json (100%) rename src/main/resources/data/baseelectric/{recipes => recipe}/steam_powered_generator.json (100%) rename src/main/resources/data/forge/tags/{blocks => block}/ores/lithium.json (100%) rename src/main/resources/data/forge/tags/{blocks => block}/ores/sulfur.json (100%) rename src/main/resources/data/forge/tags/{blocks => block}/ores/sulphur.json (100%) rename src/main/resources/data/forge/tags/{items => item}/circuit_boards.json (100%) rename src/main/resources/data/forge/tags/{items => item}/conduits/steam.json (100%) rename src/main/resources/data/forge/tags/{items => item}/dusts/carbon.json (100%) rename src/main/resources/data/forge/tags/{items => item}/dusts/lithium.json (100%) rename src/main/resources/data/forge/tags/{items => item}/dusts/sulfur.json (100%) rename src/main/resources/data/forge/tags/{items => item}/dusts/sulphur.json (100%) rename src/main/resources/data/forge/tags/{items => item}/glass_panes.json (100%) rename src/main/resources/data/forge/tags/{items => item}/governors.json (100%) rename src/main/resources/data/forge/tags/{items => item}/ingots/lithium.json (100%) rename src/main/resources/data/forge/tags/{items => item}/ingots/plastic.json (100%) rename src/main/resources/data/forge/tags/{items => item}/ingots/silicon.json (100%) rename src/main/resources/data/forge/tags/{items => item}/microchips.json (100%) rename src/main/resources/data/forge/tags/{items => item}/nuggets/lithium.json (100%) rename src/main/resources/data/forge/tags/{items => item}/ores/lithium.json (100%) rename src/main/resources/data/forge/tags/{items => item}/ores/sulfur.json (100%) rename src/main/resources/data/forge/tags/{items => item}/ores/sulphur.json (100%) rename src/main/resources/data/forge/tags/{items => item}/plastic.json (100%) rename src/main/resources/data/forge/tags/{items => item}/power_supply_units.json (100%) rename src/main/resources/data/forge/tags/{items => item}/rubber.json (100%) rename src/main/resources/data/forge/tags/{items => item}/sand.json (100%) rename src/main/resources/data/forge/tags/{items => item}/solder.json (100%) rename src/main/resources/data/forge/tags/{items => item}/sulfur.json (100%) rename src/main/resources/data/forge/tags/{items => item}/sulphur.json (100%) rename src/main/resources/data/forge/tags/{items => item}/wires.json (100%) rename src/main/resources/data/minecraft/tags/{blocks => block}/mineable/pickaxe.json (100%) rename src/main/resources/data/minecraft/tags/{blocks => block}/needs_stone_tool.json (100%) create mode 100644 src/test/java/zone/moddev/mc/baseelectric/resources/DatapackLayoutTest.java create mode 100644 src/test/java/zone/moddev/mc/baseelectric/verification/NativeMachineFixture.java create mode 100644 src/test/java/zone/moddev/mc/baseelectric/verification/NativeMachineFixtureTest.java diff --git a/.github/verify-published-pins.sh b/.github/verify-published-pins.sh index a949ce1c..191e14a5 100644 --- a/.github/verify-published-pins.sh +++ b/.github/verify-published-pins.sh @@ -3,13 +3,25 @@ set -euo pipefail value() { sed -n "s/^$1=//p" gradle.properties | tr -d '\r'; } +if [[ "$(value poweradvantage_pin_state)" != 'MERGED_SOURCE' ]]; then + echo '::error::This local port has no merged and public basePower release pin.' >&2 + exit 1 +fi +for dependency in poweradvantage basemetals orespawn; do + id="$(value "${dependency}_public_file_id")" + if [[ ! "$id" =~ ^[1-9][0-9]*$ ]]; then + echo "::error::A verified public $dependency file ID is required before hosted builds." >&2 + exit 1 + fi +done + require_merged() { local repo="$1" ref="$2" status [[ "$ref" =~ ^[a-f0-9]{40}$ ]] - status="$(gh api "repos/MinecraftModDevelopmentMods/$repo/compare/$ref...master-1.20.6" --jq '.status')" + status="$(gh api "repos/MinecraftModDevelopmentMods/$repo/compare/$ref...master-1.21.1" --jq '.status')" case "$status" in identical|ahead) ;; - *) echo "::error::$repo $ref is not on upstream master-1.20.6 ($status)."; exit 1 ;; + *) echo "::error::$repo $ref is not on upstream master-1.21.1 ($status)."; exit 1 ;; esac } @@ -36,7 +48,7 @@ require_merged basePower "$power_ref" require_merged BaseMetals "$(value basemetals_source_commit)" require_merged OreSpawn "$orespawn_ref" -inputs="${RUNNER_TEMP:?}/forge50-release-dependencies" +inputs="${RUNNER_TEMP:?}/forge52-release-dependencies" mkdir -p "$inputs" power="$inputs/basePower-$(value poweradvantage_version).jar" metals="$inputs/BaseMetals-$(value basemetals_version).jar" @@ -45,8 +57,8 @@ public_jar basePower 1780140 "$(value poweradvantage_public_file_id)" "$(value p public_jar BaseMetals 240967 "$(value basemetals_public_file_id)" "$(value basemetals_deobf_sha256)" "$metals" public_jar OreSpawn 245586 "$(value orespawn_public_file_id)" "$(value orespawn_deobf_sha256)" "$orespawn" -installer="$inputs/forge-1.20.6-50.2.0-installer.jar" -download 'https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.2.0/forge-1.20.6-50.2.0-installer.jar' \ +installer="$inputs/forge-1.21.1-52.1.0-installer.jar" +download 'https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.0/forge-1.21.1-52.1.0-installer.jar' \ "$(value forge_installer_sha256)" "$installer" { printf 'power_ref=%s\n' "$power_ref" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ed04f26..6d501558 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,16 +1,16 @@ -name: baseElectric 1.20.6 CI +name: baseElectric 1.21.1 CI on: push: - branches: [master-1.20.6, 'feature/**'] + branches: [master-1.21.1, 'feature/**'] pull_request: - branches: [master-1.20.6] + branches: [master-1.21.1] permissions: contents: read concurrency: - group: baseelectric-1.20.6-${{ github.workflow }}-${{ github.ref }} + group: baseelectric-1.21.1-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -62,7 +62,7 @@ jobs: -Porg.gradle.java.installations.auto-download=false" >> "$GITHUB_ENV" - name: Set up Gradle uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6 - - name: Verify the Forge 50 build inputs + - name: Verify the Forge 52 build inputs shell: bash env: ORESPAWN_REF: ${{ steps.public-pins.outputs.orespawn_ref }} @@ -74,33 +74,33 @@ jobs: test "$(git -C "$orespawn" rev-parse HEAD)" = "$ORESPAWN_REF" test "$(git -C "$power" rev-parse HEAD)" = "$POWER_REF" mavenizer="$orespawn/ci-fixtures/tools/minecraft-mavenizer-0.5.21-orespawn-compat.jar" - printf '%s %s\n' '4B14145595E900F178A082F2253A756F63897E6F61C2B8B5E7C819B82CD79E8C' "$mavenizer" | sha256sum -c - + printf '%s %s\n' '019032A4A26ECB473D403EF017054D5892CE59A9904E8831B452287CD756397E' "$mavenizer" | sha256sum -c - echo "MAVENIZER=$mavenizer" >> "$GITHUB_ENV" - name: Build and audit release artifacts shell: bash run: | ./gradlew $MMD_GRADLE_TOOLCHAINS clean check build javadoc verifyReleaseDependencies verifyReleaseArtifacts \ writeReleaseChecksums verifyEclipseProductionClasspath --no-build-cache --no-daemon --stacktrace \ - "-Pforge50MavenizerJar=$MAVENIZER" "-PpowerAdvantageDeobfJar=$POWER_PLAYER" \ + "-Pforge52MavenizerJar=$MAVENIZER" "-PpowerAdvantageDeobfJar=$POWER_PLAYER" \ "-PbaseMetalsDeobfJar=$METALS_PLAYER" "-PoreSpawnDeobfJar=$ORESPAWN_PLAYER" \ "-PforgeInstallerJar=$FORGE_INSTALLER" - name: Upload audited release candidate uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - name: baseElectric-1.20.6-${{ github.sha }} + name: baseElectric-1.21.1-${{ github.sha }} if-no-files-found: error retention-days: 30 path: | - build/libs/baseElectric-2.2.14.120061.jar - build/libs/baseElectric-2.2.14.120061-sources.jar - build/libs/baseElectric-2.2.14.120061-javadoc.jar + build/libs/baseElectric-2.2.15.121011.jar + build/libs/baseElectric-2.2.15.121011-sources.jar + build/libs/baseElectric-2.2.15.121011-javadoc.jar build/release/SHA256SUMS CHANGELOG.txt - name: Upload diagnostics on failure if: failure() uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - name: baseElectric-1.20.6-diagnostics-${{ github.sha }} + name: baseElectric-1.21.1-diagnostics-${{ github.sha }} if-no-files-found: ignore retention-days: 14 path: | diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5ca33bde..653688a3 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -2,9 +2,9 @@ name: CodeQL on: push: - branches: [master-1.20.6, 'feature/**'] + branches: [master-1.21.1, 'feature/**'] pull_request: - branches: [master-1.20.6] + branches: [master-1.21.1] permissions: contents: read @@ -12,7 +12,7 @@ permissions: security-events: write concurrency: - group: baseelectric-1.20.6-${{ github.workflow }}-${{ github.ref }} + group: baseelectric-1.21.1-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -64,7 +64,7 @@ jobs: -Porg.gradle.java.installations.auto-download=false" >> "$GITHUB_ENV" - name: Set up Gradle uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6 - - name: Verify the Forge 50 build inputs + - name: Verify the Forge 52 build inputs shell: bash env: ORESPAWN_REF: ${{ steps.public-pins.outputs.orespawn_ref }} @@ -76,7 +76,7 @@ jobs: test "$(git -C "$orespawn" rev-parse HEAD)" = "$ORESPAWN_REF" test "$(git -C "$power" rev-parse HEAD)" = "$POWER_REF" mavenizer="$orespawn/ci-fixtures/tools/minecraft-mavenizer-0.5.21-orespawn-compat.jar" - printf '%s %s\n' '4B14145595E900F178A082F2253A756F63897E6F61C2B8B5E7C819B82CD79E8C' "$mavenizer" | sha256sum -c - + printf '%s %s\n' '019032A4A26ECB473D403EF017054D5892CE59A9904E8831B452287CD756397E' "$mavenizer" | sha256sum -c - echo "MAVENIZER=$mavenizer" >> "$GITHUB_ENV" - name: Initialize CodeQL uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4 @@ -87,7 +87,7 @@ jobs: shell: bash run: | ./gradlew $MMD_GRADLE_TOOLCHAINS classes verifyReleaseDependencies --rerun-tasks --no-build-cache --no-daemon --stacktrace \ - "-Pforge50MavenizerJar=$MAVENIZER" "-PpowerAdvantageDeobfJar=$POWER_PLAYER" \ + "-Pforge52MavenizerJar=$MAVENIZER" "-PpowerAdvantageDeobfJar=$POWER_PLAYER" \ "-PbaseMetalsDeobfJar=$METALS_PLAYER" "-PoreSpawnDeobfJar=$ORESPAWN_PLAYER" - name: Analyze uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4 diff --git a/.github/workflows/validate-gradle-build.yml b/.github/workflows/validate-gradle-build.yml index 2c47d128..2f2c732b 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.20.6 + - master-1.21.1 - 'feature/**' pull_request: branches: - - master-1.20.6 + - master-1.21.1 permissions: contents: read diff --git a/CHANGELOG.txt b/CHANGELOG.txt index be985b58..a2c8e118 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,9 @@ +baseElectric 2.2.15.121011 (Minecraft 1.21.1 / Forge, local port) + +- Bring baseElectric to Minecraft 1.21.1 with basePower 2.4.14.121011. +- Keep machine settings, saved data, battery charge and legacy world aliases. +- Use the native recipe, data-pack and rendering APIs without changing recipe IDs. + baseElectric 2.2.14.120061 (Minecraft 1.20.6 / Forge) - Bring baseElectric to Minecraft 1.20.6 and Java 21 with basePower 2.4.13.120061. diff --git a/README.md b/README.md index 0719139c..0d9e0498 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ baseElectric continues DrCyano's Electric Advantage. It adds electric machines, generation, storage, automation and defence to basePower. Its equipment appears in the shared basePower creative tab. -This version targets Minecraft **1.20.6**, Forge **50.2.0**, official mappings, -ForgeGradle **7.0.34**, and Java **21**. The version is **2.2.14.120061**. -Install [basePower 2.4.13.120061](https://www.curseforge.com/minecraft/mc-mods/basepower/files/9545972) -for Minecraft 1.20.6. CurseForge also installs -[Base Metals](https://www.curseforge.com/minecraft/mc-mods/base-metals); this -build was tested with 3.1.2.120061 and OreSpawn 4.1.0.120061. -See the [1.20.6 notes](docs/NATIVE1206.md) for save compatibility and test coverage. +This local port targets Minecraft **1.21.1**, Forge **52.1.0**, official mappings +with MCP **20240808.132146**, ForgeGradle **7.0.34**, Gradle **9.6.1**, and Java +**21**. The version is **2.2.15.121011**. It requires basePower **2.4.14.121011**. +The coordinated dependencies are Base Metals **3.1.2.121011** and OreSpawn +**4.1.0.121011**. The migration-hook Base Metals jar is approved for local use +only. This port is not published or ready for release promotion. +See the [1.21.1 notes](docs/NATIVE1211.md) for compatibility and verification status. Back up your world and try the upgrade on a copy. Replace Electric Advantage and Power Advantage with baseElectric and basePower; do not install both sets. @@ -25,23 +25,25 @@ if Gradle cannot discover all three. The independent Forge/resource checks do not require sibling jars: ```text -./gradlew --offline nativeResourceChecks verifyRecipeTagGuards processResources +./gradlew --offline nativeResourceChecks compileNativeApiDiagnostics verifyRecipeTagGuards processResources node tools/verify-native-port.js node tools/generate-recipe-unlocks.js --check ``` -For the full local build, supply the files matching the pins in `gradle.properties`: +For a full local build, supply files matching the exact coordinated source +and jar pins recorded in `gradle.properties`. The current basePower pin is an +approved local commit, not merged or publicly released: ```text --PpowerAdvantageRuntimeJar=/path/to/basePower-2.4.13.120061.jar --PbaseMetalsRuntimeJar=/path/to/BaseMetals-3.1.2.120061.jar --PforgeInstallerJar=/path/to/forge-1.20.6-50.2.0-installer.jar +-PpowerAdvantageRuntimeJar=/path/to/basePower-2.4.14.121011.jar +-PbaseMetalsRuntimeJar=/path/to/BaseMetals-3.1.2.121011.jar +-PforgeInstallerJar=/path/to/forge-1.21.1-52.1.0-installer.jar ``` -Forge 50 uses the ordinary native jar for both play and development. The former +Forge 52 uses the ordinary native jar for both play and development. The former `*DeobfJar` path flags remain aliases for the same bytes. OreSpawn and the -Mavenizer fixture default to the sibling `MinecraftMineralogy/OS1206/OreSpawn` -checkout. Use `-PoreSpawnRuntimeJar` and `-Pforge50MavenizerJar` to override paths. +Mavenizer fixture default to the sibling `MinecraftMineralogy/OS1211/OreSpawn` +checkout. Use `-PoreSpawnRuntimeJar` and `-Pforge52MavenizerJar` to override paths. For the prepared cache, use `--offline` with `ORESPAWN_MAVENIZER_OFFLINE=true`. ```text @@ -49,8 +51,9 @@ For the prepared cache, use `--offline` with `ORESPAWN_MAVENIZER_OFFLINE=true`. ``` Use `gradlew.bat` on Windows. Output jars go to `build/libs`. Dependencies -remain separate mods. The 1.20.6 CI jobs check against the pinned Forge 50 -runtime and public dependencies. +remain separate mods. The 1.21.1 CI and CodeQL jobs require merged source pins +and checksum-matching public dependencies before checkout or compilation. +Local jars do not satisfy that gate. ## Verification diff --git a/build.gradle b/build.gradle index 0257a83f..b4b227dc 100644 --- a/build.gradle +++ b/build.gradle @@ -61,7 +61,7 @@ def pinnedFile = { String property, String expected, String fallback = null -> input } -apply from: 'gradle/forge50-mavenizer.gradle' +apply from: 'gradle/forge52-mavenizer.gradle' java { toolchain { @@ -89,8 +89,8 @@ tasks.named('test', Test) { } afterSuite { descriptor, result -> if (!descriptor.parent && filter.includePatterns.empty && filter.commandLineIncludePatterns.empty - && (result.testCount != 102 || result.skippedTestCount != 0)) { - throw new GradleException("Expected 102 tests with no skips, got ${result.testCount} tests and ${result.skippedTestCount} skips") + && (result.testCount != 106 || result.skippedTestCount != 0)) { + throw new GradleException("Expected 106 tests with no skips, got ${result.testCount} tests and ${result.skippedTestCount} skips") } } } @@ -180,7 +180,7 @@ sourceSets.main.resources { 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.20.6 launches.' + description = 'Merges classes and processed resources for Forge 1.21.1 launches.' dependsOn tasks.named('classes') from sourceSets.main.output into forgeRunModClassesDirectory @@ -191,7 +191,7 @@ def encodeElectricGameTestStructure = tasks.register('encodeElectricGameTestStru dependsOn tasks.named('gameTestValidationClasses') classpath = sourceSets.gameTestValidation.runtimeClasspath mainClass = 'zone.moddev.mc.baseelectric.gametest.ElectricGameTests' - def structure = gameTestStructures.map { it.file('data/baseelectric/structures/empty.nbt') } + def structure = gameTestStructures.map { it.file('data/baseelectric/structure/empty.nbt') } inputs.file(emptyGameTestStructure) outputs.file(structure) args emptyGameTestStructure.asFile.absolutePath, structure.get().asFile.absolutePath @@ -260,11 +260,11 @@ def requireCommittedPins = { String prefix -> } def requirePowerPin = { requireCommittedPins('poweradvantage_') - if (project.poweradvantage_pin_state != 'MERGED_SOURCE' + if (!(project.poweradvantage_pin_state in ['LOCAL_SOURCE', 'MERGED_SOURCE']) || !(project.poweradvantage_source_ref ==~ /[a-f0-9]{40}/) || ![project.poweradvantage_deobf_sha256, project.poweradvantage_runtime_sha256] .every { it ==~ /[A-F0-9]{64}/ }) { - throw new GradleException('The owner-approved basePower 1.20.6 source and artifact pins are required.') + throw new GradleException('The owner-approved basePower 1.21.1 source and artifact pins are required.') } } // Resolve and check only the dependencies required by the selected tasks. @@ -278,7 +278,7 @@ def baseMetalsDeobfJar = providers.provider { pinnedFile('baseMetalsDeobfJar', project.basemetals_deobf_sha256, providers.gradleProperty('baseMetalsRuntimeJar').orNull) } -def oreSpawnProject = '../../../../MinecraftMineralogy/OS1206/OreSpawn' +def oreSpawnProject = '../../../../MinecraftMineralogy/OS1211/OreSpawn' def oreSpawnDeobfJar = providers.provider { requireCommittedPins('orespawn_') pinnedFile('oreSpawnDeobfJar', project.orespawn_deobf_sha256, @@ -286,14 +286,6 @@ def oreSpawnDeobfJar = providers.provider { "${oreSpawnProject}/build/libs/OreSpawn-${project.orespawn_version}.jar")) } -// An older 1.20.6 API jar may be used for javac only; it cannot qualify a runtime. -def baseMetalsCompileApiJar = providers.gradleProperty('baseMetalsCompileApiJar') -def baseMetalsCompileJar = providers.provider { - if (!baseMetalsCompileApiJar.isPresent()) return baseMetalsDeobfJar.get() - pinnedFile('baseMetalsCompileApiJar', - '08AC265C7284D18962A3DE91B7C267187AEF76ACF6AFE7BBA0729F5CED60A437') -} - def nativeForge = minecraft.dependency( "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}") dependencies { @@ -301,7 +293,7 @@ dependencies { // basePower is required at runtime but remains a separate mod jar. compileOnly files(powerAdvantageDeobfJar) runtimeOnly files(powerAdvantageDeobfJar) - compileOnly files(baseMetalsCompileJar) + compileOnly files(baseMetalsDeobfJar) runtimeOnly files(baseMetalsDeobfJar) // Required transitively by the coordinated PowerAdvantage/Base Metals development runtime. compileOnly files(oreSpawnDeobfJar) @@ -321,22 +313,50 @@ dependencies { add('nativeResourceCheckInputs', 'junit:junit:4.13.2') } def nativeResourceCheckClasses = layout.buildDirectory.dir('classes/native-resource-checks') +tasks.register('compileNativeApiDiagnostics', JavaCompile) { + group = 'verification' + description = 'Compiles sibling-independent native APIs; never builds a candidate jar.' + source fileTree('src/main/java') { + include '**/util/crafting/*.java', '**/blocks/Ore.java', '**/graphics/BufferedQuads.java' + } + classpath = nativeResourceCheckClasspath.get() + destinationDirectory = layout.buildDirectory.dir('classes/native-api-diagnostics') +} + def compileNativeResourceChecks = tasks.register('compileNativeResourceChecks', JavaCompile) { source fileTree('src/test/java') { include '**/BlockLootResourceTest.java', '**/RecipeResourceTest.java', '**/RecipeUnlockContractTest.java', - '**/RecipeRegistrationThreadTest.java', '**/NativeTestBootstrap.java', '**/LegacyBatteryDataTest.java' + '**/RecipeRegistrationThreadTest.java', '**/NativeTestBootstrap.java', '**/LegacyBatteryDataTest.java', + '**/BuildWorkflowContractTest.java', '**/ShaderResourceContractTest.java', '**/DatapackLayoutTest.java' } classpath = nativeResourceCheckClasspath.get() destinationDirectory = nativeResourceCheckClasses } tasks.register('nativeResourceChecks', Test) { group = 'verification' - description = 'Checks Electric resources against native Forge 50 without sibling mod jars.' + description = 'Checks Electric resources against native Forge 52 without sibling mod jars.' dependsOn compileNativeResourceChecks useJUnit() testClassesDirs = files(nativeResourceCheckClasses) classpath = testClassesDirs + nativeResourceCheckClasspath.get() + afterSuite { descriptor, result -> + if (!descriptor.parent && (result.testCount != 17 || result.skippedTestCount != 0)) { + throw new GradleException("Expected 17 native resource tests without skips, got ${result.testCount}/${result.skippedTestCount}") + } + } +} + +def clientValidationSources = fileTree('src/test/java') { + include '**/graphics/*.java', '**/gui/*.java', '**/resources/ShaderResourceContractTest.java' +} +tasks.register('compileClientValidationJava', JavaCompile) { + group = 'verification' + description = 'Compiles the retained client renderer, GUI and shader contracts separately from the production output.' + dependsOn tasks.named('testClasses') + source clientValidationSources + classpath = sourceSets.test.compileClasspath + sourceSets.test.output + destinationDirectory = layout.buildDirectory.dir('classes/client-validation') } tasks.named('processResources', ProcessResources) { @@ -378,9 +398,6 @@ def powerPinManifest = [ tasks.named('jar', Jar) { doFirst { requirePowerPin() - if (baseMetalsCompileApiJar.isPresent()) { - throw new GradleException('The compile-only Base Metals API jar cannot package a candidate.') - } } exclude 'fernflower_abstract_parameter_names.txt' manifest { @@ -402,13 +419,13 @@ def releaseJar = tasks.named('jar', Jar) tasks.register('releaseJar') { group = 'build' - description = 'Builds the native Forge 50 player jar.' + description = 'Builds the native Forge 52 player jar.' dependsOn releaseJar } tasks.register('deobfJar') { group = 'build' - description = 'Builds the same native Forge 50 jar used for development and play.' + description = 'Builds the same native Forge 52 jar used for development and play.' dependsOn tasks.named('jar') } @@ -456,26 +473,23 @@ tasks.register('verifyReleaseConfiguration') { description = 'Validates release identity, target metadata, and dependency policy.' doLast { requirePowerPin() - if (baseMetalsCompileApiJar.isPresent()) { - throw new GradleException('The compile-only Base Metals API jar cannot qualify a build.') - } requireCommittedPins('basemetals_') requireCommittedPins('orespawn_') def pack = new JsonSlurper().parse(file('src/main/resources/pack.mcmeta')).pack - if (pack.pack_format != 32 || pack.supported_formats != [min_inclusive: 32, max_inclusive: 41]) { - throw new GradleException('Minecraft 1.20.6 requires resource pack format 32') + 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.2.14.120061') { + if (project.mod_version != '2.2.15.121011') { throw new GradleException("Unexpected baseElectric release version: ${project.mod_version}") } - if (project.minecraft_version != '1.20.6' - || project.minecraft_version_range != '[1.20.6]' - || project.forge_version != '50.2.0' - || project.forge_version_range != '[50.2.0,51)' - || project.loader_version_range != '[50,)' + if (project.minecraft_version != '1.21.1' + || project.minecraft_version_range != '[1.21.1]' + || project.forge_version != '52.1.0' + || project.forge_version_range != '[52.1.0,53)' + || project.loader_version_range != '[52,)' || project.mapping_channel != 'official' - || project.mapping_version != '1.20.6' - || project.mcp_version != '20240429.135109') { + || 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' @@ -495,15 +509,15 @@ tasks.register('verifyReleaseConfiguration') { } if (project.cf_requirements != 'basepower,base-metals' || project.cf_optionals != '' - || project.cf_versions != '1.20.6') { + || project.cf_versions != '1.21.1') { throw new GradleException('Unexpected CurseForge dependency or game-version metadata') } - if (project.poweradvantage_version != '2.4.13.120061' + if (project.poweradvantage_version != '2.4.14.121011' || project.poweradvantage_source_repository != 'MinecraftModDevelopmentMods/basePower') { throw new GradleException('Unexpected basePower compile dependency identity') } - if (!(project.basemetals_version ==~ /3\.\d+\.\d+\.120061/) - || project.orespawn_version != '4.1.0.120061' + if (!(project.basemetals_version ==~ /3\.\d+\.\d+\.121011/) + || project.orespawn_version != '4.1.0.121011' || !(project.basemetals_source_commit ==~ /[a-f0-9]{40}/) || !(project.basemetals_deobf_sha256 ==~ /[A-F0-9]{64}/) || !(project.basemetals_runtime_sha256 ==~ /[A-F0-9]{64}/) @@ -511,18 +525,18 @@ tasks.register('verifyReleaseConfiguration') { || project.orespawn_deobf_sha256 != project.orespawn_runtime_sha256 || project.basemetals_deobf_sha256 != project.basemetals_runtime_sha256 || project.poweradvantage_deobf_sha256 != project.poweradvantage_runtime_sha256 - || project.forge_installer_sha256 != '8789098B077F5486449311A11DC05E977FEB9430913CB15F30B21A2D8AA213EA') { + || project.forge_installer_sha256 != 'F1B620F2879AD6A5BBE15DABA4D8F81EAB9F5E08004967604960B98996BDEBC4') { throw new GradleException('Unexpected native dependency pins') } String mainSource = file( 'src/main/java/zone/moddev/mc/baseelectric/ElectricAdvantage.java').getText('UTF-8') if (!mainSource.contains('MODID = "baseelectric"') - || !mainSource.contains('VERSION = "2.2.14.120061"')) { + || !mainSource.contains('VERSION = "2.2.15.121011"')) { throw new GradleException('baseElectric source identity changed') } String metadata = file('src/main/resources/META-INF/mods.toml').getText('UTF-8').replace('\r\n', '\n') ['modId="baseelectric"', 'displayName="baseElectric"', 'modId="basepower"', 'modId="basemetals"', - 'versionRange="[2.4.13.120061,3.0.0)"', 'versionRange="[3.1.2.120061,4.0.0)"'].each { marker -> + 'versionRange="[2.4.14.121011,3.0.0)"', 'versionRange="[3.1.2.121011,4.0.0)"'].each { marker -> if (!metadata.contains(marker)) { throw new GradleException("Source mods.toml is missing ${marker}") } @@ -553,7 +567,7 @@ def auditModInput = { File jarFile, String modId, String version, List r tasks.register('verifyLocalNativeInputs') { group = 'verification' - description = 'Verifies explicit Base Metals and OreSpawn 1.20.6 development and player JARs.' + description = 'Verifies explicit Base Metals and OreSpawn 1.21.1 development and player JARs.' dependsOn tasks.named('verifyReleaseConfiguration') doLast { auditModInput(baseMetalsDeobfJar.get(), 'basemetals', project.basemetals_version, @@ -693,19 +707,19 @@ tasks.register('verifyReleaseArtifacts') { 'zone/moddev/mc/baseelectric/init/Villages.class', 'zone/moddev/mc/baseelectric/recipe/RecipeConditions$ModeCondition.class', 'assets/baseelectric/lang/en_us.json', - 'data/baseelectric/loot_tables/blocks/electric_drill.json', - 'data/baseelectric/loot_tables/blocks/electric_conduit.json', + 'data/baseelectric/loot_table/blocks/electric_drill.json', + 'data/baseelectric/loot_table/blocks/electric_conduit.json', 'data/baseelectric/damage_type/laser.json', 'data/baseelectric/damage_type/propeller.json', - 'data/baseelectric/recipes/electric_conduit_plastic_ingot.json', - 'data/baseelectric/advancements/recipes/integrated_circuit_copper_normal.json', - 'data/forge/tags/items/ores/lithium.json'].each { required -> + 'data/baseelectric/recipe/electric_conduit_plastic_ingot.json', + 'data/baseelectric/advancement/recipes/integrated_circuit_copper_normal.json', + 'data/forge/tags/item/ores/lithium.json'].each { required -> if (!names.contains(required)) { throw new GradleException("Release jar is missing ${required}") } } ['agent-notes/', '.codex/', 'src/test/', 'zone/moddev/mc/baseelectric/gametest/', - 'data/baseelectric/structures/empty.nbt', 'fernflower_abstract_parameter_names.txt', + 'data/baseelectric/structure/empty.nbt', 'fernflower_abstract_parameter_names.txt', 'cyano/poweradvantage/', 'zone/moddev/mc/basepower/', 'zone/moddev/mc/poweradvantage/', 'zone/moddev/mc/electricadvantage/', 'assets/electricadvantage/', 'data/electricadvantage/', @@ -882,7 +896,7 @@ tasks.register('validateMavenReleaseCredentials') { group = 'publishing' description = 'Rejects remote publication from this local port.' doLast { - throw new GradleException('Remote Maven publication is disabled on the local 1.20.6 port.') + throw new GradleException('Remote Maven publication is disabled on the local 1.21.1 port.') } } @@ -1285,7 +1299,7 @@ tasks.register('verifyEclipseProductionClasspath') { || !programArguments.startsWith('--main net.minecraftforge.bootstrap.ForgeBootstrap ') || !programArguments.contains(" -- --launchTarget ${target} ") || !vmArguments.contains('--add-opens java.base/java.lang.invoke=ALL-UNNAMED')) { - throw new GradleException("${name} does not define the Forge 50 bootstrap and native launch target") + throw new GradleException("${name} does not define the Forge 52 bootstrap and native launch target") } ['--cache', '--metadata', '--to-srg', '--to-obf'].each { option -> def argument = programArguments =~ /(?:^|\s)${option}\s+(?:"([^"]+)"|([^"\s]+))(?=\s+--|$)/ @@ -1454,7 +1468,7 @@ tasks.register('verifyRepositoryHygiene') { tasks.register('verifyRecipeTagGuards') { group = 'verification' description = 'Rejects recipes that can collapse when a Forge material tag is empty.' - File recipeRoot = file("src/main/resources/data/${project.mod_id}/recipes") + File recipeRoot = file("src/main/resources/data/${project.mod_id}/recipe") inputs.dir(recipeRoot) doLast { Closure collectTags @@ -1503,6 +1517,7 @@ tasks.register('verifyRecipeTagGuards') { } tasks.named('check') { + dependsOn tasks.named('compileGameTestValidationJava'), tasks.named('compileClientValidationJava') dependsOn tasks.named('verifyJavaSourceLayout') dependsOn tasks.named('verifyReleaseConfiguration') dependsOn tasks.named('verifyModelAssets') diff --git a/docs/NATIVE1211.md b/docs/NATIVE1211.md new file mode 100644 index 00000000..50f405b7 --- /dev/null +++ b/docs/NATIVE1211.md @@ -0,0 +1,46 @@ +# Electric on Minecraft 1.21.1 + +baseElectric 2.2.15.121011 targets Forge 52.1.0 and Java 21 with basePower +2.4.14.121011. It remains a local port until the coordinated dependency pins +and qualification gates are complete. Nothing has been published. + +## Saves and Machines + +Back up your save and try upgrades on a disposable copy. Keep the original +world for the old mods. Block, item, entity and configuration IDs are unchanged. +Legacy Electric Advantage aliases and saved data keys remain in place. + +Battery charge stays in native item components. An explicit zero remains empty; +missing charge remains full. Drill direction, movement state, inventories, +targets and progress retain their existing storage. Machine costs, capacities, +generation rates and redstone timing have not been rebalanced. + +The Forge 52 port uses native recipe inputs, resource-location factories and +vertex consumers. Electric fluid gauges still use basePower's renderer and its +normalized sprite UVs. The hidden pump helper still has no loot table. + +## Data Packs + +Registry directories are now `recipe`, `advancement`, `loot_table`, `tags/item` +and `tags/block`. Paths inside each registry, including `recipes/` within the +advancement registry and `blocks/` within loot tables, have not changed. +All 58 recipe files and 50 unlock advancements retain their released contents. +Old plural registry folders are not a supported alternative. + +## Verification Boundaries + +The static audit compares against the released 1.20.6 commit and retains all +102 accepted tests and their assertions. New contracts check singular registry +paths and real block-entity fixture types, including cleanup after failures. + +`nativeResourceChecks` and `compileNativeApiDiagnostics` are independent of +basePower. Full native and ECJ runs pass 106 tests without skips. The four +GameTests, archive and dependency audits, Javadoc and Eclipse checks pass +against the coordinated local basePower commit. GameTest and client-only +contract sources compile separately from the player jar. + +These checks do not replace whole-world upgrade, family gameplay, restart or +visual acceptance. Rebuilt dependencies require fresh qualification. + +Hosted CI and publication remain gated on merged and public dependency pins. +Local compilation is not evidence of runtime, migration or visual acceptance. diff --git a/gradle.properties b/gradle.properties index 810d6962..ba2e35b5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,15 +5,15 @@ org.gradle.caching=true org.gradle.parallel=false net.minecraftforge.gradle.merge-source-sets=false -minecraft_version=1.20.6 -minecraft_version_range=[1.20.6] -forge_version=50.2.0 -forge_installer_sha256=8789098B077F5486449311A11DC05E977FEB9430913CB15F30B21A2D8AA213EA -forge_version_range=[50.2.0,51) -loader_version_range=[50,) +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.20.6 -mcp_version=20240429.135109 +mapping_version=1.21.1 +mcp_version=20240808.132146 loader_name=forge loader_code=1 @@ -26,32 +26,33 @@ curseforge_project_id=1783006 mod_id=baseelectric mod_name=baseElectric mod_license=GPL-3.0-only -mod_version=2.2.14.120061 +mod_version=2.2.15.121011 mod_group=zone.moddev.mc.baseelectric mod_authors=DrCyano mod_description=Electric-powered machines and infrastructure for basePower. cf_requirements=basepower,base-metals cf_optionals= -cf_versions=1.20.6 +cf_versions=1.21.1 -poweradvantage_version=2.4.13.120061 -poweradvantage_pin_state=MERGED_SOURCE +poweradvantage_version=2.4.14.121011 +poweradvantage_pin_state=LOCAL_SOURCE poweradvantage_source_repository=MinecraftModDevelopmentMods/basePower -# The Forge 50 native jar is used unchanged on both classpaths. -poweradvantage_source_ref=d1cdc73d19551786ab4524879cb9abca8c881251 -poweradvantage_public_file_id=9545972 -poweradvantage_deobf_sha256=E53BDD64776741B2EBAE36A646049DC98487E1BAD1CF69F1E3FCD95188F907F1 -poweradvantage_runtime_sha256=E53BDD64776741B2EBAE36A646049DC98487E1BAD1CF69F1E3FCD95188F907F1 +# Owner-approved local candidate, not merged or publicly released. +poweradvantage_source_ref=72fd326b9a9c28e1b2447dfc5ebed99677f09872 +poweradvantage_public_file_id= +poweradvantage_deobf_sha256=76CF79E04F36947D25535B982099B31AA88907448959F063BEA617644B7179F7 +poweradvantage_runtime_sha256=76CF79E04F36947D25535B982099B31AA88907448959F063BEA617644B7179F7 -basemetals_version=3.1.2.120061 -basemetals_source_commit=e9d92f157ee5056a31e479d5b8f9dca8f0648c12 -basemetals_public_file_id=9543397 -basemetals_deobf_sha256=6186AC62C7E2E333373EA0D8AD8DE53FF859C520EBF568DFB47517C4F77C8C5D -basemetals_runtime_sha256=6186AC62C7E2E333373EA0D8AD8DE53FF859C520EBF568DFB47517C4F77C8C5D +basemetals_version=3.1.2.121011 +basemetals_source_commit=b42b92b0e6f60ac5baf07a6b74042b2fa8427904 +# Approved local migration-hook artifact, not a public release pin. +basemetals_public_file_id= +basemetals_deobf_sha256=7C0B961A8D4991C9B69379518AAD700A71C1E4B2076CF5DEF292C58029408A07 +basemetals_runtime_sha256=7C0B961A8D4991C9B69379518AAD700A71C1E4B2076CF5DEF292C58029408A07 -orespawn_version=4.1.0.120061 -orespawn_source_commit=4085315345ff043448b316d75e03f4b8da45402d -orespawn_public_file_id=9183384 -orespawn_deobf_sha256=FAA7107B9FB84E2C62ED847CAFD880AA3C4238A37799BAD955EA9602A944AA26 -orespawn_runtime_sha256=FAA7107B9FB84E2C62ED847CAFD880AA3C4238A37799BAD955EA9602A944AA26 +orespawn_version=4.1.0.121011 +orespawn_source_commit=62c08169c71f4d4fd8f107289e63fd2a4c7c655c +orespawn_public_file_id=9189594 +orespawn_deobf_sha256=EB369B7D7CE6D6C453658347A420C2F0783B7F4D1AC7383C87176AC05192B5A0 +orespawn_runtime_sha256=EB369B7D7CE6D6C453658347A420C2F0783B7F4D1AC7383C87176AC05192B5A0 diff --git a/gradle/forge50-mavenizer.gradle b/gradle/forge52-mavenizer.gradle similarity index 62% rename from gradle/forge50-mavenizer.gradle rename to gradle/forge52-mavenizer.gradle index 4b8176bc..aacd1ab2 100644 --- a/gradle/forge50-mavenizer.gradle +++ b/gradle/forge52-mavenizer.gradle @@ -1,15 +1,15 @@ import java.security.MessageDigest import org.gradle.jvm.toolchain.JvmVendorSpec -def fixture = file(providers.gradleProperty('forge50MavenizerJar').getOrElse( - '../../../../MinecraftMineralogy/OS1206/OreSpawn/ci-fixtures/tools/minecraft-mavenizer-0.5.21-orespawn-compat.jar')) -def expected = '4B14145595E900F178A082F2253A756F63897E6F61C2B8B5E7C819B82CD79E8C' +def fixture = file(providers.gradleProperty('forge52MavenizerJar').getOrElse( + '../../../../MinecraftMineralogy/OS1211/OreSpawn/ci-fixtures/tools/minecraft-mavenizer-0.5.21-orespawn-compat.jar')) +def expected = '019032A4A26ECB473D403EF017054D5892CE59A9904E8831B452287CD756397E' if (!fixture.isFile()) { - throw new GradleException("Missing Forge 50 Mavenizer fixture: ${fixture}. Set -Pforge50MavenizerJar=.") + throw new GradleException("Missing Forge 52 Mavenizer fixture: ${fixture}. Set -Pforge52MavenizerJar=.") } def actual = MessageDigest.getInstance('SHA-256').digest(fixture.bytes).encodeHex().toString().toUpperCase(Locale.ROOT) if (actual != expected) { - throw new GradleException("Forge 50 Mavenizer fixture SHA-256 mismatch: expected ${expected}, got ${actual}") + throw new GradleException("Forge 52 Mavenizer fixture SHA-256 mismatch: expected ${expected}, got ${actual}") } fgtools.configure('mavenizer') { diff --git a/src/main/java/zone/moddev/mc/baseelectric/ElectricAdvantage.java b/src/main/java/zone/moddev/mc/baseelectric/ElectricAdvantage.java index dfd89af1..f5f05220 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/ElectricAdvantage.java +++ b/src/main/java/zone/moddev/mc/baseelectric/ElectricAdvantage.java @@ -25,13 +25,13 @@ import zone.moddev.mc.baseelectric.recipe.RecipeConditions; import zone.moddev.mc.baseelectric.migration.ElectricLegacyMigrations; -/** Forge 1.20.6 entry point for baseElectric. */ +/** Forge 1.21.1 entry point for baseElectric. */ @Mod(ElectricAdvantage.MODID) public final class ElectricAdvantage { public static final String MODID = "baseelectric"; public static final String LEGACY_MODID = "electricadvantage"; public static final String NAME = "baseElectric"; - public static final String VERSION = "2.2.14.120061"; + public static final String VERSION = "2.2.15.121011"; public static final Logger LOGGER = LogManager.getLogger(MODID); public static ElectricAdvantage INSTANCE; diff --git a/src/main/java/zone/moddev/mc/baseelectric/blocks/Ore.java b/src/main/java/zone/moddev/mc/baseelectric/blocks/Ore.java index 4b24d051..76a48574 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/blocks/Ore.java +++ b/src/main/java/zone/moddev/mc/baseelectric/blocks/Ore.java @@ -1,6 +1,7 @@ package zone.moddev.mc.baseelectric.blocks; import net.minecraft.util.RandomSource; +import net.minecraft.core.registries.Registries; import java.util.Collections; import java.util.List; import java.util.function.Supplier; @@ -52,7 +53,8 @@ public List getDrops(BlockState state, LootParams.Builder context) { ItemStack tool = context.getOptionalParameter(LootContextParams.TOOL); ItemStack dropItem = drop.get(); if (dropItem.isEmpty() || (tool != null - && EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0)) { + && EnchantmentHelper.getItemEnchantmentLevel(context.getLevel().registryAccess() + .lookupOrThrow(Registries.ENCHANTMENT).getOrThrow(Enchantments.SILK_TOUCH), tool) > 0)) { return Collections.singletonList(new ItemStack(this)); } RandomSource random = context.getLevel().random; diff --git a/src/main/java/zone/moddev/mc/baseelectric/compat/BaseMetalsCompat.java b/src/main/java/zone/moddev/mc/baseelectric/compat/BaseMetalsCompat.java index 1a0fe8e7..438f5f43 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/compat/BaseMetalsCompat.java +++ b/src/main/java/zone/moddev/mc/baseelectric/compat/BaseMetalsCompat.java @@ -2,7 +2,7 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.SimpleContainer; +import net.minecraft.world.item.crafting.SingleRecipeInput; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.RecipeHolder; @@ -33,8 +33,7 @@ public static boolean hasCrusherRecipe(Level world, ItemStack input) { public static ItemStack getCrusherRecipeOutput(Level world, ItemStack input) { if (world == null || input == null || input.isEmpty()) return null; if (isLoaded()) { - SimpleContainer inventory = new SimpleContainer(1); - inventory.setItem(0, input.copy()); + SingleRecipeInput inventory = new SingleRecipeInput(input.copy()); for (RecipeHolder holder : world.getRecipeManager().getRecipes()) { if (holder.value() instanceof CrushingRecipe candidate && candidate.matches(inventory, world)) { return candidate.getResultItem(world.registryAccess()).copy(); @@ -76,7 +75,7 @@ private static ItemStack getVanillaCrusherOutput(ItemStack input) { } private static ItemStack stack(String id, int count) { - Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(id)); + Item item = ForgeRegistries.ITEMS.getValue(ResourceLocation.parse(id)); return item == null ? null : new ItemStack(item, count); } } diff --git a/src/main/java/zone/moddev/mc/baseelectric/graphics/BufferedQuads.java b/src/main/java/zone/moddev/mc/baseelectric/graphics/BufferedQuads.java index 16b689b2..acff1ea3 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/graphics/BufferedQuads.java +++ b/src/main/java/zone/moddev/mc/baseelectric/graphics/BufferedQuads.java @@ -50,10 +50,10 @@ void endVertex() { nz /= length; } for (float[] vertex : vertices) { - buffer.vertex(transform.pose(), vertex[0], vertex[1], vertex[2]) - .color(255, 255, 255, 255).uv(vertex[3], vertex[4]) - .overlayCoords(overlay).uv2(light) - .normal(transform, nx, ny, nz).endVertex(); + buffer.addVertex(transform.pose(), vertex[0], vertex[1], vertex[2]) + .setColor(255, 255, 255, 255).setUv(vertex[3], vertex[4]) + .setOverlay(overlay).setLight(light) + .setNormal(transform, nx, ny, nz); } count = 0; } diff --git a/src/main/java/zone/moddev/mc/baseelectric/graphics/ElectricRenderTypes.java b/src/main/java/zone/moddev/mc/baseelectric/graphics/ElectricRenderTypes.java index dd85dd31..2b2e9280 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/graphics/ElectricRenderTypes.java +++ b/src/main/java/zone/moddev/mc/baseelectric/graphics/ElectricRenderTypes.java @@ -9,8 +9,7 @@ /** Scoped render state replaces the old global lighting/blending mutations. */ final class ElectricRenderTypes extends RenderStateShard { - static final ResourceLocation UNSHADED = new ResourceLocation( - zone.moddev.mc.baseelectric.ElectricAdvantage.MODID, "unshaded"); + static final ResourceLocation UNSHADED = ResourceLocation.fromNamespaceAndPath(zone.moddev.mc.baseelectric.ElectricAdvantage.MODID, "unshaded"); private static ShaderInstance unshadedShader; private ElectricRenderTypes() { super("baseelectric", () -> {}, () -> {}); diff --git a/src/main/java/zone/moddev/mc/baseelectric/graphics/HydroturbineRenderer.java b/src/main/java/zone/moddev/mc/baseelectric/graphics/HydroturbineRenderer.java index 88a43805..efec804f 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/graphics/HydroturbineRenderer.java +++ b/src/main/java/zone/moddev/mc/baseelectric/graphics/HydroturbineRenderer.java @@ -16,7 +16,7 @@ @OnlyIn(Dist.CLIENT) public class HydroturbineRenderer extends EntityRenderer{ - private static final ResourceLocation texture = new ResourceLocation(ElectricAdvantage.MODID+":textures/entity/hydroturbine.png"); + private static final ResourceLocation texture = ResourceLocation.parse(ElectricAdvantage.MODID+":textures/entity/hydroturbine.png"); private static final float DEGREES_TO_RADIANS = (float)(Math.PI / 180); diff --git a/src/main/java/zone/moddev/mc/baseelectric/graphics/LaserDrillRenderer.java b/src/main/java/zone/moddev/mc/baseelectric/graphics/LaserDrillRenderer.java index e154ccf2..84450ce1 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/graphics/LaserDrillRenderer.java +++ b/src/main/java/zone/moddev/mc/baseelectric/graphics/LaserDrillRenderer.java @@ -17,7 +17,7 @@ public class LaserDrillRenderer implements BlockEntityRenderer{ - private final ResourceLocation texture = new ResourceLocation(ElectricAdvantage.MODID+":textures/materials/laser_beam.png"); + private final ResourceLocation texture = ResourceLocation.parse(ElectricAdvantage.MODID+":textures/materials/laser_beam.png"); private final RenderType beamType = ElectricRenderTypes.unshaded(texture, false); diff --git a/src/main/java/zone/moddev/mc/baseelectric/graphics/LaserTurretRenderer.java b/src/main/java/zone/moddev/mc/baseelectric/graphics/LaserTurretRenderer.java index ea57220d..b81ceda3 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/graphics/LaserTurretRenderer.java +++ b/src/main/java/zone/moddev/mc/baseelectric/graphics/LaserTurretRenderer.java @@ -16,7 +16,7 @@ public class LaserTurretRenderer implements BlockEntityRenderer{ - private final ResourceLocation texture = new ResourceLocation(ElectricAdvantage.MODID+":textures/entity/laser_turret.png"); + private final ResourceLocation texture = ResourceLocation.parse(ElectricAdvantage.MODID+":textures/entity/laser_turret.png"); private final RenderType renderType = ElectricRenderTypes.unshaded(texture, true); public LaserTurretRenderer(BlockEntityRendererProvider.Context context) { diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/ArcFurnaceGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/ArcFurnaceGUI.java index 660cabd8..d32d633f 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/ArcFurnaceGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/ArcFurnaceGUI.java @@ -15,7 +15,7 @@ public class ArcFurnaceGUI extends SimpleMachineGUI{ public ArcFurnaceGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/electric_furnace_gui.png"), + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/electric_furnace_gui.png"), Integer2D.fromCoordinates(12,34, 12,55, 12,76, 12,97, 124,45, 145,45, 124,66, 145,66, 124,87, 145,87)); for(int i = 4; i < 10; i++)super.specialSlots.put(i, (SlotContext c)->new Slot(c.machineInventory,c.slotIndex,c.screenPositionX,c.screenPositionY){ diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/BatteryArrayGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/BatteryArrayGUI.java index bdad9e4b..3d72a715 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/BatteryArrayGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/BatteryArrayGUI.java @@ -12,7 +12,7 @@ public class BatteryArrayGUI extends SimpleMachineGUI{ public BatteryArrayGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/electric_battery_array_gui.png"), + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/electric_battery_array_gui.png"), Integer2D.fromCoordinates( 27, 32, 27, 53, diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/ElectricDrillGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/ElectricDrillGUI.java index 6d12521a..1743f6da 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/ElectricDrillGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/ElectricDrillGUI.java @@ -12,7 +12,7 @@ public class ElectricDrillGUI extends SimpleMachineGUI{ public ElectricDrillGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/electric_drill_gui.png"), + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/electric_drill_gui.png"), Integer2D.fromCoordinates( 124,45, 145,45, 124,66, 145,66, 124,87, 145,87)); } diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/ElectricPumpGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/ElectricPumpGUI.java index b57643c6..ae467abc 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/ElectricPumpGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/ElectricPumpGUI.java @@ -13,7 +13,7 @@ public class ElectricPumpGUI extends SimpleMachineGUI{ public ElectricPumpGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/electric_pump_gui.png"), + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/electric_pump_gui.png"), new Integer2D[0]); } diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/ElectricStillGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/ElectricStillGUI.java index 2df9a6ac..064b2a39 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/ElectricStillGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/ElectricStillGUI.java @@ -13,7 +13,7 @@ public class ElectricStillGUI extends SimpleMachineGUI{ public ElectricStillGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/electric_still_gui.png"), + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/electric_still_gui.png"), new Integer2D[0]); } diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/FabricatorGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/FabricatorGUI.java index 53110eb4..9a0c1d2d 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/FabricatorGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/FabricatorGUI.java @@ -15,7 +15,7 @@ public class FabricatorGUI extends SimpleMachineGUI{ public FabricatorGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/electric_fabricator_gui.png"), + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/electric_fabricator_gui.png"), Integer2D.fromCoordinates( 12,34, 33,34, 54,34, 12,55, 33,55, 54,55, diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/GenericMachineGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/GenericMachineGUI.java index 788c6f8b..6829b2b1 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/GenericMachineGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/GenericMachineGUI.java @@ -12,7 +12,7 @@ public class GenericMachineGUI extends SimpleMachineGUI{ public GenericMachineGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/electric_machine_gui.png"), new Integer2D[0]); + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/electric_machine_gui.png"), new Integer2D[0]); } /** diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/GrowthChamberControllerGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/GrowthChamberControllerGUI.java index ab34ecf2..5813eaff 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/GrowthChamberControllerGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/GrowthChamberControllerGUI.java @@ -12,7 +12,7 @@ public class GrowthChamberControllerGUI extends SimpleMachineGUI{ public GrowthChamberControllerGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/growth_chamber_controller_gui.png"), + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/growth_chamber_controller_gui.png"), Integer2D.fromCoordinates(100,74)); } diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/GrowthChamberGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/GrowthChamberGUI.java index 9f31cbad..0444f265 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/GrowthChamberGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/GrowthChamberGUI.java @@ -12,7 +12,7 @@ public class GrowthChamberGUI extends SimpleMachineGUI{ public GrowthChamberGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/growth_chamber_gui.png"), + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/growth_chamber_gui.png"), Integer2D.fromCoordinates(12,38, 12,59, 12,80, 124,55, 145,55, 124,76, 145,76, 124,97, 145,97)); } diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/OvenGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/OvenGUI.java index ff7171b9..72819ff8 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/OvenGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/OvenGUI.java @@ -15,7 +15,7 @@ public class OvenGUI extends SimpleMachineGUI{ public OvenGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/electric_oven_gui.png"), + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/electric_oven_gui.png"), Integer2D.fromCoordinates(27,67, 133,67)); super.specialSlots.put(1, (SlotContext c)->new Slot(c.machineInventory,c.slotIndex,c.screenPositionX,c.screenPositionY){ @Override diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/PlasticRefineryGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/PlasticRefineryGUI.java index db2ee4d8..16285870 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/PlasticRefineryGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/PlasticRefineryGUI.java @@ -13,7 +13,7 @@ public class PlasticRefineryGUI extends SimpleMachineGUI{ public PlasticRefineryGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/plastic_refinery_gui.png"), + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/plastic_refinery_gui.png"), Integer2D.fromCoordinates(133,67)); } diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/PowerGeneratorGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/PowerGeneratorGUI.java index a1a2a125..41f952d2 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/PowerGeneratorGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/PowerGeneratorGUI.java @@ -12,7 +12,7 @@ public class PowerGeneratorGUI extends SimpleMachineGUI{ public PowerGeneratorGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/electric_generator_gui.png"), new Integer2D[0]); + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/electric_generator_gui.png"), new Integer2D[0]); } /** diff --git a/src/main/java/zone/moddev/mc/baseelectric/gui/RockCrusherGUI.java b/src/main/java/zone/moddev/mc/baseelectric/gui/RockCrusherGUI.java index b0e05c0b..42acc711 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/gui/RockCrusherGUI.java +++ b/src/main/java/zone/moddev/mc/baseelectric/gui/RockCrusherGUI.java @@ -12,7 +12,7 @@ public class RockCrusherGUI extends SimpleMachineGUI{ public RockCrusherGUI() { - super(new ResourceLocation(ElectricAdvantage.MODID+":textures/gui/container/electric_crusher_gui.png"), + super(ResourceLocation.parse(ElectricAdvantage.MODID+":textures/gui/container/electric_crusher_gui.png"), Integer2D.fromCoordinates(12,45, 12,66, 12,87, 124,45, 145,45, 124,66, 145,66, 124,87, 145,87)); } diff --git a/src/main/java/zone/moddev/mc/baseelectric/init/Blocks.java b/src/main/java/zone/moddev/mc/baseelectric/init/Blocks.java index 63547b11..722c543a 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/init/Blocks.java +++ b/src/main/java/zone/moddev/mc/baseelectric/init/Blocks.java @@ -108,7 +108,7 @@ private static Block add(Block block, String id) { @SubscribeEvent public static void registerBlocks(RegisterEvent event) { event.register(ForgeRegistries.Keys.BLOCKS, registry -> { constructBlocks(); - ALL_BLOCKS.forEach((id, block) -> registry.register(new ResourceLocation(ElectricAdvantage.MODID, id), block)); + ALL_BLOCKS.forEach((id, block) -> registry.register(ResourceLocation.fromNamespaceAndPath(ElectricAdvantage.MODID, id), block)); }); } @@ -118,7 +118,7 @@ private static Block add(Block block, String id) { if (!"pump_pipe_electric".equals(id) && !"laser_turret_evil".equals(id)) { ItemGroups.show(item); } - registry.register(new ResourceLocation(ElectricAdvantage.MODID, id), item); + registry.register(ResourceLocation.fromNamespaceAndPath(ElectricAdvantage.MODID, id), item); })); } } diff --git a/src/main/java/zone/moddev/mc/baseelectric/init/Entities.java b/src/main/java/zone/moddev/mc/baseelectric/init/Entities.java index f29ae0e2..f4dfbdc9 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/init/Entities.java +++ b/src/main/java/zone/moddev/mc/baseelectric/init/Entities.java @@ -78,7 +78,7 @@ private static void registerTiles(RegisterEvent.RegisterHelper { - ResourceLocation id = new ResourceLocation(ElectricAdvantage.MODID, "hydroturbine"); + ResourceLocation id = ResourceLocation.fromNamespaceAndPath(ElectricAdvantage.MODID, "hydroturbine"); HYDROTURBINE = EntityType.Builder.of(HydroturbineEntity::new, MobCategory.MISC) .sized(0.9375F, 0.9375F) .setTrackingRange(64).setUpdateInterval(1).setShouldReceiveVelocityUpdates(true) @@ -91,7 +91,7 @@ private static BlockEntityType tile( RegisterEvent.RegisterHelper> event, String id, BlockEntityType.BlockEntitySupplier factory, net.minecraft.world.level.block.Block... blocks) { BlockEntityType type = BlockEntityType.Builder.of(factory, blocks).build(null); - event.register(new ResourceLocation(ElectricAdvantage.MODID, id), type); + event.register(ResourceLocation.fromNamespaceAndPath(ElectricAdvantage.MODID, id), type); return type; } diff --git a/src/main/java/zone/moddev/mc/baseelectric/init/Items.java b/src/main/java/zone/moddev/mc/baseelectric/init/Items.java index 8dcdfcba..97bd4f1c 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/init/Items.java +++ b/src/main/java/zone/moddev/mc/baseelectric/init/Items.java @@ -74,7 +74,7 @@ private static Item add(String id, Item item) { event.register(ForgeRegistries.Keys.ITEMS, registry -> { constructItems(); allItems.forEach((id, item) -> - registry.register(new ResourceLocation(ElectricAdvantage.MODID, id), ItemGroups.show(item))); + registry.register(ResourceLocation.fromNamespaceAndPath(ElectricAdvantage.MODID, id), ItemGroups.show(item))); }); } diff --git a/src/main/java/zone/moddev/mc/baseelectric/init/OreSpawnWorldGen.java b/src/main/java/zone/moddev/mc/baseelectric/init/OreSpawnWorldGen.java index 98814e69..7be34361 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/init/OreSpawnWorldGen.java +++ b/src/main/java/zone/moddev/mc/baseelectric/init/OreSpawnWorldGen.java @@ -14,12 +14,12 @@ /** Registers ElectricAdvantage's visible fallback mineral rules with OreSpawn 4. */ public final class OreSpawnWorldGen { public static final ResourceLocation LITHIUM_ORE = - new ResourceLocation(ElectricAdvantage.MODID, "ore/lithium"); + ResourceLocation.fromNamespaceAndPath(ElectricAdvantage.MODID, "ore/lithium"); public static final ResourceLocation SULFUR_ORE = - new ResourceLocation(ElectricAdvantage.MODID, "ore/sulfur"); - private static final ResourceLocation OVERWORLD = new ResourceLocation("minecraft", "overworld"); - private static final ResourceLocation STONE = new ResourceLocation("minecraft", "stone"); - private static final ResourceLocation STONE_TAG = new ResourceLocation("forge", "stone"); + ResourceLocation.fromNamespaceAndPath(ElectricAdvantage.MODID, "ore/sulfur"); + private static final ResourceLocation OVERWORLD = ResourceLocation.fromNamespaceAndPath("minecraft", "overworld"); + private static final ResourceLocation STONE = ResourceLocation.fromNamespaceAndPath("minecraft", "stone"); + private static final ResourceLocation STONE_TAG = ResourceLocation.fromNamespaceAndPath("forge", "stone"); private OreSpawnWorldGen() { } @@ -46,7 +46,7 @@ static WorldgenProvider createProvider(boolean mineralogyLoaded, boolean baseMin boolean electricSulfurEnabled = !mineralogyLoaded && !baseMineralsLoaded; boolean electricLithiumEnabled = !baseMineralsLoaded; return WorldgenProvider.builder(ElectricAdvantage.MODID, 1) - .ore(LITHIUM_ORE, new ResourceLocation(ElectricAdvantage.MODID, "li_ore"), ore -> ore + .ore(LITHIUM_ORE, ResourceLocation.fromNamespaceAndPath(ElectricAdvantage.MODID, "li_ore"), ore -> ore .enabled(electricLithiumEnabled) .retrogen(false) .dimension(OVERWORLD, dimension -> addHosts(dimension @@ -55,7 +55,7 @@ static WorldgenProvider createProvider(boolean mineralogyLoaded, boolean baseMin .attempts(0.125D) .quantityRange(6, 9) .pattern(OrePattern.DEFAULT)))) - .ore(SULFUR_ORE, new ResourceLocation(ElectricAdvantage.MODID, "sulfur_ore"), ore -> ore + .ore(SULFUR_ORE, ResourceLocation.fromNamespaceAndPath(ElectricAdvantage.MODID, "sulfur_ore"), ore -> ore .enabled(electricSulfurEnabled) .retrogen(false) .dimension(OVERWORLD, dimension -> addHosts(dimension diff --git a/src/main/java/zone/moddev/mc/baseelectric/init/Power.java b/src/main/java/zone/moddev/mc/baseelectric/init/Power.java index a358e406..f0271dc5 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/init/Power.java +++ b/src/main/java/zone/moddev/mc/baseelectric/init/Power.java @@ -32,7 +32,7 @@ public abstract class Power { public static final ResourceKey PROPELLER_DAMAGE = damageType("propeller"); private static ResourceKey damageType(String id) { - return ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(ElectricAdvantage.MODID, id)); + return ResourceKey.create(Registries.DAMAGE_TYPE, ResourceLocation.fromNamespaceAndPath(ElectricAdvantage.MODID, id)); } public static DamageSource damageSource(Level level, ResourceKey type) { diff --git a/src/main/java/zone/moddev/mc/baseelectric/machines/ElectricMachineTileEntity.java b/src/main/java/zone/moddev/mc/baseelectric/machines/ElectricMachineTileEntity.java index fcd24da2..d02f2c69 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/machines/ElectricMachineTileEntity.java +++ b/src/main/java/zone/moddev/mc/baseelectric/machines/ElectricMachineTileEntity.java @@ -3,9 +3,8 @@ import zone.moddev.mc.baseelectric.init.Power; import cyano.poweradvantage.api.ConduitType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.SimpleContainer; +import net.minecraft.world.item.crafting.SingleRecipeInput; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.Recipe; import net.minecraft.nbt.CompoundTag; import net.minecraft.core.HolderLookup; import net.minecraft.world.level.block.entity.BlockEntity; @@ -219,8 +218,7 @@ protected static boolean areItemStacksEqualNullable(ItemStack left, ItemStack ri protected ItemStack getSmeltingResult(ItemStack input) { if (isEmptyStack(input) || getLevel() == null) return ItemStack.EMPTY; - SimpleContainer inventory = new SimpleContainer(1); - inventory.setItem(0, input); + SingleRecipeInput inventory = new SingleRecipeInput(input); return getLevel().getRecipeManager().getRecipeFor(RecipeType.SMELTING, inventory, getLevel()) .map(recipe -> recipe.value().assemble(inventory, getLevel().registryAccess())).orElse(ItemStack.EMPTY); } diff --git a/src/main/java/zone/moddev/mc/baseelectric/machines/GrowthChamberControllerTileEntity.java b/src/main/java/zone/moddev/mc/baseelectric/machines/GrowthChamberControllerTileEntity.java index 6355187c..f9d97483 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/machines/GrowthChamberControllerTileEntity.java +++ b/src/main/java/zone/moddev/mc/baseelectric/machines/GrowthChamberControllerTileEntity.java @@ -23,7 +23,7 @@ import net.minecraft.resources.ResourceLocation; public class GrowthChamberControllerTileEntity extends cyano.poweradvantage.api.simple.TileEntitySimplePowerMachine implements LegacyFluidHandler{ - private static final TagKey DIRT_TAG = TagKey.create(Registries.ITEM, new ResourceLocation("forge", "dirt")); + private static final TagKey DIRT_TAG = TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath("forge", "dirt")); static final float ELECTRICITY_PER_UNIT = 8f; diff --git a/src/main/java/zone/moddev/mc/baseelectric/machines/LaserTurretTileEntity.java b/src/main/java/zone/moddev/mc/baseelectric/machines/LaserTurretTileEntity.java index 39ca20f5..4a9ca3ee 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/machines/LaserTurretTileEntity.java +++ b/src/main/java/zone/moddev/mc/baseelectric/machines/LaserTurretTileEntity.java @@ -89,7 +89,7 @@ public class LaserTurretTileEntity extends ElectricMachineTileEntity{ public LaserTurretTileEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state){ super(zone.moddev.mc.baseelectric.init.Entities.LASER_TURRET, pos, state, "tile.baseelectric.laser_turret.name",MAX_BUFFER,0,0,0); SoundEvent soundEvent = ElectricAdvantage.INSTANCE == null ? SoundEvents.NOTE_BLOCK_BASS.value() - : ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation(ElectricAdvantage.INSTANCE.LASER_SOUND)); + : ForgeRegistries.SOUND_EVENTS.getValue(ResourceLocation.parse(ElectricAdvantage.INSTANCE.LASER_SOUND)); if(soundEvent == null){ LASER_SOUND = SoundEvents.ENDERMAN_TELEPORT; } else { diff --git a/src/main/java/zone/moddev/mc/baseelectric/machines/PlasticRefineryTileEntity.java b/src/main/java/zone/moddev/mc/baseelectric/machines/PlasticRefineryTileEntity.java index 60108c51..0eddf244 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/machines/PlasticRefineryTileEntity.java +++ b/src/main/java/zone/moddev/mc/baseelectric/machines/PlasticRefineryTileEntity.java @@ -26,7 +26,7 @@ import java.util.List; public class PlasticRefineryTileEntity extends ElectricMachineTileEntity implements LegacyFluidHandler{ - private static final TagKey PLASTICS_TAG = TagKey.create(Registries.ITEM, new ResourceLocation("forge", "plastics")); + private static final TagKey PLASTICS_TAG = TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath("forge", "plastics")); public static final float ENERGY_PER_TICK = 12f; diff --git a/src/main/java/zone/moddev/mc/baseelectric/migration/ElectricLegacyMigrations.java b/src/main/java/zone/moddev/mc/baseelectric/migration/ElectricLegacyMigrations.java index 41475ba3..498aa163 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/migration/ElectricLegacyMigrations.java +++ b/src/main/java/zone/moddev/mc/baseelectric/migration/ElectricLegacyMigrations.java @@ -93,6 +93,6 @@ static boolean legacyDrillActive(int metadata) { } private static ResourceLocation id(String path) { - return new ResourceLocation(ElectricAdvantage.MODID, path); + return ResourceLocation.fromNamespaceAndPath(ElectricAdvantage.MODID, path); } } diff --git a/src/main/java/zone/moddev/mc/baseelectric/util/crafting/ItemMatcher.java b/src/main/java/zone/moddev/mc/baseelectric/util/crafting/ItemMatcher.java index e24d97c3..4211777f 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/util/crafting/ItemMatcher.java +++ b/src/main/java/zone/moddev/mc/baseelectric/util/crafting/ItemMatcher.java @@ -67,7 +67,7 @@ public Collection getValidItems() { } private static ResourceLocation tagId(String name) { - if (name.indexOf(':') >= 0) return new ResourceLocation(name); + if (name.indexOf(':') >= 0) return ResourceLocation.parse(name); String[][] forms = { {"ingot", "ingots"}, {"nugget", "nuggets"}, {"dust", "dusts"}, {"ore", "ores"}, {"block", "storage_blocks"}, {"plate", "plates"}, @@ -76,10 +76,10 @@ private static ResourceLocation tagId(String name) { for (String[] form : forms) { if (name.startsWith(form[0]) && name.length() > form[0].length()) { String material = name.substring(form[0].length()).toLowerCase(java.util.Locale.ROOT); - return new ResourceLocation("forge", form[1] + "/" + material); + return ResourceLocation.fromNamespaceAndPath("forge", form[1] + "/" + material); } } - return new ResourceLocation("forge", name.toLowerCase(java.util.Locale.ROOT)); + return ResourceLocation.fromNamespaceAndPath("forge", name.toLowerCase(java.util.Locale.ROOT)); } @Override diff --git a/src/main/java/zone/moddev/mc/baseelectric/util/crafting/RecipeDeconstructor.java b/src/main/java/zone/moddev/mc/baseelectric/util/crafting/RecipeDeconstructor.java index 9b0c8d34..f85e47ee 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/util/crafting/RecipeDeconstructor.java +++ b/src/main/java/zone/moddev/mc/baseelectric/util/crafting/RecipeDeconstructor.java @@ -13,7 +13,6 @@ import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.Level; -import zone.moddev.mc.baseelectric.ElectricAdvantage; /** Recursive crafting solver used by the Electric Fabricator. */ public final class RecipeDeconstructor { diff --git a/src/main/java/zone/moddev/mc/baseelectric/util/farming/VirtualCrop.java b/src/main/java/zone/moddev/mc/baseelectric/util/farming/VirtualCrop.java index df866b94..6dd6088b 100644 --- a/src/main/java/zone/moddev/mc/baseelectric/util/farming/VirtualCrop.java +++ b/src/main/java/zone/moddev/mc/baseelectric/util/farming/VirtualCrop.java @@ -84,7 +84,7 @@ public static VirtualCrop createVirtualCrop(ItemStack stack, Level w, BlockPos p private static Block resolveStemFruit(StemBlock stem, Level world) { - // Forge 50 exposes the registered fruit key through the native stem codec. + // Forge 52 exposes the registered fruit key through the native stem codec. var ops = world.registryAccess().createSerializationContext(JsonOps.INSTANCE); return StemBlock.CODEC.codec().encodeStart(ops, stem).result() .flatMap(data -> ResourceKey.codec(Registries.BLOCK) diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index c9da2ebe..5816058b 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -30,13 +30,13 @@ side="BOTH" [[dependencies.baseelectric]] modId="basepower" mandatory=true -versionRange="[2.4.13.120061,3.0.0)" +versionRange="[2.4.14.121011,3.0.0)" ordering="AFTER" side="BOTH" [[dependencies.baseelectric]] modId="basemetals" mandatory=false -versionRange="[3.1.2.120061,4.0.0)" +versionRange="[3.1.2.121011,4.0.0)" ordering="AFTER" side="BOTH" diff --git a/src/main/resources/data/baseelectric/advancements/recipes/alkaline_battery.json b/src/main/resources/data/baseelectric/advancement/recipes/alkaline_battery.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/alkaline_battery.json rename to src/main/resources/data/baseelectric/advancement/recipes/alkaline_battery.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/blank_circuit_board_ingot_normal.json b/src/main/resources/data/baseelectric/advancement/recipes/blank_circuit_board_ingot_normal.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/blank_circuit_board_ingot_normal.json rename to src/main/resources/data/baseelectric/advancement/recipes/blank_circuit_board_ingot_normal.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/blank_circuit_board_plate.json b/src/main/resources/data/baseelectric/advancement/recipes/blank_circuit_board_plate.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/blank_circuit_board_plate.json rename to src/main/resources/data/baseelectric/advancement/recipes/blank_circuit_board_plate.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/control_circuit.json b/src/main/resources/data/baseelectric/advancement/recipes/control_circuit.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/control_circuit.json rename to src/main/resources/data/baseelectric/advancement/recipes/control_circuit.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_battery_array.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_battery_array.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_battery_array.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_battery_array.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_conduit_plastic_ingot.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_conduit_plastic_ingot.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_conduit_plastic_ingot.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_conduit_plastic_ingot.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_conduit_plastic_rod.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_conduit_plastic_rod.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_conduit_plastic_rod.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_conduit_plastic_rod.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_conduit_rubber_ingot.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_conduit_rubber_ingot.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_conduit_rubber_ingot.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_conduit_rubber_ingot.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_conduit_rubber_rod.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_conduit_rubber_rod.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_conduit_rubber_rod.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_conduit_rubber_rod.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_crusher.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_crusher.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_crusher.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_crusher.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_drill.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_drill.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_drill.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_drill.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_fabricator.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_fabricator.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_fabricator.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_fabricator.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_furnace.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_furnace.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_furnace.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_furnace.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_oven.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_oven.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_oven.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_oven.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_pump.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_pump.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_pump.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_pump.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_still.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_still.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_still.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_still.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_switch.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_switch.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_switch.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_switch.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/electric_track.json b/src/main/resources/data/baseelectric/advancement/recipes/electric_track.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/electric_track.json rename to src/main/resources/data/baseelectric/advancement/recipes/electric_track.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/growth_chamber.json b/src/main/resources/data/baseelectric/advancement/recipes/growth_chamber.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/growth_chamber.json rename to src/main/resources/data/baseelectric/advancement/recipes/growth_chamber.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/growth_chamber_controller.json b/src/main/resources/data/baseelectric/advancement/recipes/growth_chamber_controller.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/growth_chamber_controller.json rename to src/main/resources/data/baseelectric/advancement/recipes/growth_chamber_controller.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/hydroelectric_generator.json b/src/main/resources/data/baseelectric/advancement/recipes/hydroelectric_generator.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/hydroelectric_generator.json rename to src/main/resources/data/baseelectric/advancement/recipes/hydroelectric_generator.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/integrated_circuit_copper_normal.json b/src/main/resources/data/baseelectric/advancement/recipes/integrated_circuit_copper_normal.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/integrated_circuit_copper_normal.json rename to src/main/resources/data/baseelectric/advancement/recipes/integrated_circuit_copper_normal.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/integrated_circuit_copper_tech.json b/src/main/resources/data/baseelectric/advancement/recipes/integrated_circuit_copper_tech.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/integrated_circuit_copper_tech.json rename to src/main/resources/data/baseelectric/advancement/recipes/integrated_circuit_copper_tech.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/integrated_circuit_gold_normal.json b/src/main/resources/data/baseelectric/advancement/recipes/integrated_circuit_gold_normal.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/integrated_circuit_gold_normal.json rename to src/main/resources/data/baseelectric/advancement/recipes/integrated_circuit_gold_normal.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/integrated_circuit_gold_tech.json b/src/main/resources/data/baseelectric/advancement/recipes/integrated_circuit_gold_tech.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/integrated_circuit_gold_tech.json rename to src/main/resources/data/baseelectric/advancement/recipes/integrated_circuit_gold_tech.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/integrated_circuit_tin_normal.json b/src/main/resources/data/baseelectric/advancement/recipes/integrated_circuit_tin_normal.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/integrated_circuit_tin_normal.json rename to src/main/resources/data/baseelectric/advancement/recipes/integrated_circuit_tin_normal.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/integrated_circuit_tin_tech.json b/src/main/resources/data/baseelectric/advancement/recipes/integrated_circuit_tin_tech.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/integrated_circuit_tin_tech.json rename to src/main/resources/data/baseelectric/advancement/recipes/integrated_circuit_tin_tech.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/laser_turret_diamond_emerald.json b/src/main/resources/data/baseelectric/advancement/recipes/laser_turret_diamond_emerald.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/laser_turret_diamond_emerald.json rename to src/main/resources/data/baseelectric/advancement/recipes/laser_turret_diamond_emerald.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/laser_turret_emerald_diamond.json b/src/main/resources/data/baseelectric/advancement/recipes/laser_turret_emerald_diamond.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/laser_turret_emerald_diamond.json rename to src/main/resources/data/baseelectric/advancement/recipes/laser_turret_emerald_diamond.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/lead_acid_battery_dust_sulfur.json b/src/main/resources/data/baseelectric/advancement/recipes/lead_acid_battery_dust_sulfur.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/lead_acid_battery_dust_sulfur.json rename to src/main/resources/data/baseelectric/advancement/recipes/lead_acid_battery_dust_sulfur.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/lead_acid_battery_sulfur.json b/src/main/resources/data/baseelectric/advancement/recipes/lead_acid_battery_sulfur.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/lead_acid_battery_sulfur.json rename to src/main/resources/data/baseelectric/advancement/recipes/lead_acid_battery_sulfur.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/led_bar.json b/src/main/resources/data/baseelectric/advancement/recipes/led_bar.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/led_bar.json rename to src/main/resources/data/baseelectric/advancement/recipes/led_bar.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/lithium_battery.json b/src/main/resources/data/baseelectric/advancement/recipes/lithium_battery.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/lithium_battery.json rename to src/main/resources/data/baseelectric/advancement/recipes/lithium_battery.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/lithium_ingot_from_nuggets.json b/src/main/resources/data/baseelectric/advancement/recipes/lithium_ingot_from_nuggets.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/lithium_ingot_from_nuggets.json rename to src/main/resources/data/baseelectric/advancement/recipes/lithium_ingot_from_nuggets.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/lithium_ingot_from_ore.json b/src/main/resources/data/baseelectric/advancement/recipes/lithium_ingot_from_ore.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/lithium_ingot_from_ore.json rename to src/main/resources/data/baseelectric/advancement/recipes/lithium_ingot_from_ore.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/lithium_ingot_from_powder.json b/src/main/resources/data/baseelectric/advancement/recipes/lithium_ingot_from_powder.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/lithium_ingot_from_powder.json rename to src/main/resources/data/baseelectric/advancement/recipes/lithium_ingot_from_powder.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/lithium_nuggets.json b/src/main/resources/data/baseelectric/advancement/recipes/lithium_nuggets.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/lithium_nuggets.json rename to src/main/resources/data/baseelectric/advancement/recipes/lithium_nuggets.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/nickel_hydride_battery.json b/src/main/resources/data/baseelectric/advancement/recipes/nickel_hydride_battery.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/nickel_hydride_battery.json rename to src/main/resources/data/baseelectric/advancement/recipes/nickel_hydride_battery.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/photovoltaic_generator.json b/src/main/resources/data/baseelectric/advancement/recipes/photovoltaic_generator.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/photovoltaic_generator.json rename to src/main/resources/data/baseelectric/advancement/recipes/photovoltaic_generator.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/plastic_refinery.json b/src/main/resources/data/baseelectric/advancement/recipes/plastic_refinery.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/plastic_refinery.json rename to src/main/resources/data/baseelectric/advancement/recipes/plastic_refinery.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/power_supply_unit_iron_normal.json b/src/main/resources/data/baseelectric/advancement/recipes/power_supply_unit_iron_normal.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/power_supply_unit_iron_normal.json rename to src/main/resources/data/baseelectric/advancement/recipes/power_supply_unit_iron_normal.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/power_supply_unit_plate_steel_apocalyptic.json b/src/main/resources/data/baseelectric/advancement/recipes/power_supply_unit_plate_steel_apocalyptic.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/power_supply_unit_plate_steel_apocalyptic.json rename to src/main/resources/data/baseelectric/advancement/recipes/power_supply_unit_plate_steel_apocalyptic.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/power_supply_unit_plate_steel_tech.json b/src/main/resources/data/baseelectric/advancement/recipes/power_supply_unit_plate_steel_tech.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/power_supply_unit_plate_steel_tech.json rename to src/main/resources/data/baseelectric/advancement/recipes/power_supply_unit_plate_steel_tech.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/power_supply_unit_steel_normal.json b/src/main/resources/data/baseelectric/advancement/recipes/power_supply_unit_steel_normal.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/power_supply_unit_steel_normal.json rename to src/main/resources/data/baseelectric/advancement/recipes/power_supply_unit_steel_normal.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/silicon_blend.json b/src/main/resources/data/baseelectric/advancement/recipes/silicon_blend.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/silicon_blend.json rename to src/main/resources/data/baseelectric/advancement/recipes/silicon_blend.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/silicon_ingot_from_blend.json b/src/main/resources/data/baseelectric/advancement/recipes/silicon_ingot_from_blend.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/silicon_ingot_from_blend.json rename to src/main/resources/data/baseelectric/advancement/recipes/silicon_ingot_from_blend.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/solder_blend_tin_lead.json b/src/main/resources/data/baseelectric/advancement/recipes/solder_blend_tin_lead.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/solder_blend_tin_lead.json rename to src/main/resources/data/baseelectric/advancement/recipes/solder_blend_tin_lead.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/solder_blend_tin_silver.json b/src/main/resources/data/baseelectric/advancement/recipes/solder_blend_tin_silver.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/solder_blend_tin_silver.json rename to src/main/resources/data/baseelectric/advancement/recipes/solder_blend_tin_silver.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/solder_from_blend.json b/src/main/resources/data/baseelectric/advancement/recipes/solder_from_blend.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/solder_from_blend.json rename to src/main/resources/data/baseelectric/advancement/recipes/solder_from_blend.json diff --git a/src/main/resources/data/baseelectric/advancements/recipes/steam_powered_generator.json b/src/main/resources/data/baseelectric/advancement/recipes/steam_powered_generator.json similarity index 100% rename from src/main/resources/data/baseelectric/advancements/recipes/steam_powered_generator.json rename to src/main/resources/data/baseelectric/advancement/recipes/steam_powered_generator.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/electric_battery_array.json b/src/main/resources/data/baseelectric/loot_table/blocks/electric_battery_array.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/electric_battery_array.json rename to src/main/resources/data/baseelectric/loot_table/blocks/electric_battery_array.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/electric_conduit.json b/src/main/resources/data/baseelectric/loot_table/blocks/electric_conduit.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/electric_conduit.json rename to src/main/resources/data/baseelectric/loot_table/blocks/electric_conduit.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/electric_crusher.json b/src/main/resources/data/baseelectric/loot_table/blocks/electric_crusher.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/electric_crusher.json rename to src/main/resources/data/baseelectric/loot_table/blocks/electric_crusher.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/electric_drill.json b/src/main/resources/data/baseelectric/loot_table/blocks/electric_drill.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/electric_drill.json rename to src/main/resources/data/baseelectric/loot_table/blocks/electric_drill.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/electric_fabricator.json b/src/main/resources/data/baseelectric/loot_table/blocks/electric_fabricator.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/electric_fabricator.json rename to src/main/resources/data/baseelectric/loot_table/blocks/electric_fabricator.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/electric_furnace.json b/src/main/resources/data/baseelectric/loot_table/blocks/electric_furnace.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/electric_furnace.json rename to src/main/resources/data/baseelectric/loot_table/blocks/electric_furnace.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/electric_oven.json b/src/main/resources/data/baseelectric/loot_table/blocks/electric_oven.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/electric_oven.json rename to src/main/resources/data/baseelectric/loot_table/blocks/electric_oven.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/electric_pump.json b/src/main/resources/data/baseelectric/loot_table/blocks/electric_pump.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/electric_pump.json rename to src/main/resources/data/baseelectric/loot_table/blocks/electric_pump.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/electric_still.json b/src/main/resources/data/baseelectric/loot_table/blocks/electric_still.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/electric_still.json rename to src/main/resources/data/baseelectric/loot_table/blocks/electric_still.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/electric_switch.json b/src/main/resources/data/baseelectric/loot_table/blocks/electric_switch.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/electric_switch.json rename to src/main/resources/data/baseelectric/loot_table/blocks/electric_switch.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/electric_track.json b/src/main/resources/data/baseelectric/loot_table/blocks/electric_track.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/electric_track.json rename to src/main/resources/data/baseelectric/loot_table/blocks/electric_track.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/growth_chamber.json b/src/main/resources/data/baseelectric/loot_table/blocks/growth_chamber.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/growth_chamber.json rename to src/main/resources/data/baseelectric/loot_table/blocks/growth_chamber.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/growth_chamber_controller.json b/src/main/resources/data/baseelectric/loot_table/blocks/growth_chamber_controller.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/growth_chamber_controller.json rename to src/main/resources/data/baseelectric/loot_table/blocks/growth_chamber_controller.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/hydroelectric_generator.json b/src/main/resources/data/baseelectric/loot_table/blocks/hydroelectric_generator.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/hydroelectric_generator.json rename to src/main/resources/data/baseelectric/loot_table/blocks/hydroelectric_generator.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/laser_turret.json b/src/main/resources/data/baseelectric/loot_table/blocks/laser_turret.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/laser_turret.json rename to src/main/resources/data/baseelectric/loot_table/blocks/laser_turret.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/laser_turret_evil.json b/src/main/resources/data/baseelectric/loot_table/blocks/laser_turret_evil.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/laser_turret_evil.json rename to src/main/resources/data/baseelectric/loot_table/blocks/laser_turret_evil.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/led_bar.json b/src/main/resources/data/baseelectric/loot_table/blocks/led_bar.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/led_bar.json rename to src/main/resources/data/baseelectric/loot_table/blocks/led_bar.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/photovoltaic_generator.json b/src/main/resources/data/baseelectric/loot_table/blocks/photovoltaic_generator.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/photovoltaic_generator.json rename to src/main/resources/data/baseelectric/loot_table/blocks/photovoltaic_generator.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/plastic_refinery.json b/src/main/resources/data/baseelectric/loot_table/blocks/plastic_refinery.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/plastic_refinery.json rename to src/main/resources/data/baseelectric/loot_table/blocks/plastic_refinery.json diff --git a/src/main/resources/data/baseelectric/loot_tables/blocks/steam_powered_generator.json b/src/main/resources/data/baseelectric/loot_table/blocks/steam_powered_generator.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/blocks/steam_powered_generator.json rename to src/main/resources/data/baseelectric/loot_table/blocks/steam_powered_generator.json diff --git a/src/main/resources/data/baseelectric/loot_tables/chests/advantage_parts.json b/src/main/resources/data/baseelectric/loot_table/chests/advantage_parts.json similarity index 100% rename from src/main/resources/data/baseelectric/loot_tables/chests/advantage_parts.json rename to src/main/resources/data/baseelectric/loot_table/chests/advantage_parts.json diff --git a/src/main/resources/data/baseelectric/recipes/alkaline_battery.json b/src/main/resources/data/baseelectric/recipe/alkaline_battery.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/alkaline_battery.json rename to src/main/resources/data/baseelectric/recipe/alkaline_battery.json diff --git a/src/main/resources/data/baseelectric/recipes/blank_circuit_board_ingot_normal.json b/src/main/resources/data/baseelectric/recipe/blank_circuit_board_ingot_normal.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/blank_circuit_board_ingot_normal.json rename to src/main/resources/data/baseelectric/recipe/blank_circuit_board_ingot_normal.json diff --git a/src/main/resources/data/baseelectric/recipes/blank_circuit_board_plate.json b/src/main/resources/data/baseelectric/recipe/blank_circuit_board_plate.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/blank_circuit_board_plate.json rename to src/main/resources/data/baseelectric/recipe/blank_circuit_board_plate.json diff --git a/src/main/resources/data/baseelectric/recipes/control_circuit.json b/src/main/resources/data/baseelectric/recipe/control_circuit.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/control_circuit.json rename to src/main/resources/data/baseelectric/recipe/control_circuit.json diff --git a/src/main/resources/data/baseelectric/recipes/crushing_control_circuit.json b/src/main/resources/data/baseelectric/recipe/crushing_control_circuit.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/crushing_control_circuit.json rename to src/main/resources/data/baseelectric/recipe/crushing_control_circuit.json diff --git a/src/main/resources/data/baseelectric/recipes/crushing_electric_furnace.json b/src/main/resources/data/baseelectric/recipe/crushing_electric_furnace.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/crushing_electric_furnace.json rename to src/main/resources/data/baseelectric/recipe/crushing_electric_furnace.json diff --git a/src/main/resources/data/baseelectric/recipes/crushing_lithium_ingot.json b/src/main/resources/data/baseelectric/recipe/crushing_lithium_ingot.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/crushing_lithium_ingot.json rename to src/main/resources/data/baseelectric/recipe/crushing_lithium_ingot.json diff --git a/src/main/resources/data/baseelectric/recipes/crushing_lithium_ore.json b/src/main/resources/data/baseelectric/recipe/crushing_lithium_ore.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/crushing_lithium_ore.json rename to src/main/resources/data/baseelectric/recipe/crushing_lithium_ore.json diff --git a/src/main/resources/data/baseelectric/recipes/crushing_photovoltaic_generator.json b/src/main/resources/data/baseelectric/recipe/crushing_photovoltaic_generator.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/crushing_photovoltaic_generator.json rename to src/main/resources/data/baseelectric/recipe/crushing_photovoltaic_generator.json diff --git a/src/main/resources/data/baseelectric/recipes/crushing_psu.json b/src/main/resources/data/baseelectric/recipe/crushing_psu.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/crushing_psu.json rename to src/main/resources/data/baseelectric/recipe/crushing_psu.json diff --git a/src/main/resources/data/baseelectric/recipes/crushing_steam_powered_generator.json b/src/main/resources/data/baseelectric/recipe/crushing_steam_powered_generator.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/crushing_steam_powered_generator.json rename to src/main/resources/data/baseelectric/recipe/crushing_steam_powered_generator.json diff --git a/src/main/resources/data/baseelectric/recipes/crushing_sulfur_ore.json b/src/main/resources/data/baseelectric/recipe/crushing_sulfur_ore.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/crushing_sulfur_ore.json rename to src/main/resources/data/baseelectric/recipe/crushing_sulfur_ore.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_battery_array.json b/src/main/resources/data/baseelectric/recipe/electric_battery_array.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_battery_array.json rename to src/main/resources/data/baseelectric/recipe/electric_battery_array.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_conduit_plastic_ingot.json b/src/main/resources/data/baseelectric/recipe/electric_conduit_plastic_ingot.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_conduit_plastic_ingot.json rename to src/main/resources/data/baseelectric/recipe/electric_conduit_plastic_ingot.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_conduit_plastic_rod.json b/src/main/resources/data/baseelectric/recipe/electric_conduit_plastic_rod.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_conduit_plastic_rod.json rename to src/main/resources/data/baseelectric/recipe/electric_conduit_plastic_rod.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_conduit_rubber_ingot.json b/src/main/resources/data/baseelectric/recipe/electric_conduit_rubber_ingot.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_conduit_rubber_ingot.json rename to src/main/resources/data/baseelectric/recipe/electric_conduit_rubber_ingot.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_conduit_rubber_rod.json b/src/main/resources/data/baseelectric/recipe/electric_conduit_rubber_rod.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_conduit_rubber_rod.json rename to src/main/resources/data/baseelectric/recipe/electric_conduit_rubber_rod.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_crusher.json b/src/main/resources/data/baseelectric/recipe/electric_crusher.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_crusher.json rename to src/main/resources/data/baseelectric/recipe/electric_crusher.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_drill.json b/src/main/resources/data/baseelectric/recipe/electric_drill.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_drill.json rename to src/main/resources/data/baseelectric/recipe/electric_drill.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_fabricator.json b/src/main/resources/data/baseelectric/recipe/electric_fabricator.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_fabricator.json rename to src/main/resources/data/baseelectric/recipe/electric_fabricator.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_furnace.json b/src/main/resources/data/baseelectric/recipe/electric_furnace.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_furnace.json rename to src/main/resources/data/baseelectric/recipe/electric_furnace.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_oven.json b/src/main/resources/data/baseelectric/recipe/electric_oven.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_oven.json rename to src/main/resources/data/baseelectric/recipe/electric_oven.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_pump.json b/src/main/resources/data/baseelectric/recipe/electric_pump.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_pump.json rename to src/main/resources/data/baseelectric/recipe/electric_pump.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_still.json b/src/main/resources/data/baseelectric/recipe/electric_still.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_still.json rename to src/main/resources/data/baseelectric/recipe/electric_still.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_switch.json b/src/main/resources/data/baseelectric/recipe/electric_switch.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_switch.json rename to src/main/resources/data/baseelectric/recipe/electric_switch.json diff --git a/src/main/resources/data/baseelectric/recipes/electric_track.json b/src/main/resources/data/baseelectric/recipe/electric_track.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/electric_track.json rename to src/main/resources/data/baseelectric/recipe/electric_track.json diff --git a/src/main/resources/data/baseelectric/recipes/growth_chamber.json b/src/main/resources/data/baseelectric/recipe/growth_chamber.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/growth_chamber.json rename to src/main/resources/data/baseelectric/recipe/growth_chamber.json diff --git a/src/main/resources/data/baseelectric/recipes/growth_chamber_controller.json b/src/main/resources/data/baseelectric/recipe/growth_chamber_controller.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/growth_chamber_controller.json rename to src/main/resources/data/baseelectric/recipe/growth_chamber_controller.json diff --git a/src/main/resources/data/baseelectric/recipes/hydroelectric_generator.json b/src/main/resources/data/baseelectric/recipe/hydroelectric_generator.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/hydroelectric_generator.json rename to src/main/resources/data/baseelectric/recipe/hydroelectric_generator.json diff --git a/src/main/resources/data/baseelectric/recipes/integrated_circuit_copper_normal.json b/src/main/resources/data/baseelectric/recipe/integrated_circuit_copper_normal.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/integrated_circuit_copper_normal.json rename to src/main/resources/data/baseelectric/recipe/integrated_circuit_copper_normal.json diff --git a/src/main/resources/data/baseelectric/recipes/integrated_circuit_copper_tech.json b/src/main/resources/data/baseelectric/recipe/integrated_circuit_copper_tech.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/integrated_circuit_copper_tech.json rename to src/main/resources/data/baseelectric/recipe/integrated_circuit_copper_tech.json diff --git a/src/main/resources/data/baseelectric/recipes/integrated_circuit_gold_normal.json b/src/main/resources/data/baseelectric/recipe/integrated_circuit_gold_normal.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/integrated_circuit_gold_normal.json rename to src/main/resources/data/baseelectric/recipe/integrated_circuit_gold_normal.json diff --git a/src/main/resources/data/baseelectric/recipes/integrated_circuit_gold_tech.json b/src/main/resources/data/baseelectric/recipe/integrated_circuit_gold_tech.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/integrated_circuit_gold_tech.json rename to src/main/resources/data/baseelectric/recipe/integrated_circuit_gold_tech.json diff --git a/src/main/resources/data/baseelectric/recipes/integrated_circuit_tin_normal.json b/src/main/resources/data/baseelectric/recipe/integrated_circuit_tin_normal.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/integrated_circuit_tin_normal.json rename to src/main/resources/data/baseelectric/recipe/integrated_circuit_tin_normal.json diff --git a/src/main/resources/data/baseelectric/recipes/integrated_circuit_tin_tech.json b/src/main/resources/data/baseelectric/recipe/integrated_circuit_tin_tech.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/integrated_circuit_tin_tech.json rename to src/main/resources/data/baseelectric/recipe/integrated_circuit_tin_tech.json diff --git a/src/main/resources/data/baseelectric/recipes/laser_turret_diamond_emerald.json b/src/main/resources/data/baseelectric/recipe/laser_turret_diamond_emerald.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/laser_turret_diamond_emerald.json rename to src/main/resources/data/baseelectric/recipe/laser_turret_diamond_emerald.json diff --git a/src/main/resources/data/baseelectric/recipes/laser_turret_emerald_diamond.json b/src/main/resources/data/baseelectric/recipe/laser_turret_emerald_diamond.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/laser_turret_emerald_diamond.json rename to src/main/resources/data/baseelectric/recipe/laser_turret_emerald_diamond.json diff --git a/src/main/resources/data/baseelectric/recipes/lead_acid_battery_dust_sulfur.json b/src/main/resources/data/baseelectric/recipe/lead_acid_battery_dust_sulfur.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/lead_acid_battery_dust_sulfur.json rename to src/main/resources/data/baseelectric/recipe/lead_acid_battery_dust_sulfur.json diff --git a/src/main/resources/data/baseelectric/recipes/lead_acid_battery_sulfur.json b/src/main/resources/data/baseelectric/recipe/lead_acid_battery_sulfur.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/lead_acid_battery_sulfur.json rename to src/main/resources/data/baseelectric/recipe/lead_acid_battery_sulfur.json diff --git a/src/main/resources/data/baseelectric/recipes/led_bar.json b/src/main/resources/data/baseelectric/recipe/led_bar.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/led_bar.json rename to src/main/resources/data/baseelectric/recipe/led_bar.json diff --git a/src/main/resources/data/baseelectric/recipes/lithium_battery.json b/src/main/resources/data/baseelectric/recipe/lithium_battery.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/lithium_battery.json rename to src/main/resources/data/baseelectric/recipe/lithium_battery.json diff --git a/src/main/resources/data/baseelectric/recipes/lithium_ingot_from_nuggets.json b/src/main/resources/data/baseelectric/recipe/lithium_ingot_from_nuggets.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/lithium_ingot_from_nuggets.json rename to src/main/resources/data/baseelectric/recipe/lithium_ingot_from_nuggets.json diff --git a/src/main/resources/data/baseelectric/recipes/lithium_ingot_from_ore.json b/src/main/resources/data/baseelectric/recipe/lithium_ingot_from_ore.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/lithium_ingot_from_ore.json rename to src/main/resources/data/baseelectric/recipe/lithium_ingot_from_ore.json diff --git a/src/main/resources/data/baseelectric/recipes/lithium_ingot_from_powder.json b/src/main/resources/data/baseelectric/recipe/lithium_ingot_from_powder.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/lithium_ingot_from_powder.json rename to src/main/resources/data/baseelectric/recipe/lithium_ingot_from_powder.json diff --git a/src/main/resources/data/baseelectric/recipes/lithium_nuggets.json b/src/main/resources/data/baseelectric/recipe/lithium_nuggets.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/lithium_nuggets.json rename to src/main/resources/data/baseelectric/recipe/lithium_nuggets.json diff --git a/src/main/resources/data/baseelectric/recipes/nickel_hydride_battery.json b/src/main/resources/data/baseelectric/recipe/nickel_hydride_battery.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/nickel_hydride_battery.json rename to src/main/resources/data/baseelectric/recipe/nickel_hydride_battery.json diff --git a/src/main/resources/data/baseelectric/recipes/photovoltaic_generator.json b/src/main/resources/data/baseelectric/recipe/photovoltaic_generator.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/photovoltaic_generator.json rename to src/main/resources/data/baseelectric/recipe/photovoltaic_generator.json diff --git a/src/main/resources/data/baseelectric/recipes/plastic_refinery.json b/src/main/resources/data/baseelectric/recipe/plastic_refinery.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/plastic_refinery.json rename to src/main/resources/data/baseelectric/recipe/plastic_refinery.json diff --git a/src/main/resources/data/baseelectric/recipes/power_supply_unit_iron_normal.json b/src/main/resources/data/baseelectric/recipe/power_supply_unit_iron_normal.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/power_supply_unit_iron_normal.json rename to src/main/resources/data/baseelectric/recipe/power_supply_unit_iron_normal.json diff --git a/src/main/resources/data/baseelectric/recipes/power_supply_unit_plate_steel_apocalyptic.json b/src/main/resources/data/baseelectric/recipe/power_supply_unit_plate_steel_apocalyptic.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/power_supply_unit_plate_steel_apocalyptic.json rename to src/main/resources/data/baseelectric/recipe/power_supply_unit_plate_steel_apocalyptic.json diff --git a/src/main/resources/data/baseelectric/recipes/power_supply_unit_plate_steel_tech.json b/src/main/resources/data/baseelectric/recipe/power_supply_unit_plate_steel_tech.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/power_supply_unit_plate_steel_tech.json rename to src/main/resources/data/baseelectric/recipe/power_supply_unit_plate_steel_tech.json diff --git a/src/main/resources/data/baseelectric/recipes/power_supply_unit_steel_normal.json b/src/main/resources/data/baseelectric/recipe/power_supply_unit_steel_normal.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/power_supply_unit_steel_normal.json rename to src/main/resources/data/baseelectric/recipe/power_supply_unit_steel_normal.json diff --git a/src/main/resources/data/baseelectric/recipes/silicon_blend.json b/src/main/resources/data/baseelectric/recipe/silicon_blend.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/silicon_blend.json rename to src/main/resources/data/baseelectric/recipe/silicon_blend.json diff --git a/src/main/resources/data/baseelectric/recipes/silicon_ingot_from_blend.json b/src/main/resources/data/baseelectric/recipe/silicon_ingot_from_blend.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/silicon_ingot_from_blend.json rename to src/main/resources/data/baseelectric/recipe/silicon_ingot_from_blend.json diff --git a/src/main/resources/data/baseelectric/recipes/solder_blend_tin_lead.json b/src/main/resources/data/baseelectric/recipe/solder_blend_tin_lead.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/solder_blend_tin_lead.json rename to src/main/resources/data/baseelectric/recipe/solder_blend_tin_lead.json diff --git a/src/main/resources/data/baseelectric/recipes/solder_blend_tin_silver.json b/src/main/resources/data/baseelectric/recipe/solder_blend_tin_silver.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/solder_blend_tin_silver.json rename to src/main/resources/data/baseelectric/recipe/solder_blend_tin_silver.json diff --git a/src/main/resources/data/baseelectric/recipes/solder_from_blend.json b/src/main/resources/data/baseelectric/recipe/solder_from_blend.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/solder_from_blend.json rename to src/main/resources/data/baseelectric/recipe/solder_from_blend.json diff --git a/src/main/resources/data/baseelectric/recipes/steam_powered_generator.json b/src/main/resources/data/baseelectric/recipe/steam_powered_generator.json similarity index 100% rename from src/main/resources/data/baseelectric/recipes/steam_powered_generator.json rename to src/main/resources/data/baseelectric/recipe/steam_powered_generator.json diff --git a/src/main/resources/data/forge/tags/blocks/ores/lithium.json b/src/main/resources/data/forge/tags/block/ores/lithium.json similarity index 100% rename from src/main/resources/data/forge/tags/blocks/ores/lithium.json rename to src/main/resources/data/forge/tags/block/ores/lithium.json diff --git a/src/main/resources/data/forge/tags/blocks/ores/sulfur.json b/src/main/resources/data/forge/tags/block/ores/sulfur.json similarity index 100% rename from src/main/resources/data/forge/tags/blocks/ores/sulfur.json rename to src/main/resources/data/forge/tags/block/ores/sulfur.json diff --git a/src/main/resources/data/forge/tags/blocks/ores/sulphur.json b/src/main/resources/data/forge/tags/block/ores/sulphur.json similarity index 100% rename from src/main/resources/data/forge/tags/blocks/ores/sulphur.json rename to src/main/resources/data/forge/tags/block/ores/sulphur.json diff --git a/src/main/resources/data/forge/tags/items/circuit_boards.json b/src/main/resources/data/forge/tags/item/circuit_boards.json similarity index 100% rename from src/main/resources/data/forge/tags/items/circuit_boards.json rename to src/main/resources/data/forge/tags/item/circuit_boards.json diff --git a/src/main/resources/data/forge/tags/items/conduits/steam.json b/src/main/resources/data/forge/tags/item/conduits/steam.json similarity index 100% rename from src/main/resources/data/forge/tags/items/conduits/steam.json rename to src/main/resources/data/forge/tags/item/conduits/steam.json diff --git a/src/main/resources/data/forge/tags/items/dusts/carbon.json b/src/main/resources/data/forge/tags/item/dusts/carbon.json similarity index 100% rename from src/main/resources/data/forge/tags/items/dusts/carbon.json rename to src/main/resources/data/forge/tags/item/dusts/carbon.json diff --git a/src/main/resources/data/forge/tags/items/dusts/lithium.json b/src/main/resources/data/forge/tags/item/dusts/lithium.json similarity index 100% rename from src/main/resources/data/forge/tags/items/dusts/lithium.json rename to src/main/resources/data/forge/tags/item/dusts/lithium.json diff --git a/src/main/resources/data/forge/tags/items/dusts/sulfur.json b/src/main/resources/data/forge/tags/item/dusts/sulfur.json similarity index 100% rename from src/main/resources/data/forge/tags/items/dusts/sulfur.json rename to src/main/resources/data/forge/tags/item/dusts/sulfur.json diff --git a/src/main/resources/data/forge/tags/items/dusts/sulphur.json b/src/main/resources/data/forge/tags/item/dusts/sulphur.json similarity index 100% rename from src/main/resources/data/forge/tags/items/dusts/sulphur.json rename to src/main/resources/data/forge/tags/item/dusts/sulphur.json diff --git a/src/main/resources/data/forge/tags/items/glass_panes.json b/src/main/resources/data/forge/tags/item/glass_panes.json similarity index 100% rename from src/main/resources/data/forge/tags/items/glass_panes.json rename to src/main/resources/data/forge/tags/item/glass_panes.json diff --git a/src/main/resources/data/forge/tags/items/governors.json b/src/main/resources/data/forge/tags/item/governors.json similarity index 100% rename from src/main/resources/data/forge/tags/items/governors.json rename to src/main/resources/data/forge/tags/item/governors.json diff --git a/src/main/resources/data/forge/tags/items/ingots/lithium.json b/src/main/resources/data/forge/tags/item/ingots/lithium.json similarity index 100% rename from src/main/resources/data/forge/tags/items/ingots/lithium.json rename to src/main/resources/data/forge/tags/item/ingots/lithium.json diff --git a/src/main/resources/data/forge/tags/items/ingots/plastic.json b/src/main/resources/data/forge/tags/item/ingots/plastic.json similarity index 100% rename from src/main/resources/data/forge/tags/items/ingots/plastic.json rename to src/main/resources/data/forge/tags/item/ingots/plastic.json diff --git a/src/main/resources/data/forge/tags/items/ingots/silicon.json b/src/main/resources/data/forge/tags/item/ingots/silicon.json similarity index 100% rename from src/main/resources/data/forge/tags/items/ingots/silicon.json rename to src/main/resources/data/forge/tags/item/ingots/silicon.json diff --git a/src/main/resources/data/forge/tags/items/microchips.json b/src/main/resources/data/forge/tags/item/microchips.json similarity index 100% rename from src/main/resources/data/forge/tags/items/microchips.json rename to src/main/resources/data/forge/tags/item/microchips.json diff --git a/src/main/resources/data/forge/tags/items/nuggets/lithium.json b/src/main/resources/data/forge/tags/item/nuggets/lithium.json similarity index 100% rename from src/main/resources/data/forge/tags/items/nuggets/lithium.json rename to src/main/resources/data/forge/tags/item/nuggets/lithium.json diff --git a/src/main/resources/data/forge/tags/items/ores/lithium.json b/src/main/resources/data/forge/tags/item/ores/lithium.json similarity index 100% rename from src/main/resources/data/forge/tags/items/ores/lithium.json rename to src/main/resources/data/forge/tags/item/ores/lithium.json diff --git a/src/main/resources/data/forge/tags/items/ores/sulfur.json b/src/main/resources/data/forge/tags/item/ores/sulfur.json similarity index 100% rename from src/main/resources/data/forge/tags/items/ores/sulfur.json rename to src/main/resources/data/forge/tags/item/ores/sulfur.json diff --git a/src/main/resources/data/forge/tags/items/ores/sulphur.json b/src/main/resources/data/forge/tags/item/ores/sulphur.json similarity index 100% rename from src/main/resources/data/forge/tags/items/ores/sulphur.json rename to src/main/resources/data/forge/tags/item/ores/sulphur.json diff --git a/src/main/resources/data/forge/tags/items/plastic.json b/src/main/resources/data/forge/tags/item/plastic.json similarity index 100% rename from src/main/resources/data/forge/tags/items/plastic.json rename to src/main/resources/data/forge/tags/item/plastic.json diff --git a/src/main/resources/data/forge/tags/items/power_supply_units.json b/src/main/resources/data/forge/tags/item/power_supply_units.json similarity index 100% rename from src/main/resources/data/forge/tags/items/power_supply_units.json rename to src/main/resources/data/forge/tags/item/power_supply_units.json diff --git a/src/main/resources/data/forge/tags/items/rubber.json b/src/main/resources/data/forge/tags/item/rubber.json similarity index 100% rename from src/main/resources/data/forge/tags/items/rubber.json rename to src/main/resources/data/forge/tags/item/rubber.json diff --git a/src/main/resources/data/forge/tags/items/sand.json b/src/main/resources/data/forge/tags/item/sand.json similarity index 100% rename from src/main/resources/data/forge/tags/items/sand.json rename to src/main/resources/data/forge/tags/item/sand.json diff --git a/src/main/resources/data/forge/tags/items/solder.json b/src/main/resources/data/forge/tags/item/solder.json similarity index 100% rename from src/main/resources/data/forge/tags/items/solder.json rename to src/main/resources/data/forge/tags/item/solder.json diff --git a/src/main/resources/data/forge/tags/items/sulfur.json b/src/main/resources/data/forge/tags/item/sulfur.json similarity index 100% rename from src/main/resources/data/forge/tags/items/sulfur.json rename to src/main/resources/data/forge/tags/item/sulfur.json diff --git a/src/main/resources/data/forge/tags/items/sulphur.json b/src/main/resources/data/forge/tags/item/sulphur.json similarity index 100% rename from src/main/resources/data/forge/tags/items/sulphur.json rename to src/main/resources/data/forge/tags/item/sulphur.json diff --git a/src/main/resources/data/forge/tags/items/wires.json b/src/main/resources/data/forge/tags/item/wires.json similarity index 100% rename from src/main/resources/data/forge/tags/items/wires.json rename to src/main/resources/data/forge/tags/item/wires.json diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/main/resources/data/minecraft/tags/block/mineable/pickaxe.json similarity index 100% rename from src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json rename to src/main/resources/data/minecraft/tags/block/mineable/pickaxe.json diff --git a/src/main/resources/data/minecraft/tags/blocks/needs_stone_tool.json b/src/main/resources/data/minecraft/tags/block/needs_stone_tool.json similarity index 100% rename from src/main/resources/data/minecraft/tags/blocks/needs_stone_tool.json rename to src/main/resources/data/minecraft/tags/block/needs_stone_tool.json diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 68e6f8a4..cabf58ff 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,7 @@ { "pack":{ - "pack_format":32, - "supported_formats":{"min_inclusive":32,"max_inclusive":41}, + "pack_format":34, + "supported_formats":{"min_inclusive":34,"max_inclusive":48}, "description":"baseElectric" } } diff --git a/src/test/java/zone/moddev/mc/baseelectric/blocks/OreHarvestContractTest.java b/src/test/java/zone/moddev/mc/baseelectric/blocks/OreHarvestContractTest.java index 633623dd..30c5f1dc 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/blocks/OreHarvestContractTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/blocks/OreHarvestContractTest.java @@ -51,7 +51,7 @@ public class OreHarvestContractTest { private static void bindHarvestTags(Block block, String id) throws Exception { Set> tags = new HashSet<>(); for (TagKey tag : java.util.List.of(BlockTags.MINEABLE_WITH_PICKAXE, BlockTags.NEEDS_STONE_TOOL)) { - java.nio.file.Path path = java.nio.file.Paths.get("src/main/resources/data/minecraft/tags/blocks", + java.nio.file.Path path = java.nio.file.Paths.get("src/main/resources/data/minecraft/tags/block", tag.location().getPath() + ".json"); var json = com.google.gson.JsonParser.parseString(java.nio.file.Files.readString(path)).getAsJsonObject(); for (var value : json.getAsJsonArray("values")) { diff --git a/src/test/java/zone/moddev/mc/baseelectric/entities/ElectricOperationalHydroturbineAnchorTest.java b/src/test/java/zone/moddev/mc/baseelectric/entities/ElectricOperationalHydroturbineAnchorTest.java index f55c2fc5..3fe9e97f 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/entities/ElectricOperationalHydroturbineAnchorTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/entities/ElectricOperationalHydroturbineAnchorTest.java @@ -110,6 +110,6 @@ private static final class ControlEntity extends Entity { @Override protected void defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder) {} @Override protected void readAdditionalSaveData(CompoundTag tag) {} @Override protected void addAdditionalSaveData(CompoundTag tag) {} - @Override public Packet getAddEntityPacket() { return null; } + @Override public Packet getAddEntityPacket(net.minecraft.server.level.ServerEntity tracker) { return null; } } } diff --git a/src/test/java/zone/moddev/mc/baseelectric/entities/HydroturbinePersistenceTest.java b/src/test/java/zone/moddev/mc/baseelectric/entities/HydroturbinePersistenceTest.java index 4435ff47..c763e7f3 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/entities/HydroturbinePersistenceTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/entities/HydroturbinePersistenceTest.java @@ -1,5 +1,8 @@ package zone.moddev.mc.baseelectric.entities; +import zone.moddev.mc.baseelectric.verification.NativeMachineFixture; +import zone.moddev.mc.baseelectric.machines.HydroelectricGeneratorBlock; + import zone.moddev.mc.baseelectric.verification.NativeTestBootstrap; import java.lang.reflect.Field; import net.minecraft.nbt.CompoundTag; @@ -10,12 +13,14 @@ import static org.junit.Assert.*; public class HydroturbinePersistenceTest { + @org.junit.Rule public final NativeMachineFixture machines = + new NativeMachineFixture(); @org.junit.BeforeClass public static void bootstrap() { NativeTestBootstrap.initialize(); } @Test public void generatorGuiOutputIsNormalizedWithoutChangingGenerationRate() { - HydroelectricGeneratorTileEntity active = new HydroelectricGeneratorTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.HydroelectricGeneratorBlock().defaultBlockState()) { + HydroelectricGeneratorTileEntity active = new HydroelectricGeneratorTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(HydroelectricGeneratorBlock.class)) { @Override public boolean isActive() { return true; } }; - HydroelectricGeneratorTileEntity inactive = new HydroelectricGeneratorTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.HydroelectricGeneratorBlock().defaultBlockState()) { + HydroelectricGeneratorTileEntity inactive = new HydroelectricGeneratorTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(HydroelectricGeneratorBlock.class)) { @Override public boolean isActive() { return false; } }; assertEquals(1F, active.getPowerOutput(), 0F); @@ -49,7 +54,7 @@ public class HydroturbinePersistenceTest { @Test public void savesAttachedGeneratorUsingTheSameLegacyCoordinateKey() throws Exception { HydroturbineEntity turbine = withoutWorld(); - HydroelectricGeneratorTileEntity generator = new HydroelectricGeneratorTileEntity(new BlockPos(31, 72, -18), new zone.moddev.mc.baseelectric.machines.HydroelectricGeneratorBlock().defaultBlockState()); + HydroelectricGeneratorTileEntity generator = new HydroelectricGeneratorTileEntity(new BlockPos(31, 72, -18), NativeMachineFixture.state(HydroelectricGeneratorBlock.class)); turbine.parent = generator; CompoundTag saved = new CompoundTag(); turbine.addAdditionalSaveData(saved); diff --git a/src/test/java/zone/moddev/mc/baseelectric/graphics/RendererBufferContractTest.java b/src/test/java/zone/moddev/mc/baseelectric/graphics/RendererBufferContractTest.java index e15449aa..926ff6ab 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/graphics/RendererBufferContractTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/graphics/RendererBufferContractTest.java @@ -1,5 +1,8 @@ package zone.moddev.mc.baseelectric.graphics; +import zone.moddev.mc.baseelectric.verification.NativeMachineFixture; +import zone.moddev.mc.baseelectric.machines.ElectricDrillBlock; + import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import java.lang.reflect.Field; @@ -22,6 +25,8 @@ import static org.junit.Assert.*; public class RendererBufferContractTest { + @org.junit.Rule public final NativeMachineFixture machines = + new NativeMachineFixture(); private static final int FULL_BRIGHT = 15 << 20 | 15 << 4; @BeforeClass public static void bootstrapNativeRegistries() { @@ -51,7 +56,7 @@ public class RendererBufferContractTest { } @Test public void drillRetainsSixDirectionsSixteenVerticesAndLegacyUvs() throws Exception { - ElectricDrillTileEntity drill = new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.ElectricDrillBlock().defaultBlockState()); + ElectricDrillTileEntity drill = new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(ElectricDrillBlock.class)); set(ElectricDrillTileEntity.class, drill, "laserLength", 5); LaserDrillRenderer renderer = new LaserDrillRenderer(null); for (Direction direction : Direction.values()) { @@ -84,7 +89,7 @@ public class RendererBufferContractTest { PoseStack matrices = new PoseStack(); PoseStack.Pose before = matrices.last(); RecordingBuffer buffer = new RecordingBuffer(); - new LaserDrillRenderer(null).render(new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.ElectricDrillBlock().defaultBlockState()), 0, matrices, buffer, 0, 0); + new LaserDrillRenderer(null).render(new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(ElectricDrillBlock.class)), 0, matrices, buffer, 0, 0); assertSame(before, matrices.last()); assertTrue(matrices.clear()); assertTrue(buffer.vertices.isEmpty()); @@ -179,21 +184,19 @@ private static final class Vertex { } private static final class RecordingBuffer implements VertexConsumer, MultiBufferSource { - @Override public void defaultColor(int red, int green, int blue, int alpha) { - throw new AssertionError("Renderer must emit explicit per-vertex colors"); - } - @Override public void unsetDefaultColor() { - throw new AssertionError("Renderer must not mutate shared default-color state"); - } final List vertices = new ArrayList<>(); Vertex vertex = new Vertex(); @Override public VertexConsumer getBuffer(RenderType type) { return this; } - @Override public VertexConsumer vertex(double x, double y, double z) { vertex.position = new float[] {(float) x, (float) y, (float) z}; return this; } - @Override public VertexConsumer color(int r, int g, int b, int a) { vertex.color = new int[] {r, g, b, a}; return this; } - @Override public VertexConsumer uv(float u, float v) { vertex.uv = new float[] {u, v}; return this; } - @Override public VertexConsumer overlayCoords(int u, int v) { vertex.overlay = u | v << 16; return this; } - @Override public VertexConsumer uv2(int u, int v) { vertex.light = u | v << 16; return this; } - @Override public VertexConsumer normal(float x, float y, float z) { vertex.normal = new float[] {x, y, z}; return this; } - @Override public void endVertex() { vertices.add(vertex); vertex = new Vertex(); } + @Override public VertexConsumer addVertex(float x, float y, float z) { + vertex = new Vertex(); + vertex.position = new float[] {x, y, z}; + vertices.add(vertex); + return this; + } + @Override public VertexConsumer setColor(int r, int g, int b, int a) { vertex.color = new int[] {r, g, b, a}; return this; } + @Override public VertexConsumer setUv(float u, float v) { vertex.uv = new float[] {u, v}; return this; } + @Override public VertexConsumer setUv1(int u, int v) { vertex.overlay = u | v << 16; return this; } + @Override public VertexConsumer setUv2(int u, int v) { vertex.light = u | v << 16; return this; } + @Override public VertexConsumer setNormal(float x, float y, float z) { vertex.normal = new float[] {x, y, z}; return this; } } } diff --git a/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricDrillPersistenceTest.java b/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricDrillPersistenceTest.java index 8d31d330..7360f001 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricDrillPersistenceTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricDrillPersistenceTest.java @@ -1,5 +1,7 @@ package zone.moddev.mc.baseelectric.machines; +import zone.moddev.mc.baseelectric.verification.NativeMachineFixture; + import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.core.Direction; @@ -19,17 +21,19 @@ import static org.junit.Assert.assertEquals; public class ElectricDrillPersistenceTest { + @org.junit.Rule public final NativeMachineFixture machines = + new NativeMachineFixture(); @BeforeClass public static void bootstrapNativeRegistries() { NativeTestBootstrap.initialize(); } @Test public void retainsLegacyProgressUntilWorldIsAttached() { - ElectricDrillTileEntity drill = new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.ElectricDrillBlock().defaultBlockState()); + ElectricDrillTileEntity drill = new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(ElectricDrillBlock.class)); drill.loadWithComponents(target(94), NativeTestBootstrap.registries()); drill.prepareDataFieldsForSync(); assertEquals(94, drill.getDataFieldArray()[1]); } @Test public void clearsPreviousProgressOnReadingAnUntargetedTile() { - ElectricDrillTileEntity drill = new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.ElectricDrillBlock().defaultBlockState()); + ElectricDrillTileEntity drill = new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(ElectricDrillBlock.class)); drill.loadWithComponents(target(94), NativeTestBootstrap.registries()); drill.loadWithComponents(new CompoundTag(), NativeTestBootstrap.registries()); drill.prepareDataFieldsForSync(); @@ -44,7 +48,7 @@ public class ElectricDrillPersistenceTest { for (int i = 0; i < 9; i++) states.add(state.copy()); source.put("TargetStates", states); for (int pass = 0; pass < 3; pass++) { - ElectricDrillTileEntity drill = new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.ElectricDrillBlock().defaultBlockState()); + ElectricDrillTileEntity drill = new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(ElectricDrillBlock.class)); drill.loadFrom(source); CompoundTag saved = new CompoundTag(); drill.saveTo(saved); @@ -54,7 +58,7 @@ public class ElectricDrillPersistenceTest { } @Test public void targetPlaneRemainsNineUniqueBlocksForEveryDrillDirection() throws Exception { - ElectricDrillTileEntity drill = new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.ElectricDrillBlock().defaultBlockState()); + ElectricDrillTileEntity drill = new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(ElectricDrillBlock.class)); Field facing = ElectricDrillTileEntity.class.getDeclaredField("facingCache"); facing.setAccessible(true); Method area = ElectricDrillTileEntity.class.getDeclaredMethod("getArea", BlockPos.class); @@ -76,7 +80,7 @@ public class ElectricDrillPersistenceTest { } @Test public void nativeDataFieldsRetainEnergyAndMiningProgress() { - ElectricDrillTileEntity drill = new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.ElectricDrillBlock().defaultBlockState()); + ElectricDrillTileEntity drill = new ElectricDrillTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(ElectricDrillBlock.class)); drill.loadWithComponents(target(94), NativeTestBootstrap.registries()); drill.setEnergy(416.0F, drill.getEnergyType()); drill.prepareDataFieldsForSync(); diff --git a/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalNativeDefectsTest.java b/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalNativeDefectsTest.java index 6d5757be..44d03a15 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalNativeDefectsTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalNativeDefectsTest.java @@ -1,5 +1,7 @@ package zone.moddev.mc.baseelectric.machines; +import zone.moddev.mc.baseelectric.verification.NativeMachineFixture; + import cyano.poweradvantage.api.fluid.FluidStack; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -22,6 +24,8 @@ /** Focused regressions for retained independent native operating failures. */ public class ElectricOperationalNativeDefectsTest { + @org.junit.Rule public final NativeMachineFixture machines = + new NativeMachineFixture(); @BeforeClass public static void bootstrap() { NativeTestBootstrap.initialize(); } @Test public void controllerCannotRequestMoreThanItsHundredUnitElectricalBuffer() throws Exception { @@ -89,7 +93,7 @@ public class ElectricOperationalNativeDefectsTest { } private static GrowthChamberControllerTileEntity controller() throws Exception { - GrowthChamberControllerTileEntity controller = new GrowthChamberControllerTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.GrowthChamberControllerBlock().defaultBlockState()); + GrowthChamberControllerTileEntity controller = new GrowthChamberControllerTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(GrowthChamberControllerBlock.class)); controller.setSoil(1000); controller.getTank().setFluid(new FluidStack(Fluids.WATER, 1800)); Field redstone = GrowthChamberControllerTileEntity.class.getDeclaredField("redstone"); @@ -140,7 +144,7 @@ private BeamWorld() { } private static final class StubTurret extends LaserTurretTileEntity { - StubTurret(BlockPos pos) { super(pos, new LaserTurretBlock(false).defaultBlockState()); } + StubTurret(BlockPos pos) { super(pos, NativeMachineFixture.state(LaserTurretBlock.class)); } Level testWorld; @Override public Level getLevel() { return testWorld; } } diff --git a/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalPumpPickupTest.java b/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalPumpPickupTest.java index 1ad31dca..b6fe45e8 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalPumpPickupTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalPumpPickupTest.java @@ -1,5 +1,7 @@ package zone.moddev.mc.baseelectric.machines; +import zone.moddev.mc.baseelectric.verification.NativeMachineFixture; + import cyano.poweradvantage.api.fluid.FluidStack; import java.lang.reflect.Field; import java.util.Collections; @@ -36,6 +38,8 @@ /** Focused pickup transitions; the independent rig covers natural server ticks. */ public class ElectricOperationalPumpPickupTest { + @org.junit.Rule public final NativeMachineFixture machines = + new NativeMachineFixture(); private static final BlockPos PUMP = new BlockPos(8, 84, 8); private static final BlockPos SOURCE = PUMP.below().north(); private static final float RESERVE = 8000; @@ -166,7 +170,7 @@ private static T withoutConstructor(Class type) throws Exception { } private static final class StubPump extends ElectricPumpTileEntity { - StubPump() { super(PUMP, new ElectricPumpBlock().defaultBlockState()); } + StubPump() { super(PUMP, NativeMachineFixture.state(ElectricPumpBlock.class)); } PumpWorld testWorld; int sounds; @Override public Level getLevel() { return testWorld; } diff --git a/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalRedstoneCacheTest.java b/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalRedstoneCacheTest.java index 6a75ca07..f740cc5d 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalRedstoneCacheTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalRedstoneCacheTest.java @@ -1,5 +1,7 @@ package zone.moddev.mc.baseelectric.machines; +import zone.moddev.mc.baseelectric.verification.NativeMachineFixture; + import cyano.poweradvantage.api.PoweredEntity; import java.lang.reflect.Field; import java.util.ArrayList; @@ -17,6 +19,8 @@ /** Initial interlock sampling must not turn the ordinary cache into per-tick polling. */ public class ElectricOperationalRedstoneCacheTest { + @org.junit.Rule public final NativeMachineFixture machines = + new NativeMachineFixture(); private static final BlockPos EVEN = new BlockPos(8, 80, 8); private static final BlockPos ODD = new BlockPos(9, 81, 9); @@ -121,7 +125,7 @@ private static SignalWorld world(BlockPos position, boolean signalled) throws Ex } private static final class ProbeMachine extends ElectricOvenTileEntity { - ProbeMachine(BlockPos pos) { super(pos, new ElectricOvenBlock().defaultBlockState()); } + ProbeMachine(BlockPos pos) { super(pos, NativeMachineFixture.state(ElectricOvenBlock.class)); } SignalWorld testWorld; boolean observed; int powerUpdates; @@ -189,7 +193,7 @@ private static ProbeGenerator generatorFixture(boolean signalled) throws Excepti } private static final class ProbeGenerator extends PhotovoltaicGeneratorTileEntity { - ProbeGenerator() { super(EVEN, new PhotovoltaicGeneratorBlock().defaultBlockState()); } + ProbeGenerator() { super(EVEN, NativeMachineFixture.state(PhotovoltaicGeneratorBlock.class)); } SignalWorld testWorld; boolean signal() { return hasRedstoneSignal(); } @Override public Level getLevel() { return testWorld; } diff --git a/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalSoundBroadcastTest.java b/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalSoundBroadcastTest.java index 8ce947ee..d8e8b9c1 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalSoundBroadcastTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalSoundBroadcastTest.java @@ -1,5 +1,7 @@ package zone.moddev.mc.baseelectric.machines; +import zone.moddev.mc.baseelectric.verification.NativeMachineFixture; + import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Collections; @@ -22,11 +24,13 @@ /** Real broadcast methods with an explicit player list and forbidden chunk-backed entity queries. */ public class ElectricOperationalSoundBroadcastTest { + @org.junit.Rule public final NativeMachineFixture machines = + new NativeMachineFixture(); @BeforeClass public static void bootstrap() { NativeTestBootstrap.initialize(); } @Test public void machineBroadcastUsesOnlyExistingIntersectingConnectedPlayers() throws Exception { QueryRejectingWorld world = fixture(); - ElectricOvenTileEntity machine = new ElectricOvenTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.ElectricOvenBlock().defaultBlockState()) { + ElectricOvenTileEntity machine = new ElectricOvenTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(ElectricOvenBlock.class)) { @Override public Level getLevel() { return world; } }; machine.playSoundEffect(100, 80, -20, SoundEvents.ANVIL_LAND, 0.25f, 0.75f); @@ -35,7 +39,7 @@ public class ElectricOperationalSoundBroadcastTest { @Test public void generatorBroadcastUsesOnlyExistingIntersectingConnectedPlayers() throws Exception { QueryRejectingWorld world = fixture(); - PhotovoltaicGeneratorTileEntity generator = new PhotovoltaicGeneratorTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.PhotovoltaicGeneratorBlock().defaultBlockState()) { + PhotovoltaicGeneratorTileEntity generator = new PhotovoltaicGeneratorTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(PhotovoltaicGeneratorBlock.class)) { @Override public Level getLevel() { return world; } }; generator.playSoundEffect(100, 80, -20, SoundEvents.ANVIL_LAND, 0.25f, 0.75f); @@ -45,7 +49,7 @@ public class ElectricOperationalSoundBroadcastTest { @Test public void emptyPlayerListNeverQueriesChunks() throws Exception { QueryRejectingWorld world = withoutConstructor(QueryRejectingWorld.class); world.existingPlayers = Collections.emptyList(); - ElectricOvenTileEntity machine = new ElectricOvenTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.ElectricOvenBlock().defaultBlockState()) { + ElectricOvenTileEntity machine = new ElectricOvenTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(ElectricOvenBlock.class)) { @Override public Level getLevel() { return world; } }; machine.playSoundEffect(50000, 82, 50000, SoundEvents.ANVIL_LAND, 1, 1); diff --git a/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalStillCapacityTest.java b/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalStillCapacityTest.java index dd86839e..9044b7cb 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalStillCapacityTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/machines/ElectricOperationalStillCapacityTest.java @@ -1,5 +1,7 @@ package zone.moddev.mc.baseelectric.machines; +import zone.moddev.mc.baseelectric.verification.NativeMachineFixture; + import cyano.poweradvantage.api.fluid.FluidStack; import java.lang.reflect.Method; import net.minecraft.world.level.material.Fluids; @@ -13,6 +15,8 @@ /** Capacity preflight tests; the shared rig separately tests natural machine ticks. */ public class ElectricOperationalStillCapacityTest { + @org.junit.Rule public final NativeMachineFixture machines = + new NativeMachineFixture(); @BeforeClass public static void bootstrap() { NativeTestBootstrap.initialize(); } @Test public void aFullTankCannotConsumeInput() throws Exception { @@ -52,7 +56,7 @@ public class ElectricOperationalStillCapacityTest { } private static ElectricStillTileEntity fixture(int output) { - ElectricStillTileEntity still = new ElectricStillTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.ElectricStillBlock().defaultBlockState()); + ElectricStillTileEntity still = new ElectricStillTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(ElectricStillBlock.class)); still.getInputTank().setFluid(new FluidStack(Fluids.WATER, 4)); if (output > 0) still.getOutputTank().setFluid(new FluidStack(Fluids.LAVA, output)); return still; diff --git a/src/test/java/zone/moddev/mc/baseelectric/machines/GrowthChamberPersistenceTest.java b/src/test/java/zone/moddev/mc/baseelectric/machines/GrowthChamberPersistenceTest.java index 22304002..becd4d25 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/machines/GrowthChamberPersistenceTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/machines/GrowthChamberPersistenceTest.java @@ -1,18 +1,22 @@ package zone.moddev.mc.baseelectric.machines; +import zone.moddev.mc.baseelectric.verification.NativeMachineFixture; + import zone.moddev.mc.baseelectric.verification.NativeTestBootstrap; import net.minecraft.nbt.CompoundTag; import org.junit.Test; import static org.junit.Assert.*; public class GrowthChamberPersistenceTest { + @org.junit.Rule public final NativeMachineFixture machines = + new NativeMachineFixture(); @org.junit.BeforeClass public static void bootstrap() { NativeTestBootstrap.initialize(); } @Test public void legacyGrowthAndProgressSurviveReadSaveBeforeWorldAttachment() { CompoundTag source = new CompoundTag(); source.putByteArray("growth", new byte[] {2, 4, 6}); source.putIntArray("prog", new int[] {245, 468, 627}); for (int pass = 0; pass < 3; pass++) { - GrowthChamberTileEntity chamber = new GrowthChamberTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.GrowthChamberBlock().defaultBlockState()); + GrowthChamberTileEntity chamber = new GrowthChamberTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(GrowthChamberBlock.class)); chamber.loadWithComponents(source, NativeTestBootstrap.registries()); CompoundTag saved = chamber.saveWithoutMetadata(NativeTestBootstrap.registries()); assertArrayEquals(new byte[] {2, 4, 6}, saved.getByteArray("growth")); @@ -22,7 +26,7 @@ public class GrowthChamberPersistenceTest { } @Test public void shortArraysArePaddedAndNewNbtClearsOldPendingWork() { - GrowthChamberTileEntity chamber = new GrowthChamberTileEntity(net.minecraft.core.BlockPos.ZERO, new zone.moddev.mc.baseelectric.machines.GrowthChamberBlock().defaultBlockState()); + GrowthChamberTileEntity chamber = new GrowthChamberTileEntity(net.minecraft.core.BlockPos.ZERO, NativeMachineFixture.state(GrowthChamberBlock.class)); CompoundTag source = new CompoundTag(); source.putByteArray("growth", new byte[] {2}); source.putIntArray("prog", new int[] {245}); diff --git a/src/test/java/zone/moddev/mc/baseelectric/machines/Native118ConstructionTest.java b/src/test/java/zone/moddev/mc/baseelectric/machines/Native118ConstructionTest.java index 359803c0..eaeeeda3 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/machines/Native118ConstructionTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/machines/Native118ConstructionTest.java @@ -1,5 +1,7 @@ package zone.moddev.mc.baseelectric.machines; +import zone.moddev.mc.baseelectric.verification.NativeMachineFixture; + import net.minecraft.core.BlockPos; import net.minecraft.core.RegistryAccess; import net.minecraft.nbt.CompoundTag; @@ -15,16 +17,20 @@ import static org.junit.Assert.*; public class Native118ConstructionTest { + @org.junit.Rule public final NativeMachineFixture machines = + new NativeMachineFixture(); @BeforeClass public static void bootstrap() { NativeTestBootstrap.initialize(); } @Test public void everyFactoryPreservesItsNativePositionAndState() { BlockPos pos = new BlockPos(-117, 83, 4917); + assertEquals(17, blocks().length); for (Block block : blocks()) { BlockState state = block.defaultBlockState(); BlockEntity tile = ((EntityBlock) block).newBlockEntity(pos, state); assertNotNull(block.getClass().getName(), tile); assertEquals(pos, tile.getBlockPos()); assertSame(state, tile.getBlockState()); + assertTrue(tile.getType().isValid(state)); CompoundTag saved = new CompoundTag(); saved.putInt("x", 0); saved.putInt("y", 1); saved.putInt("z", 2); tile.loadWithComponents(saved, NativeTestBootstrap.registries()); @@ -85,11 +91,6 @@ private PacketWorld() { } private static Block[] blocks() { - return new Block[]{new ElectricFurnaceBlock(), new ElectricCrusherBlock(), new ElectricDrillBlock(), - new ElectricFabricatorBlock(), new GrowthChamberBlock(), new GrowthChamberControllerBlock(), - new ElectricOvenBlock(), new LaserTurretBlock(false), new LaserTurretBlock(true), new LEDBlock(), - new HydroelectricGeneratorBlock(), new PhotovoltaicGeneratorBlock(), - new SteamPoweredElectricGeneratorBlock(), new ElectricBatteryArrayBlock(), - new ElectricPumpBlock(), new ElectricStillBlock(), new PlasticRefineryBlock()}; + return NativeMachineFixture.blocks(); } } diff --git a/src/test/java/zone/moddev/mc/baseelectric/resources/BaseMetalsRawRecipeContractTest.java b/src/test/java/zone/moddev/mc/baseelectric/resources/BaseMetalsRawRecipeContractTest.java index 0b38880d..479b397f 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/resources/BaseMetalsRawRecipeContractTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/resources/BaseMetalsRawRecipeContractTest.java @@ -14,7 +14,7 @@ public class BaseMetalsRawRecipeContractTest { @Test public void nativeCrushingRecipesKeepRawAndOreOutputsDistinct() throws Exception { for (String metal : new String[]{"copper", "iron", "gold"}) { for (String input : new String[]{"ore", "raw"}) { - String path = "/data/basemetals/recipes/" + metal + "_" + input + "_crushing.json"; + String path = "/data/basemetals/recipe/" + metal + "_" + input + "_crushing.json"; try (InputStream stream = getClass().getResourceAsStream(path)) { assertNotNull(path, stream); JsonObject recipe = new JsonParser().parse(new InputStreamReader(stream, StandardCharsets.UTF_8)).getAsJsonObject(); diff --git a/src/test/java/zone/moddev/mc/baseelectric/resources/BlockLootResourceTest.java b/src/test/java/zone/moddev/mc/baseelectric/resources/BlockLootResourceTest.java index fdce5c00..3743ca10 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/resources/BlockLootResourceTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/resources/BlockLootResourceTest.java @@ -12,7 +12,7 @@ public class BlockLootResourceTest { @Test public void everyOrdinaryBlockKeepsItsOwnNativeItemDrop() throws Exception { - Path root = Paths.get("src/main/resources/data/baseelectric/loot_tables/blocks"); + Path root = Paths.get("src/main/resources/data/baseelectric/loot_table/blocks"); try (Stream states = Files.list(Paths.get("src/main/resources/assets/baseelectric/blockstates"))) { for (Path state : (Iterable) states.filter(path -> path.toString().endsWith(".json"))::iterator) { String id = state.getFileName().toString().replace(".json", ""); @@ -35,10 +35,10 @@ public class BlockLootResourceTest { @Test public void resourcePackDeclaresTheNativeOneTwentyOneFormat() throws Exception { JsonObject pack = read(Paths.get("src/main/resources/pack.mcmeta")).getAsJsonObject("pack"); - assertEquals(32, pack.get("pack_format").getAsInt()); + assertEquals(34, pack.get("pack_format").getAsInt()); JsonObject formats = pack.getAsJsonObject("supported_formats"); - assertEquals(32, formats.get("min_inclusive").getAsInt()); - assertEquals(41, formats.get("max_inclusive").getAsInt()); + assertEquals(34, formats.get("min_inclusive").getAsInt()); + assertEquals(48, formats.get("max_inclusive").getAsInt()); assertFalse(pack.has("forge:server_data_pack_format")); } diff --git a/src/test/java/zone/moddev/mc/baseelectric/resources/BuildWorkflowContractTest.java b/src/test/java/zone/moddev/mc/baseelectric/resources/BuildWorkflowContractTest.java index c5b17aa6..91e6bc54 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/resources/BuildWorkflowContractTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/resources/BuildWorkflowContractTest.java @@ -42,8 +42,8 @@ public class BuildWorkflowContractTest { } assertTrue(source.contains("ref: ${{ steps.public-pins.outputs.orespawn_ref }}")); assertTrue(source.contains("ref: ${{ steps.public-pins.outputs.power_ref }}")); - assertTrue(source.contains("branches: [master-1.20.6")); - assertTrue(source.contains("-Pforge50MavenizerJar=$MAVENIZER")); + assertTrue(source.contains("branches: [master-1.21.1")); + assertTrue(source.contains("-Pforge52MavenizerJar=$MAVENIZER")); assertTrue(source.contains("-PpowerAdvantageDeobfJar=$POWER_PLAYER")); assertFalse(source.contains("forge47")); if (workflow.equals("ci.yml")) { @@ -56,5 +56,9 @@ public class BuildWorkflowContractTest { assertTrue(script.contains("$(value " + dependency + "_public_file_id)")); } assertTrue(script.contains("sha256sum -c -")); + assertTrue(script.contains("$(value poweradvantage_pin_state)")); + assertTrue(script.contains("!= 'MERGED_SOURCE'")); + assertTrue(script.indexOf("!= 'MERGED_SOURCE'") < script.indexOf("require_merged()")); + assertTrue(script.contains("_public_file_id\")\"")); } } diff --git a/src/test/java/zone/moddev/mc/baseelectric/resources/DatapackLayoutTest.java b/src/test/java/zone/moddev/mc/baseelectric/resources/DatapackLayoutTest.java new file mode 100644 index 00000000..cd891394 --- /dev/null +++ b/src/test/java/zone/moddev/mc/baseelectric/resources/DatapackLayoutTest.java @@ -0,0 +1,36 @@ +package zone.moddev.mc.baseelectric.resources; + +import java.nio.file.Files; +import java.nio.file.Path; +import org.junit.Test; +import static org.junit.Assert.*; + +public class DatapackLayoutTest { + @Test public void onlyRegistryDirectoriesBecomeSingular() throws Exception { + Path data = Path.of("src/main/resources/data"); + try (var namespaces = Files.list(data)) { + for (Path namespace : namespaces.toList()) { + for (String obsolete : new String[] {"recipes", "advancements", "loot_tables", "structures", + "tags/items", "tags/blocks"}) { + Path old = namespace.resolve(obsolete); + if (Files.exists(old)) try (var files = Files.walk(old)) { + assertFalse(old.toString(), files.anyMatch(Files::isRegularFile)); + } + } + } + } + assertTrue(Files.isRegularFile(data.resolve("baseelectric/advancement/recipes/alkaline_battery.json"))); + assertTrue(Files.isRegularFile(data.resolve("baseelectric/loot_table/blocks/electric_drill.json"))); + assertTrue(Files.isRegularFile(data.resolve("forge/tags/item/ores/sulphur.json"))); + assertTrue(Files.isRegularFile(data.resolve("forge/tags/block/ores/sulphur.json"))); + } + + @Test public void pumpHelperHasNoLootAndRemovesItsColumnWithoutDrops() throws Exception { + Path resources = Path.of("src/main/resources"); + assertFalse(Files.exists(resources.resolve("data/baseelectric/loot_table/blocks/pump_pipe_electric.json"))); + String block = Files.readString(Path.of("src/main/java/zone/moddev/mc/baseelectric/blocks/PumpPipeBlock.java")); + assertTrue(block.contains("noLootTable()")); + assertTrue(block.contains("world.setBlock(cursor, net.minecraft.world.level.block.Blocks.AIR.defaultBlockState(), 3)")); + assertFalse(block.contains("destroyBlock(")); + } +} diff --git a/src/test/java/zone/moddev/mc/baseelectric/resources/RecipeResourceTest.java b/src/test/java/zone/moddev/mc/baseelectric/resources/RecipeResourceTest.java index 064f505a..71d393c3 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/resources/RecipeResourceTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/resources/RecipeResourceTest.java @@ -19,7 +19,7 @@ public class RecipeResourceTest { @Test public void allRecipesUseTheNativeOneFifteenDataPackLocationAndSerializers() throws IOException { - Path recipes = Paths.get("src/main/resources/data/baseelectric/recipes"); + Path recipes = Paths.get("src/main/resources/data/baseelectric/recipe"); List files; try (Stream stream = Files.list(recipes)) { files = stream.filter(path -> path.toString().endsWith(".json")) @@ -31,8 +31,8 @@ public class RecipeResourceTest { String text = new String(Files.readAllBytes(file), StandardCharsets.UTF_8); JsonObject json = new JsonParser().parse(text).getAsJsonObject(); String type = json.get("type").getAsString(); - assertTrue(file + " must use the 1.20.6 result stack codec", json.getAsJsonObject("result").has("id")); - assertFalse(file + " still has pre-1.20.6 Forge conditions", json.has("conditions")); + assertTrue(file + " must use the 1.21.1 result stack codec", json.getAsJsonObject("result").has("id")); + assertFalse(file + " still has pre-1.21.1 Forge conditions", json.has("conditions")); assertTrue(file + " has unsupported serializer " + type, "minecraft:crafting_shaped".equals(type) || "minecraft:crafting_shapeless".equals(type) diff --git a/src/test/java/zone/moddev/mc/baseelectric/resources/RecipeUnlockContractTest.java b/src/test/java/zone/moddev/mc/baseelectric/resources/RecipeUnlockContractTest.java index 26dbaba0..57297209 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/resources/RecipeUnlockContractTest.java +++ b/src/test/java/zone/moddev/mc/baseelectric/resources/RecipeUnlockContractTest.java @@ -32,20 +32,20 @@ public class RecipeUnlockContractTest { @Test public void everyCraftingRecipeHasExactlyOneUnlockAndProcessingHasNone() throws IOException { Set expected = new LinkedHashSet<>(); - for (Path file : files(DATA.resolve("recipes"))) { + for (Path file : files(DATA.resolve("recipe"))) { if (crafting(read(file))) expected.add(file.getFileName().toString()); } - Set actual = files(DATA.resolve("advancements/recipes")).stream() + Set actual = files(DATA.resolve("advancement/recipes")).stream() .map(file -> file.getFileName().toString()).collect(Collectors.toSet()); assertFalse("No crafting recipes found", expected.isEmpty()); assertEquals("Missing or orphaned recipe unlocks", expected, actual); } @Test public void discoveriesAreSingleIngredientAlternativesNotAnEntireCraftingGrid() throws IOException { - for (Path file : files(DATA.resolve("recipes"))) { + for (Path file : files(DATA.resolve("recipe"))) { JsonObject recipe = read(file); if (!crafting(recipe)) continue; - JsonObject unlock = read(DATA.resolve("advancements/recipes").resolve(file.getFileName())); + JsonObject unlock = read(DATA.resolve("advancement/recipes").resolve(file.getFileName())); assertEquals("minecraft:recipes/root", unlock.get("parent").getAsString()); assertFalse("Recipe unlocks should not create visible advancement tabs", unlock.has("display")); JsonObject criteria = unlock.getAsJsonObject("criteria"); @@ -104,7 +104,7 @@ public class RecipeUnlockContractTest { } @Test public void rewardAndRecipeCommandCriterionReferToTheExactVariant() throws IOException { - for (Path file : files(DATA.resolve("advancements/recipes"))) { + for (Path file : files(DATA.resolve("advancement/recipes"))) { String id = MOD + ":" + file.getFileName().toString().replace(".json", ""); JsonObject unlock = read(file); JsonArray recipes = unlock.getAsJsonObject("rewards").getAsJsonArray("recipes"); @@ -117,11 +117,11 @@ public class RecipeUnlockContractTest { assertFalse(unlock.has("conditions")); } assertTrue("The material-gated control must remain conditional", - read(DATA.resolve("recipes/alkaline_battery.json")).has("forge:condition")); + read(DATA.resolve("recipe/alkaline_battery.json")).has("forge:condition")); } @Test public void recipeBookGroupsIdentifyTheOutputNotABroadMachineCategory() throws IOException { - for (Path file : files(DATA.resolve("recipes"))) { + for (Path file : files(DATA.resolve("recipe"))) { JsonObject recipe = read(file); if (!crafting(recipe)) continue; JsonElement result = recipe.get("result"); diff --git a/src/test/java/zone/moddev/mc/baseelectric/verification/NativeMachineFixture.java b/src/test/java/zone/moddev/mc/baseelectric/verification/NativeMachineFixture.java new file mode 100644 index 00000000..68a9706c --- /dev/null +++ b/src/test/java/zone/moddev/mc/baseelectric/verification/NativeMachineFixture.java @@ -0,0 +1,85 @@ +package zone.moddev.mc.baseelectric.verification; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; +import java.util.LinkedHashMap; +import java.util.Map; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; +import zone.moddev.mc.baseelectric.init.Entities; +import zone.moddev.mc.baseelectric.machines.*; + +/** Real native type/state pairs, scoped to one worldless test invocation. */ +public final class NativeMachineFixture implements TestRule { + private static final ThreadLocal ACTIVE = new ThreadLocal<>(); + private final Map previous = new LinkedHashMap<>(); + private final Map, Block> blocks = new LinkedHashMap<>(); + private final List allBlocks = new ArrayList<>(); + + @Override public Statement apply(Statement test, Description description) { + return new Statement() { + @Override public void evaluate() throws Throwable { + if (ACTIVE.get() != null) throw new IllegalStateException("Nested machine fixture"); + ACTIVE.set(NativeMachineFixture.this); + try { + NativeTestBootstrap.initialize(); + install("ELECTRIC_FURNACE", ElectricFurnaceTileEntity::new, new ElectricFurnaceBlock()); + install("ELECTRIC_CRUSHER", ElectricCrusherTileEntity::new, new ElectricCrusherBlock()); + install("ELECTRIC_DRILL", ElectricDrillTileEntity::new, new ElectricDrillBlock()); + install("ELECTRIC_FABRICATOR", ElectricFabricatorTileEntity::new, new ElectricFabricatorBlock()); + install("GROWTH_CHAMBER", GrowthChamberTileEntity::new, new GrowthChamberBlock()); + install("GROWTH_CHAMBER_CONTROLLER", GrowthChamberControllerTileEntity::new, new GrowthChamberControllerBlock()); + install("ELECTRIC_OVEN", ElectricOvenTileEntity::new, new ElectricOvenBlock()); + install("LASER_TURRET", LaserTurretTileEntity::new, new LaserTurretBlock(false), new LaserTurretBlock(true)); + install("LED", LEDTileEntity::new, new LEDBlock()); + install("HYDROELECTRIC_GENERATOR", HydroelectricGeneratorTileEntity::new, new HydroelectricGeneratorBlock()); + install("PHOTOVOLTAIC_GENERATOR", PhotovoltaicGeneratorTileEntity::new, new PhotovoltaicGeneratorBlock()); + install("STEAM_POWERED_ELECTRIC_GENERATOR", SteamPoweredElectricGeneratorTileEntity::new, new SteamPoweredElectricGeneratorBlock()); + install("ELECTRIC_BATTERY_ARRAY", ElectricBatteryArrayTileEntity::new, new ElectricBatteryArrayBlock()); + install("ELECTRIC_PUMP", ElectricPumpTileEntity::new, new ElectricPumpBlock()); + install("ELECTRIC_STILL", ElectricStillTileEntity::new, new ElectricStillBlock()); + install("PLASTIC_REFINERY", PlasticRefineryTileEntity::new, new PlasticRefineryBlock()); + test.evaluate(); + } finally { + try { + for (var entry : previous.entrySet()) entry.getKey().set(null, entry.getValue()); + } finally { + previous.clear(); + blocks.clear(); + allBlocks.clear(); + ACTIVE.remove(); + } + } + } + }; + } + + private void install(String name, BlockEntityType.BlockEntitySupplier factory, + Block... validBlocks) throws ReflectiveOperationException { + Field field = Entities.class.getField(name); + previous.put(field, field.get(null)); + field.set(null, BlockEntityType.Builder.of(factory, validBlocks).build(null)); + for (Block block : validBlocks) blocks.putIfAbsent(block.getClass(), block); + allBlocks.addAll(List.of(validBlocks)); + } + + public static BlockState state(Class type) { + NativeMachineFixture fixture = ACTIVE.get(); + if (fixture == null || !fixture.blocks.containsKey(type)) { + throw new IllegalStateException("No native machine fixture for " + type.getName()); + } + return fixture.blocks.get(type).defaultBlockState(); + } + + public static Block[] blocks() { + NativeMachineFixture fixture = ACTIVE.get(); + if (fixture == null) throw new IllegalStateException("No native machine fixture"); + return fixture.allBlocks.toArray(Block[]::new); + } +} diff --git a/src/test/java/zone/moddev/mc/baseelectric/verification/NativeMachineFixtureTest.java b/src/test/java/zone/moddev/mc/baseelectric/verification/NativeMachineFixtureTest.java new file mode 100644 index 00000000..31442cac --- /dev/null +++ b/src/test/java/zone/moddev/mc/baseelectric/verification/NativeMachineFixtureTest.java @@ -0,0 +1,49 @@ +package zone.moddev.mc.baseelectric.verification; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.lang.reflect.Field; +import org.junit.Test; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; +import net.minecraft.core.BlockPos; +import zone.moddev.mc.baseelectric.init.Entities; +import zone.moddev.mc.baseelectric.machines.ElectricDrillBlock; +import zone.moddev.mc.baseelectric.machines.ElectricDrillTileEntity; +import static org.junit.Assert.*; + +public class NativeMachineFixtureTest { + @Test public void fixtureRestoresAllGlobalTypesEvenWhenTheTestFails() throws Throwable { + NativeTestBootstrap.initialize(); + Map before = new LinkedHashMap<>(); + for (Field field : Entities.class.getFields()) before.put(field, field.get(null)); + AssertionError expected = new AssertionError("fixture failure probe"); + var fixture = new NativeMachineFixture(); + try { + fixture.apply(new Statement() { + @Override public void evaluate() { + assertNotNull(Entities.ELECTRIC_DRILL); + assertTrue(Entities.ELECTRIC_DRILL.isValid(NativeMachineFixture.state(ElectricDrillBlock.class))); + throw expected; + } + }, Description.EMPTY).evaluate(); + fail("The fixture swallowed its test failure"); + } catch (AssertionError failure) { + assertSame(expected, failure); + } + for (var entry : before.entrySet()) assertSame(entry.getKey().getName(), entry.getValue(), entry.getKey().get(null)); + assertThrows(IllegalStateException.class, () -> NativeMachineFixture.state(ElectricDrillBlock.class)); + } + + @Test public void constructorStillRejectsAnInvalidNativeBlockState() throws Throwable { + new NativeMachineFixture().apply(new Statement() { + @Override public void evaluate() { + var state = NativeMachineFixture.state(ElectricDrillBlock.class); + assertSame(Entities.ELECTRIC_DRILL, new ElectricDrillTileEntity(BlockPos.ZERO, state).getType()); + assertFalse(Entities.ELECTRIC_DRILL.isValid(net.minecraft.world.level.block.Blocks.STONE.defaultBlockState())); + assertThrows(IllegalStateException.class, () -> new ElectricDrillTileEntity(BlockPos.ZERO, + net.minecraft.world.level.block.Blocks.STONE.defaultBlockState())); + } + }, Description.EMPTY).evaluate(); + } +} diff --git a/src/test/java/zone/moddev/mc/baseelectric/verification/NativeTestBootstrap.java b/src/test/java/zone/moddev/mc/baseelectric/verification/NativeTestBootstrap.java index db9f8621..40dfe507 100644 --- a/src/test/java/zone/moddev/mc/baseelectric/verification/NativeTestBootstrap.java +++ b/src/test/java/zone/moddev/mc/baseelectric/verification/NativeTestBootstrap.java @@ -33,8 +33,8 @@ private NativeTestBootstrap() {} public static synchronized void initialize() { if (ready) return; SharedConstants.tryDetectVersion(); - Bootstrap.bootStrap(); initializeEmptyModList(); + Bootstrap.bootStrap(); // The plain test JVM has no FML registration phase after vanilla bootstrap. GameData.unfreezeData(); ready = true; @@ -60,7 +60,7 @@ private static void initializeEmptyModList() { valid.setAccessible(true); valid.setBoolean(ModLoader.get(), true); } catch (ReflectiveOperationException failure) { - throw new IllegalStateException("Cannot prepare the Forge 50 worldless test context", failure); + throw new IllegalStateException("Cannot prepare the Forge 52 worldless test context", failure); } } diff --git a/tools/generate-recipe-unlocks.js b/tools/generate-recipe-unlocks.js index 19ee50bb..86642ddf 100644 --- a/tools/generate-recipe-unlocks.js +++ b/tools/generate-recipe-unlocks.js @@ -6,8 +6,8 @@ const root = path.resolve(__dirname, '..'); const properties = fs.readFileSync(path.join(root, 'gradle.properties'), 'utf8'); const mod = /^mod_id=(.+)$/m.exec(properties)[1].trim(); const data = path.join(root, 'src/main/resources/data', mod); -const recipes = path.join(data, 'recipes'); -const output = path.join(data, 'advancements/recipes'); +const recipes = path.join(data, 'recipe'); +const output = path.join(data, 'advancement/recipes'); const check = process.argv.includes('--check'); const ignored = new Set(['item:minecraft:stick', 'item:minecraft:string', 'item:minecraft:feather', 'tag:forge:rods/wooden']); diff --git a/tools/verification/Invoke-ElectricPackagedSmoke.ps1 b/tools/verification/Invoke-ElectricPackagedSmoke.ps1 index 46a09cf3..12e14879 100644 --- a/tools/verification/Invoke-ElectricPackagedSmoke.ps1 +++ b/tools/verification/Invoke-ElectricPackagedSmoke.ps1 @@ -30,7 +30,7 @@ $target = "$($pins.minecraft_version)-$($pins.forge_version)" $forgeDir = "libraries/net/minecraftforge/forge/$target" $winArgs = "$forgeDir/win_args.txt" $receipt = [ordered]@{ - status = 'FAIL'; scope = 'Packaged Forge 1.20.6 dedicated server and legacy inventory probe; no client or whole-world upgrade proof' + status = 'FAIL'; scope = 'Packaged Forge 1.21.1 dedicated server and legacy inventory probe; no client or whole-world upgrade proof' baseMetalsIncluded = !$WithoutBaseMetals seed = $seed; java = $javaPath; inputs = @(); checks = [ordered]@{}; exitCode = $null; error = $null } @@ -63,10 +63,10 @@ function Send-Command([string]$Command) { } try { - if ($target -cne '1.20.6-50.2.0' -or $pins.mod_version -cne '2.2.14.120061') { - throw 'This smoke runner is bound to baseElectric 2.2.14.120061 on Forge 50.2.0.' + if ($target -cne '1.21.1-52.1.0' -or $pins.mod_version -cne '2.2.15.121011') { + throw 'This smoke runner is bound to baseElectric 2.2.15.121011 on Forge 52.1.0.' } - if ($pins.poweradvantage_pin_state -ne 'MERGED_SOURCE' -or $PowerSha256 -ne $pins.poweradvantage_runtime_sha256) { + if ($pins.poweradvantage_pin_state -notin @('LOCAL_SOURCE', 'MERGED_SOURCE') -or $PowerSha256 -ne $pins.poweradvantage_runtime_sha256) { throw 'Packaged smoke requires the exact source-pinned basePower player JAR.' } $receipt.powerSourceRef = $pins.poweradvantage_source_ref @@ -78,7 +78,7 @@ try { $receipt.javaSha256 = (Get-FileHash -LiteralPath $javaPath).Hash $argsText = Get-Content -LiteralPath (Join-Path $seed $winArgs) -Raw $shim = "forge-$target-shim.jar" - if (!$argsText.Contains("-jar $shim")) { throw 'Unexpected Forge 50 server argument file.' } + if (!$argsText.Contains("-jar $shim")) { throw 'Unexpected Forge 52 server argument file.' } $receipt.shimSha256 = (Get-FileHash -LiteralPath (Join-Path $seed $shim)).Hash $receipt.seedArgumentsSha256 = (Get-FileHash -LiteralPath (Join-Path $seed $winArgs)).Hash $forgeUniversal = Join-Path $seed "$forgeDir/forge-$target-universal.jar" @@ -112,7 +112,7 @@ try { } [IO.File]::WriteAllLines((Join-Path $output 'server.properties'), @( 'server-ip=127.0.0.1', 'server-port=0', 'online-mode=false', 'enable-rcon=false', 'enable-query=false', - 'level-name=electric-smoke', 'level-seed=120061', 'generate-structures=false', + 'level-name=electric-smoke', 'level-seed=121011', 'generate-structures=false', 'view-distance=3', 'simulation-distance=3', 'spawn-protection=0' )) $start = [Diagnostics.ProcessStartInfo]::new($javaPath) diff --git a/tools/verification/Verify-ElectricEcj.ps1 b/tools/verification/Verify-ElectricEcj.ps1 index abff69f0..edc03009 100644 --- a/tools/verification/Verify-ElectricEcj.ps1 +++ b/tools/verification/Verify-ElectricEcj.ps1 @@ -2,7 +2,7 @@ param( [string]$ProjectRoot = (Join-Path $PSScriptRoot '../..'), [Parameter(Mandatory = $true)][string]$Evidence, [string]$Compiler = 'C:/Users/johnb/.p2/pool/plugins/org.eclipse.jdt.core.compiler.batch_3.46.0.v20260528-0407.jar', - [string]$Java17Home = 'C:/Users/johnb/.jdks/temurin-17.0.1+12/jdk-17.0.1+12' + [string]$Java21Home = 'C:/Users/johnb/.jdks/temurin-21.0.7+6' ) $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest @@ -30,7 +30,7 @@ function Test-ClassFiles([string]$Directory) { if ($bytes.Length -lt 8 -or $bytes[0] -ne 0xCA -or $bytes[1] -ne 0xFE -or $bytes[2] -ne 0xBA -or $bytes[3] -ne 0xBE) { throw "Invalid class file: $($file.FullName)" } - if (($bytes[6] * 256 + $bytes[7]) -ne 61) { throw "Non-Java-17 ECJ output: $($file.FullName)" } + if (($bytes[6] * 256 + $bytes[7]) -ne 65) { throw "Non-Java-21 ECJ output: $($file.FullName)" } } return $files.Count } @@ -38,15 +38,15 @@ function Invoke-Ecj([string]$Name, [string[]]$Sources, [string[]]$Libraries) { $output = Join-Path $Evidence $Name $null = New-Item -ItemType Directory -Path $output $xmlLog = Join-Path $Evidence "$Name.xml" - # Use the real Java 17 module image and keep forbidden/discouraged accesses fatal. - $arguments = @('-17', '-proc:none', '-encoding', 'UTF-8', '-err:+forbidden,discouraged', '--system', - ('"' + $Java17Home.Replace('\', '/') + '"'), '-classpath', + # Use the real Java 21 module image and keep forbidden/discouraged accesses fatal. + $arguments = @('-21', '-proc:none', '-encoding', 'UTF-8', '-err:+forbidden,discouraged', '--system', + ('"' + $Java21Home.Replace('\', '/') + '"'), '-classpath', ('"' + (($Libraries -replace '\\', '/') -join ';') + '"'), '-d', ('"' + $output.Replace('\', '/') + '"'), '-log', ('"' + $xmlLog.Replace('\', '/') + '"')) $arguments += @($Sources | ForEach-Object { '"' + $_.Replace('\', '/') + '"' }) $argFile = Join-Path $Evidence "$Name.args" [IO.File]::WriteAllLines($argFile, $arguments, [Text.UTF8Encoding]::new($false)) - & $java17 -Xmx2G -jar $Compiler "@$argFile" *> (Join-Path $Evidence "$Name-compile.log") + & $java21 -Xmx2G -jar $Compiler "@$argFile" *> (Join-Path $Evidence "$Name-compile.log") $exitCode = $LASTEXITCODE $entry = [ordered]@{ exitCode = $exitCode; sourceCount = $Sources.Count; output = $output; log = "$Name-compile.log" } $report.compilations[$Name] = $entry @@ -61,44 +61,37 @@ function Invoke-Ecj([string]$Name, [string[]]$Sources, [string[]]$Libraries) { } $report = [ordered]@{ status = 'RUNNING'; project = $ProjectRoot; evidence = $Evidence - scope = 'Pinned local baseElectric 1.20.1 candidate; fresh ECJ main/test/helper outputs and worldless Java 17 JUnit; no Gradle or Minecraft launch' + scope = 'Pinned local baseElectric 1.21.1 candidate; fresh ECJ main/test/helper outputs and worldless Java 21 JUnit; no Gradle or Minecraft launch' compiler = $null; toolchains = $null; libraries = @(); sources = @(); gradleInventory = @() - compilations = [ordered]@{}; junit = $null; negativeControl = $null; apiPinState = $null; capabilityBootstrap = $null } + compilations = [ordered]@{}; junit = $null; negativeControl = $null; apiPinState = $null } try { $properties = ConvertFrom-StringData -StringData (Get-Content -LiteralPath (Join-Path $ProjectRoot 'gradle.properties') -Raw) $report.apiPinState = $properties.poweradvantage_pin_state - if ($properties.mod_id -ne 'baseelectric' -or $properties.mod_version -ne '2.2.13.120011' -or - $properties.minecraft_version -ne '1.20.1' -or $properties.forge_version -ne '47.4.10' -or - $properties.poweradvantage_version -ne '2.4.12.120011' -or $properties.basemetals_version -ne '3.1.2.120011' -or - $properties.orespawn_version -ne '4.1.0.120011' -or - $properties.poweradvantage_pin_state -ne 'MERGED_SOURCE' -or + if ($properties.mod_id -ne 'baseelectric' -or $properties.mod_version -ne '2.2.15.121011' -or + $properties.minecraft_version -ne '1.21.1' -or $properties.forge_version -ne '52.1.0' -or + $properties.poweradvantage_version -ne '2.4.14.121011' -or $properties.basemetals_version -ne '3.1.2.121011' -or + $properties.orespawn_version -ne '4.1.0.121011' -or + $properties.poweradvantage_pin_state -notin @('LOCAL_SOURCE', 'MERGED_SOURCE') -or $properties.poweradvantage_source_ref -cnotmatch '^[a-f0-9]{40}$' -or $properties.poweradvantage_runtime_sha256 -cnotmatch '^[A-F0-9]{64}$' -or $properties.basemetals_source_commit -cnotmatch '^[a-f0-9]{40}$' -or $properties.poweradvantage_deobf_sha256 -cnotmatch '^[A-F0-9]{64}$' -or - $properties.poweradvantage_unit_bootstrap_sha256 -cnotmatch '^[A-F0-9]{64}$' -or - $properties.poweradvantage_unit_bootstrap_jar_sha256 -cnotmatch '^[A-F0-9]{64}$' -or $properties.basemetals_deobf_sha256 -cnotmatch '^[A-F0-9]{64}$' -or $properties.orespawn_deobf_sha256 -cnotmatch '^[A-F0-9]{64}$') { - throw 'This verifier requires the source-pinned baseElectric 1.20.1 inputs' + throw 'This verifier requires the source-pinned baseElectric 1.21.1 inputs' } $report.compiler = Get-Pin $Compiler if ($report.compiler.sha256 -ne 'D0D43F8E2D7003E5EFED612E2CBB5F01870043397D8F1BBE536FD9128F4FCBF7') { throw 'ECJ compiler pin mismatch' } - $java17 = Join-Path $Java17Home 'bin/java.exe' - $capabilityBootstrap = Join-Path $ProjectRoot 'build/unit-bootstrap/forge-native-unit-bootstrap.jar' - $report.capabilityBootstrap = Get-Pin $capabilityBootstrap - if ($report.capabilityBootstrap.sha256 -cne $properties.poweradvantage_unit_bootstrap_jar_sha256) { - throw 'The Eclipse-compiler run requires the same pinned basePower native unit agent as Gradle' - } - $report.toolchains = [ordered]@{ java = (Get-Pin $java17) - java17Release = (Get-Pin (Join-Path $Java17Home 'release')) - systemModules = (Get-Pin (Join-Path $Java17Home 'lib/modules')) } - if ((Get-Content -LiteralPath (Join-Path $Java17Home 'release') -Raw) -notmatch 'JAVA_VERSION="17\.0\.1"') { - throw 'ECJ production system image must be Java 17.0.1' + $java21 = Join-Path $Java21Home 'bin/java.exe' + $report.toolchains = [ordered]@{ java = (Get-Pin $java21) + java21Release = (Get-Pin (Join-Path $Java21Home 'release')) + systemModules = (Get-Pin (Join-Path $Java21Home 'lib/modules')) } + if ((Get-Content -LiteralPath (Join-Path $Java21Home 'release') -Raw) -notmatch 'JAVA_VERSION="21\.0\.7"') { + throw 'ECJ production system image must be Java 21.0.7' } $negativeSource = Join-Path $PSScriptRoot 'negative/RestrictedJdkReference.java' $negativeLog = Join-Path $Evidence 'restricted-jdk-negative.log' - & $java17 -jar $Compiler -17 -proc:none '-err:+forbidden,discouraged' --system $Java17Home ` + & $java21 -jar $Compiler -21 -proc:none '-err:+forbidden,discouraged' --system $Java21Home ` -d (Join-Path $Evidence 'negative') $negativeSource *> $negativeLog $negativeExit = $LASTEXITCODE $report.negativeControl = [ordered]@{ source = (Get-Pin $negativeSource); exitCode = $negativeExit @@ -144,9 +137,16 @@ try { $expected += [int]$inventory.testsuite.tests $report.gradleInventory += Get-Pin $xml.FullName } - if ($classes.Count -ne 27 -or $expected -ne 99 -or $sources.test.Count -ne 28 -or $sources.main.Count -ne 86) { throw 'Unexpected Electric 1.20.1 source/test inventory' } + if ($classes.Count -ne 31 -or $expected -ne 106 -or $sources.test.Count -ne 33 -or $sources.main.Count -ne 86) { throw 'Unexpected Electric 1.21.1 source/test inventory' } $main = Invoke-Ecj 'main' $sources.main $mainLibraries $test = Invoke-Ecj 'test' $sources.test (@($main) + $testLibraries) + $gameTests = @(Get-ChildItem -LiteralPath (Join-Path $ProjectRoot 'src/gametest/java') -Recurse -File -Filter '*.java' | ForEach-Object { $_.FullName }) + if ($gameTests.Count -ne 1) { throw 'Unexpected GameTest source inventory' } + $report.sources += @($gameTests | ForEach-Object { Get-Pin $_ }) + $null = Invoke-Ecj 'gametest' $gameTests (@($main) + $testLibraries) + $clientTests = @($sources.test | Where-Object { $_ -match '\\graphics\\|\\gui\\|\\ShaderResourceContractTest\.java$' }) + if ($clientTests.Count -ne 3) { throw 'Unexpected client-only contract inventory' } + $null = Invoke-Ecj 'client' $clientTests (@($main, $test) + $testLibraries) $helperSource = Join-Path $PSScriptRoot 'AuditedJUnit.java' $report.helper = Get-Pin $helperSource $helper = Invoke-Ecj 'helper' @($helperSource) $testLibraries @@ -155,7 +155,7 @@ try { $report.runtime = $runtime Push-Location $ProjectRoot try { - & $java17 "-javaagent:$capabilityBootstrap" -Xmx2G -cp ($runtime -join ';') zone.moddev.mc.baseelectric.verification.AuditedJUnit $junitXml $expected @classes *> (Join-Path $Evidence 'junit.log') + & $java21 -Xmx2G -cp ($runtime -join ';') zone.moddev.mc.baseelectric.verification.AuditedJUnit $junitXml $expected @classes *> (Join-Path $Evidence 'junit.log') $junitExit = $LASTEXITCODE } finally { Pop-Location } $report.junit = [ordered]@{ exitCode = $junitExit; expected = $expected; suites = $classes; log = 'junit.log'; xml = 'junit.xml' } @@ -163,7 +163,7 @@ try { [xml]$junit = Get-Content -LiteralPath $junitXml -Raw if ($junit.testsuite.passed -ne 'true' -or [int]$junit.testsuite.tests -ne $expected -or [int]$junit.testsuite.failures -or [int]$junit.testsuite.ignored -or [int]$junit.testsuite.assumptions) { throw 'Strict ECJ test counts failed' } - foreach ($pin in @($report.sources) + @($report.libraries) + @($report.helper) + @($report.negativeControl.source) + @($report.capabilityBootstrap)) { + foreach ($pin in @($report.sources) + @($report.libraries) + @($report.helper) + @($report.negativeControl.source)) { if ((Get-FileHash -LiteralPath $pin.path -Algorithm SHA256).Hash -ne $pin.sha256) { throw "Input changed during ECJ qualification: $($pin.path)" } } $report.status = 'PASS' @@ -173,4 +173,4 @@ try { throw } finally { Save-Report } Get-Content -LiteralPath (Join-Path $Evidence 'junit.log') -Tail 8 -Write-Output "ECJ PASS: $($sources.main.Count) main, $($sources.test.Count) test sources; $expected tests; Java 17 class files" +Write-Output "ECJ PASS: $($sources.main.Count) main, $($sources.test.Count) test sources; $expected tests; Java 21 class files" diff --git a/tools/verify-native-port.js b/tools/verify-native-port.js index 2c86ccba..c40bf0b9 100644 --- a/tools/verify-native-port.js +++ b/tools/verify-native-port.js @@ -5,7 +5,7 @@ const { execFileSync } = require('node:child_process'); const { createHash } = require('node:crypto'); const root = path.resolve(__dirname, '..'); -const baseline = '28dd438dde6898fcb6d6e1d17a62a4c0f527169e'; +const baseline = '8160dba30c5146ff50b8ce0c314085f965fb2964'; const legacyTrackBaseline = '013737d4cc41947e8b6fa42f4bf926a1fa5ab998'; const git = (...args) => execFileSync('git', args, { cwd: root }); const old = file => git('show', baseline + ':' + file); @@ -15,6 +15,14 @@ const sha256 = data => createHash('sha256').update(data).digest('hex'); const tracked = git('ls-tree', '-r', '--name-only', baseline, 'src').toString().trim().split('\n'); const javaRoot = 'src/main/java/zone/moddev/mc/baseelectric/'; const assets = 'src/main/resources/assets/baseelectric/'; +const relocated = file => file.replace(/(data\/[^/]+\/)recipes\//, '$1recipe/') + .replace(/(data\/[^/]+\/)advancements\//, '$1advancement/') + .replace(/(data\/[^/]+\/)loot_tables\//, '$1loot_table/') + .replace(/(data\/[^/]+\/tags\/)items\//, '$1item/') + .replace(/(data\/[^/]+\/tags\/)blocks\//, '$1block/'); +const nativeLocations = source => source.toString() + .replace(/new ResourceLocation\(\s*([\w.]+|"[^"]+"),/g, 'ResourceLocation.fromNamespaceAndPath($1,') + .replaceAll('new ResourceLocation(', 'ResourceLocation.parse('); const track = file => file.startsWith(assets + 'models/block/electric_track_') && file.endsWith('.json'); const checks = []; function check(name, run) { @@ -22,20 +30,24 @@ function check(name, run) { catch (error) { checks.push({name, pass: false, error: error.message}); } } -check('Exact Forge 50 and release identity', () => { +check('Exact Forge 52 and local port identity', () => { const props = Object.fromEntries(read('gradle.properties').toString().split(/\r?\n/) .filter(line => /^[a-z][a-z_\d]*=/.test(line)).map(line => line.split(/=(.*)/s).slice(0, 2))); for (const [key, value] of Object.entries({ - minecraft_version: '1.20.6', forge_version: '50.2.0', mapping_channel: 'official', - mapping_version: '1.20.6', mcp_version: '20240429.135109', java_version: '21', - mod_id: 'baseelectric', mod_name: 'baseElectric', mod_version: '2.2.14.120061', - orespawn_version: '4.1.0.120061', curseforge_project_id: '1783006', + minecraft_version: '1.21.1', forge_version: '52.1.0', mapping_channel: 'official', + mapping_version: '1.21.1', mcp_version: '20240808.132146', java_version: '21', + mod_id: 'baseelectric', mod_name: 'baseElectric', mod_version: '2.2.15.121011', + poweradvantage_version: '2.4.14.121011', basemetals_version: '3.1.2.121011', + basemetals_source_commit: 'b42b92b0e6f60ac5baf07a6b74042b2fa8427904', + basemetals_deobf_sha256: '7C0B961A8D4991C9B69379518AAD700A71C1E4B2076CF5DEF292C58029408A07', + orespawn_source_commit: '62c08169c71f4d4fd8f107289e63fd2a4c7c655c', + orespawn_version: '4.1.0.121011', curseforge_project_id: '1783006', cf_requirements: 'basepower,base-metals' })) assert.equal(props[key], value, key); - assert.deepEqual(json('src/main/resources/pack.mcmeta').pack, {pack_format:32, supported_formats:{min_inclusive:32,max_inclusive:41}, description:'baseElectric'}); + assert.deepEqual(json('src/main/resources/pack.mcmeta').pack, {pack_format:34, supported_formats:{min_inclusive:34,max_inclusive:48}, description:'baseElectric'}); const mods = read('src/main/resources/META-INF/mods.toml').toString(); - assert.match(mods, /modId="basepower"\s+mandatory=true\s+versionRange="\[2\.4\.13\.120061,3\.0\.0\)"/); - assert.match(mods, /modId="basemetals"\s+mandatory=false\s+versionRange="\[3\.1\.2\.120061,4\.0\.0\)"/); + assert.match(mods, /modId="basepower"\s+mandatory=true\s+versionRange="\[2\.4\.14\.121011,3\.0\.0\)"/); + assert.match(mods, /modId="basemetals"\s+mandatory=false\s+versionRange="\[3\.1\.2\.121011,4\.0\.0\)"/); }); function checkTrackModel(file, model) { @@ -64,20 +76,20 @@ check('Track audit rejects the old asset and a geometry mutation', () => { assert.throws(() => checkTrackModel(file, mutated), /changed beyond the render layer/); }); -check('Unrelated shipped resources and fixtures retain accepted 1.20.1 bytes', () => { +check('Shipped resources and fixtures retain released 1.20.6 bytes under singular registry folders', () => { const resources = tracked.filter(file => /^src\/(main|test)\/resources\//.test(file)); - const exceptions = new Set(['src/main/resources/pack.mcmeta', 'src/main/resources/META-INF/mods.toml', - assets + 'shaders/core/unshaded.vsh', assets + 'shaders/core/unshaded.json']); - for (const file of resources.filter(file => !exceptions.has(file) && !/\/data\/baseelectric\/(recipes|advancements\/recipes)\//.test(file))) { - assert.equal(sha256(read(file)), sha256(old(file)), file); + const exceptions = new Set(['src/main/resources/pack.mcmeta', 'src/main/resources/META-INF/mods.toml']); + for (const file of resources.filter(file => !exceptions.has(file))) { + assert.equal(sha256(read(relocated(file))), sha256(old(file)), file); + if (relocated(file) !== file) assert(!fs.existsSync(path.join(root, file)), 'Obsolete registry path: ' + file); } const actual = fs.readdirSync(path.join(root, 'src'), {recursive:true, withFileTypes:true}) .filter(entry => entry.isFile()).map(entry => path.relative(root, path.join(entry.parentPath, entry.name)) .split(path.sep).join('/')).sort(); - assert.deepEqual(actual, [...tracked, javaRoot.replace('main', 'test') + 'items/BatteryComponentTest.java', - javaRoot.replace('main', 'test') + 'items/LegacyBatteryDataTest.java', - javaRoot.replace('main', 'gametest') + 'gametest/ElectricGameTests.java', - 'src/gametest/resources/gameteststructures/empty.snbt'].sort(), + assert.deepEqual(actual, [...tracked.map(relocated), + javaRoot.replace('main', 'test') + 'resources/DatapackLayoutTest.java', + javaRoot.replace('main', 'test') + 'verification/NativeMachineFixture.java', + javaRoot.replace('main', 'test') + 'verification/NativeMachineFixtureTest.java'].sort(), 'Source and resource inventory'); }); @@ -87,11 +99,11 @@ check('Migration and registration code keep their accepted IDs and compatibility 'init/Entities.java', 'init/GUI.java', 'init/OreSpawnWorldGen.java' ]) { const file = javaRoot + name; - assert.equal(sha256(read(file)), sha256(old(file)), file); + assert.equal(read(file).toString().replace(/\s/g, ''), nativeLocations(old(file)).replace(/\s/g, ''), file); } }); -check('All 99 accepted tests are retained, plus three battery component tests', () => { +check('All 102 released tests and their semantic assertions are retained', () => { const methods = value => [...value.toString().matchAll(/@Test\s+public void (\w+)\(/g)].map(m => m[1]); const files = tracked.filter(file => file.startsWith('src/test/java/') && file.endsWith('.java')); let inherited = 0; @@ -101,34 +113,26 @@ check('All 99 accepted tests are retained, plus three battery component tests', const currentMethods = methods(current); const priorMethods = methods(old(file)); for (const name of priorMethods) assert(currentMethods.includes(name), file + ' lost ' + name); + const assertions = value => [...value.toString().matchAll(/\bassert\w*\s*\(/g)].length; + assert(assertions(current) >= assertions(old(file)), file + ' lost assertions'); assert.doesNotMatch(current.toString(), /@Ignore|Assume\.|assumeTrue\(|assumeFalse\(/, file); inherited += priorMethods.length; actual += currentMethods.length; } - assert.equal(inherited, 99); - assert.equal(actual, 99); - assert.equal(methods(read(javaRoot.replace('main', 'test') + 'items/BatteryComponentTest.java')).length, 2); - assert.equal(methods(read(javaRoot.replace('main', 'test') + 'items/LegacyBatteryDataTest.java')).length, 1); + assert.equal(inherited, 102); + assert.equal(actual, 102); + const gameTests = javaRoot.replace('main', 'gametest') + 'gametest/ElectricGameTests.java'; + const names = value => [...value.toString().matchAll(/public static void (\w+)\(GameTestHelper/g)].map(m => m[1]); + for (const name of names(old(gameTests))) assert(names(read(gameTests)).includes(name), 'Lost GameTest: ' + name); }); -check('Recipe results and guards retain their meaning under Forge 50 codecs', () => { +check('All 58 recipe IDs, results, guards and ingredients are unchanged', () => { const files = tracked.filter(file => /\/data\/baseelectric\/recipes\/.*\.json$/.test(file)); assert.equal(files.length, 58); for (const file of files) { const expected = JSON.parse(old(file)); - if (typeof expected.result === 'string') expected.result = {id: expected.result}; - else { - const {item, ...other} = expected.result; - expected.result = {id: item, ...other}; - } - if (expected.conditions) { - const conditions = expected.conditions; - delete expected.conditions; - expected['forge:condition'] = conditions.length === 1 ? conditions[0] - : {type:'forge:and', values:conditions}; - } - assert.deepEqual(json(file), expected, file); + assert.deepEqual(json(relocated(file)), expected, file); } }); From c0ee871f43c5f0691efd85c1e4abb6a1ab70ede3 Mon Sep 17 00:00:00 2001 From: JohnBraham Date: Wed, 11 Nov 2026 11:53:06 +0000 Subject: [PATCH 2/3] Repin baseElectric to repaired 1.21.1 basePower --- gradle.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index ba2e35b5..482c4d2c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -39,10 +39,10 @@ poweradvantage_version=2.4.14.121011 poweradvantage_pin_state=LOCAL_SOURCE poweradvantage_source_repository=MinecraftModDevelopmentMods/basePower # Owner-approved local candidate, not merged or publicly released. -poweradvantage_source_ref=72fd326b9a9c28e1b2447dfc5ebed99677f09872 +poweradvantage_source_ref=a16e8148871fe7007bf1db5a982dbba5ddf1a1ef poweradvantage_public_file_id= -poweradvantage_deobf_sha256=76CF79E04F36947D25535B982099B31AA88907448959F063BEA617644B7179F7 -poweradvantage_runtime_sha256=76CF79E04F36947D25535B982099B31AA88907448959F063BEA617644B7179F7 +poweradvantage_deobf_sha256=F91A613EB5FAA218AAD2DC3C881DEC7B897A5EE874215282A439E34B915C1AE6 +poweradvantage_runtime_sha256=F91A613EB5FAA218AAD2DC3C881DEC7B897A5EE874215282A439E34B915C1AE6 basemetals_version=3.1.2.121011 basemetals_source_commit=b42b92b0e6f60ac5baf07a6b74042b2fa8427904 From a1776e289be9dfd52951d7150551b28d6692b95f Mon Sep 17 00:00:00 2001 From: JohnBraham Date: Wed, 11 Nov 2026 15:46:18 +0000 Subject: [PATCH 3/3] Prepare baseElectric 1.21.1 with the released basePower dependency --- CHANGELOG.txt | 3 ++- README.md | 6 +++--- docs/NATIVE1211.md | 12 +++++++----- gradle.properties | 13 ++++++------- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a2c8e118..89207e99 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,8 +1,9 @@ -baseElectric 2.2.15.121011 (Minecraft 1.21.1 / Forge, local port) +baseElectric 2.2.15.121011 (Minecraft 1.21.1 / Forge) - Bring baseElectric to Minecraft 1.21.1 with basePower 2.4.14.121011. - Keep machine settings, saved data, battery charge and legacy world aliases. - Use the native recipe, data-pack and rendering APIs without changing recipe IDs. +- Pin the released basePower, Base Metals and OreSpawn jars used for the upgrade tests. baseElectric 2.2.14.120061 (Minecraft 1.20.6 / Forge) diff --git a/README.md b/README.md index 0d9e0498..4651be1d 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ baseElectric continues DrCyano's Electric Advantage. It adds electric machines, generation, storage, automation and defence to basePower. Its equipment appears in the shared basePower creative tab. -This local port targets Minecraft **1.21.1**, Forge **52.1.0**, official mappings +This version targets Minecraft **1.21.1**, Forge **52.1.0**, official mappings with MCP **20240808.132146**, ForgeGradle **7.0.34**, Gradle **9.6.1**, and Java **21**. The version is **2.2.15.121011**. It requires basePower **2.4.14.121011**. The coordinated dependencies are Base Metals **3.1.2.121011** and OreSpawn -**4.1.0.121011**. The migration-hook Base Metals jar is approved for local use -only. This port is not published or ready for release promotion. +**4.1.0.121011**. All three dependency pins use merged source and verified public +downloads. CurseForge, Maven and GitHub releases use the same checked player jar. See the [1.21.1 notes](docs/NATIVE1211.md) for compatibility and verification status. Back up your world and try the upgrade on a copy. Replace Electric Advantage diff --git a/docs/NATIVE1211.md b/docs/NATIVE1211.md index 50f405b7..64e8fa77 100644 --- a/docs/NATIVE1211.md +++ b/docs/NATIVE1211.md @@ -1,8 +1,8 @@ # Electric on Minecraft 1.21.1 baseElectric 2.2.15.121011 targets Forge 52.1.0 and Java 21 with basePower -2.4.14.121011. It remains a local port until the coordinated dependency pins -and qualification gates are complete. Nothing has been published. +2.4.14.121011. The dependency pins now use merged source and verified public +CurseForge downloads, with matching Maven and GitHub artifacts. ## Saves and Machines @@ -36,11 +36,13 @@ paths and real block-entity fixture types, including cleanup after failures. `nativeResourceChecks` and `compileNativeApiDiagnostics` are independent of basePower. Full native and ECJ runs pass 106 tests without skips. The four GameTests, archive and dependency audits, Javadoc and Eclipse checks pass -against the coordinated local basePower commit. GameTest and client-only +against the coordinated basePower release. GameTest and client-only contract sources compile separately from the player jar. -These checks do not replace whole-world upgrade, family gameplay, restart or -visual acceptance. Rebuilt dependencies require fresh qualification. +The combined suite also passed old-world migration, connected machine jobs, +saved-state checks, chunk unloading and two 30-minute endurance runs. The +client visuals and recipe unlocks were accepted before publication. Keep a +backup and test upgrades on a copy; no suite covers every modpack. Hosted CI and publication remain gated on merged and public dependency pins. Local compilation is not evidence of runtime, migration or visual acceptance. diff --git a/gradle.properties b/gradle.properties index 482c4d2c..0d823469 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,18 +36,17 @@ cf_optionals= cf_versions=1.21.1 poweradvantage_version=2.4.14.121011 -poweradvantage_pin_state=LOCAL_SOURCE +poweradvantage_pin_state=MERGED_SOURCE poweradvantage_source_repository=MinecraftModDevelopmentMods/basePower -# Owner-approved local candidate, not merged or publicly released. -poweradvantage_source_ref=a16e8148871fe7007bf1db5a982dbba5ddf1a1ef -poweradvantage_public_file_id= +# Exact released basePower source and checksum-matching public jar. +poweradvantage_source_ref=8d9937b3c0c9ef28a231b90fc2ff6adfea1af733 +poweradvantage_public_file_id=9559143 poweradvantage_deobf_sha256=F91A613EB5FAA218AAD2DC3C881DEC7B897A5EE874215282A439E34B915C1AE6 poweradvantage_runtime_sha256=F91A613EB5FAA218AAD2DC3C881DEC7B897A5EE874215282A439E34B915C1AE6 basemetals_version=3.1.2.121011 -basemetals_source_commit=b42b92b0e6f60ac5baf07a6b74042b2fa8427904 -# Approved local migration-hook artifact, not a public release pin. -basemetals_public_file_id= +basemetals_source_commit=327c197bcdd0bb5e883d844bb6a6c8791bc580b7 +basemetals_public_file_id=9559006 basemetals_deobf_sha256=7C0B961A8D4991C9B69379518AAD700A71C1E4B2076CF5DEF292C58029408A07 basemetals_runtime_sha256=7C0B961A8D4991C9B69379518AAD700A71C1E4B2076CF5DEF292C58029408A07