V2 correctif audit - #135
Merged
Merged
Conversation
Remove dead V2 relics: lib.multiblock.manager.* (MultiBlockCache, MultiBlockManager, RegisteredMultiBlockPattern), IBetterPattern, the non-aisle SimpleMultiBlockPatternBuilder, and the legacy IrradiatedSurfaceRules v1 implementation. The v2 surface rule logic now lives in IrradiatedSurfaceRules, and CNNoiseGeneratorSettings points back to it. Introduce IMultiblockController to decouple MultiBlockManagerBeta.findStructure from the concrete ReactorControllerBlockEntity, and consolidate the duplicated FALLBACK rod/fluid type ResourceKeys into CreateNuclearRegistries. Also drop unused fields/imports (CNDensityFunctions.NOODLES, CNNoiseData basalt mare keys, commented-out registrations and mob spawns, debug logger call in SimpleMultiBlockAislePatternBuilder, dead getDistanceControllerTest), and fix a typo in MultiBlockOffsetPos (caracter -> character).
Move all radiation-related classes (CNRadiationValues, RadiationBucketItem, RadiationItem, RadiationEffect, RadiationEffectHandler, the radiation capability, and RadiationOverlay) out of foundation/item/radiation, content/effects/capability, foundation/events/overlay and impl/effect into a single content.radiation package and content.radiation.capability / content.radiation.client subpackages, to give the feature one owner instead of spreading it across four layers. Drop the now-unused RadiationSyncPacket and ClientRadiationData (dead client-sync packet) along with their CNPackets registration. Fix the RadiationEffetcHandler typo (-> RadiationEffectHandler) and merge foundation/util into foundation/utility by moving ClothTagHelper, updating all references in AntiRadiationArmorItem and SmithingTransformRecipeMixin. Add a guard in RadiationRegistry.build() that throws if an item already implements IRadiationSource, preventing double-counted radiation values between the two parallel radiation sources.
…yManager Move the frame fluid cache, fill-ratio computation, and frame column bounds (min/max Y) out of ReactorControllerBlockEntity into a new ReactorFrameDisplayManager/ReactorFrameDisplayManagerI pair, following the manager/service extraction pattern already used for output, input fluid, and alarm logic. ReactorFrameRenderer and ReactorAssembler now go through getFrameDisplayManager() instead of calling the now-removed getDisplayedFluid/getDisplayedFluidFillRatio/setFrameColumn/ hasFrameColumn/getFrameColumnMinY/getFrameColumnMaxY methods directly on the controller. NBT read/write for the frame column bounds is delegated to the new manager as well. Also expose getInputFluidManager() on the controller, drop a leftover commented-out debug block in onSpeedChanged, fix a stray line break in setMultiblockFacing, and tighten changeBiome's visibility to private.
…ion and BoundingBox
IMultiblockController.setMultiblockFacing/getMultiblockFacing and
ReactorControllerBlockEntity's reactorFacing now use Direction instead
of a raw String ("north"/"east"/...), and reactorPos/multiblockStructure
now uses vanilla's BoundingBox instead of a hand-rolled
[xMin,xMax,yMin,yMax,zMin,zMax] int array. MultiBlockManagerBeta and
ReactorPattern.isInReactorRange are updated accordingly, with
isInReactorRange now delegating to BoundingBox.isInside.
DefaultPersistenceService serializes the facing via
Direction.getSerializedName()/byName and the structure bounds via
BoundingBox.CODEC.
ReactorAssembler gains a static getStructureBound(BlockPos, int,
Direction) computing the reactor's BoundingBox from its center, size,
and facing, replacing the old @deprecated
getStructureBounds/applyOffset switch-based lookup tables on the
controller (also removes the dead @deprecated getBlockPosForReactor).
findAndRegisterSpecialBlocks now takes a BoundingBox.
Extract the reactor explosion's circular biome-irradiation logic out of
ReactorControllerBlockEntity.changeBiome/createCircularResolver into a
new BiomeIrradiationService, with biome-tag-based target resolution via
BiomeIrradiationMapping/BiomeIrradiationMappings (overworld/nether/end
each map to their own irradiated biome instead of always Irradiated
Plains).
…n packages Sweep of dead/unused imports left over from previous refactors: SimpleMultiBlockAislePatternBuilder, ClientEvents, ReactorFluidTypesValue, SmithingClothRecipeBuilder, MultiBlockManagerBeta, AnimalUtil, VicinityEffect, ClothItem, BigFluidStack, ReactorAssembler, ReactorControllerBlockEntity, ReactorSummaryDisplaySource, CNDensityFunctions and IrradiatedBiomes. Also move the RADIATION_VALUE static import below the regular imports in RadiationCapability and drop a stray blank line in IRadiationCapability, with no behavioral change.
…or and ReactorDebugDiagnostics Move triggerNuclearExplosion out of ReactorControllerBlockEntity into a new ReactorMeltdownExecutor (IExplosionService), computing explosion size, spawning the NuclearExplosionEntity, destroying the controller block and irradiating the surrounding biome. The block entity now delegates to this service via the existing service-injection pattern and just sets isExploding. Replace the verbose logReactorConnections debug dump (raw LOGGER.debug calls) with ReactorDebugDiagnostics.sendReactorConnectionsTo, which reports input, fluid input, output and alarm manager state directly to the requesting player as translated chat messages. Add the corresponding createnuclear.reactor.debug.* translation keys to reactor.json and update ReactorControllerBlock's paper-item handler to pass the player through.
Drop the unused translation keys reactor.info.assembled.none, reactor.info.assembled.destroyer and reactor.info.is from the default, en_us and en_ud reactor lang files (none of them were referenced anywhere in code). Also remove the leftover commented-out "reactor is not assembled" chat message in ReactorControllerBlock's interact handler.
…te/ReactorGoggleTooltipRenderer Replace the three loose clientDisplayItems/clientDisplayFluids/clientMaxFluidCapacity fields on ReactorControllerBlockEntity with a single immutable ReactorDisplayState record (items, fluids, maxFluidCapacity), with its own serializeNBT/deserializeNBT for the client sync packet. Move the serialization logic out of readBasicState/writeBasicState into DefaultPersistenceService, which now reads/writes the "displayState" tag on client packets. Move the Goggles tooltip rendering out of addToGoggleTooltip into a new stateless ReactorGoggleTooltipRenderer that renders purely from a ReactorDisplayState snapshot plus the current heat value. Also switch the debug-connections interaction trigger from holding paper to holding a debug stick.
Break the single render() method into renderHeaderAndHeat, renderItemRods and renderFluidTanks, each responsible for one section of the Goggles tooltip. Pure refactor, no behavioral change — render() now just calls the three helpers in order.
…lder Move the per-tick collection of input item/fluid data out of ReactorControllerBlockEntity.tick() into a new ReactorInputSnapshot record and ReactorInputSnapshotBuilder service. The builder scans the input item/fluid handlers and produces a single immutable snapshot (items, fluids, max fluid capacity, fuel/cooler rods), which the block entity now uses to populate displayState, bigFuelItem, bigCoolerItem and bigFluidStack. This removes a chunk of inline collection logic and several now-unused imports from the block entity, consolidating the snapshot into one reusable source for tooltip display and future consumption/heat calculations.
Stop tracking .claude/settings.local.json (machine-specific Claude Code settings) and exclude .claude/* via .gitignore. Add AUDIT2.md, an independent re-evaluation of the V2 refactor against AUDIT.md.
Drop the createnuclear-specific lead_ores, uranium_ores and thorium_ores tags (CNTags, CNBlocks, CNStandardRecipeGen) and use the shared forge:ores/lead, forge:ores/uranium and forge:ores/thorium tags everywhere instead, removing duplicate tag definitions and regenerating the recipe/advancement JSONs that referenced them. Also fix harvest-tool tags for thorium ore and raw thorium block: add NEEDS_DIAMOND_TOOL/NEEDS_IRON_TOOL to thorium ore (both deepslate and stone variants) and NEEDS_DIAMOND_TOOL to raw_thorium_block, and add deepslate_thorium_ore to needs_iron_tool, so thorium-related blocks require the correct tool tier like their uranium/lead counterparts.
…eactor components
RodsTooltipHandler intentionally skips mod items (already handled via setTooltipModifierFactory) to only process external/datapack items. This is not a bug, but a readability risk — updated documentation with the rationale and a recommendation to add a guard comment.
Document the semantic split between RadiationEffect's binary gate and RadiationCapability's continuous dose attenuation, and propose RadiationCapability.canBeIrradiated() as the single reusable gate with a cached entity blacklist instead of rebuilding the HashSet per call.
…going refactor progress
… the vicinity effect
…ensions Replace `var entityModelSet`/`var root` with explicit EntityModelSet/ModelPart types in getHumanoidArmorModel(), for consistency with the project's preference for explicit typing over var (see e.g. ReactorSummaryDisplaySource's Map.Entry<Item, Integer> and List<BigFluidStack> in commit e790095's predecessor).
…base Complete the §6 French-comment cleanup tracked in AUDIT_ACTUEL.md (items 6-14, minus the already-resolved ReactorSummaryDisplaySource guard clauses): translate every remaining French inline comment and Javadoc to English, with no functional or logic changes: - CNFluids.java: translate the uranium/liquid-nitrogen/thorium fluid effect comments, including the freeze-tick compensation notes. - ClientEvents.java: translate the tick-handling and camera-shake Javadoc/comments, and drop a redundant inline comment duplicating the method doc. - PalettesVariantEntry.java: remove a dead, comment-only `if` block that only held a French note about render-type handling moving elsewhere. - AntiRadiationArmorItem.java: translate the getArmorTexture comment. - ReactorSizeDisplaySource.java: translate the label/gauge comments. - CameraAccessor.java: translate/remove the package and Invoker comments (mixin invoker for Camera#move). - GameRendererMixin.java: translate the sky-darkening and white-flash injection comments. - RadiationHeartMixin.java: translate the Gui.class targeting comment and the renderHeart/heart-texture-swap comments. - IrradiatedBiomes.java: translate the biome color comments (water, fog, sky, grass, foliage). No file in this diff contains any remaining French text.
…and CNEntityType, update audit tracking - NuclearExplosionEntity.java: translate the Alex's Caves compat comments (why `alexscaveHandler` is typed as Object, when the compat handler is instantiated, Raycat/Tremorzilla immunity handling) and the vanilla-block destroy-after-explode fix comment, expanding them with more precise explanations rather than a literal translation. - CNEntityType.java: translate the "Utilise le renderer vide par défaut de Minecraft" comment on the mushroom cloud entity's renderer registration, explaining that the particle does the actual rendering. - AUDIT_ACTUEL.md: record commit `9e8abe92` (2026-07-14), which translated the previous 9 remaining French-comment files from §6 (CNFluids, ClientEvents, the three mixins, PalettesVariantEntry, AntiRadiationArmorItem, ReactorSizeDisplaySource, IrradiatedBiomes), dropping the affected file count from 11/292 to 2/292 (~3.8% to ~0.7%); also documents the newly-found CNEntityType.java:76 comment that prior audit passes had missed, and narrows the remaining §6 scope down to NuclearExplosionEntity.java and CNEntityType.java.
…PEED cross-reference fix - §0: add a 2026-07-14 update for commit `eeffe4fe`, translating the last 2 remaining French-comment files (NuclearExplosionEntity.java, CNEntityType.java) and confirming via a full src/main/java grep that §6 (French comments/Javadoc) is now entirely closed, 0/292 files. - §6: rewrite the section to reflect full closure — replace the "Résolu"/"Cas restants" split with a single chronological "Historique de la résolution" list covering all four translation commits (`3be6252a`, `cc532f83`, `9e8abe92`, `eeffe4fe`), update the global count to 0/292 files, mark the ReactorOutput.SPEED ambiguity note as resolved (cross-referencing the earlier `ae1e394d` fix that this section had not yet reflected), and rewrite the "pattern récurrent" and "priorité recommandée" paragraphs to state the item is closed. - §7 (item 8 "Documentation"): mark the last remaining translation bullet (NuclearExplosionEntity.java/CNEntityType.java) as done, with a note that §6 is now fully closed at 0/292 files. - §8.1: add a changelog row documenting `eeffe4fe` (Alex's Caves compat comment translation plus a correction to a stale English comment about destroyBlock's drop-items parameter, and the CNEntityType.java renderer comment), noting no behavioral change and full §6 closure.
… refuted false positive - §0: add a 2026-07-14 documentation-only update noting that the ReactorSummaryDisplaySource.formatValue "heat display mode inconsistency" item (§2.4/§7 priority 5) is refuted and closed after deeper analysis, not fixed by code. - §2 (item 4): mark the item as refuted/closed with a strikethrough, pointing to the new §8.2 write-up instead of describing it as an open, unchanged inconsistency. - §5 (design/UX improvements): mark the corresponding recommendation as refuted/closed without code, same cross-reference. - §8.2: add a detailed rebuttal explaining that forcing a gauge for `heat` in normal mode (gaugeOnNormal=true) isn't an isolated exception — formatFluid does the same for `fluid` — so the summary widget consistently gauges its two most glance-critical stats while keeping fuel/cooler as text; HeatDisplaySource is a single-line, single-stat widget with different space constraints, so there was never an implicit rule that the two widgets' default modes should match. Also documents why a shared ReactorDisplayFormatting utility was considered and rejected: the three existing mode->render mappings have different semantics (3 vs 4 modes, per-stat gaugeOnNormal flag, optional unit suffix), so unifying them would cost more than the purely cosmetic inconsistency it would fix.
…em as confirmed status quo - §0: add a 2026-07-14 documentation-only update confirming the §3/§7 item 9 status quo — RadiationCapability.tickRadiation's lack of an inventory dirty-check for non-player LivingEntity is analyzed in depth and kept as-is, since the mob scan (6 slots, O(1) HashMap lookups via RadiationRegistry) is too small for a player-style hash (41 slots) to pay off, and the rest of tickRadiation likely dominates per-mob cost anyway. - §3 table: rewrite the RadiationCapability.tickRadiation row from "point à surveiller" to "statu quo recommandé", summarizing why hashing 6 slots wouldn't be cheaper than the direct computation it would replace, and that event-driven invalidation (LivingEquipmentChangeEvent) — not a hash — would be the only approach worth revisiting if profiling ever flags this loop as hot. - §7 (item 9 "à surveiller"): update the watch-item description with the same summary and §8.2 cross-reference. - §8.2: add a detailed rebuttal with code references (RadiationCapability.java, RadiationRegistry.java) covering: the 41-vs-6-slot asymmetry, why hashing wouldn't be cost-effective at mob scale, why the rest of tickRadiation likely dominates the per-mob cost regardless, the event-driven invalidation fallback if profiling ever justifies it, and a clarification that computeItemRadiation(Player) intentionally excludes player armor since no armor item in this mod is a radiation source (only resistance equipment).
…as still open - Coverage-limits note (intro): mark B7, B10, B17 and B18 as re-verified by direct code reading instead of "neither confirmed nor refuted"; note that the unnumbered "minor" list from AUDIT_V1.md §2 is still entirely unverified. - §1 (bug table): add a new open bug row for IrradiatedOverlayRendererVision (foundation/events/overlay/IrradiatedOverlayRendererVision.java:23) — ex-B10 — mc.gameMode.getPlayerMode() is called with no null-guard on mc.gameMode, which can be null during world (re)load; the existing mc.player null-check happens later in the method and does not protect this earlier access. One-line fix identified but not yet applied. - §8.2 (refuted/closed investigations): add two new entries refuting legacy AUDIT_V1.md claims after direct code inspection — CNNoiseData.bootstrapRegistries (B7): EROSION noise parameters are in fact registered, contrary to the "entirely commented out" claim; RodsTooltipHandler (B17): the namespace check is confirmed intentional (explicit in-code comment) to avoid double tooltips on mod rods already handled via Registrate's setTooltipModifierFactory, not an accidental inversion.
- Relocate ClientEvents from the createnuclear root package to net.nuclearteam.createnuclear.foundation.events, aligning it with the rest of the foundation/events/* classes (e.g. the overlay renderers). - Update the package declaration and add explicit imports for CNClientProxy and CreateNuclear (previously implicit same-package references from the root package). - No behavioral changes: nuke flash/shake ticking, camera-shake computation, and anti-radiation armor model-part hiding logic are unchanged.
…gister them under the "client" mixin block - Relocate CameraAccessor, GameRendererMixin and RadiationHeartMixin from foundation.mixin to a new foundation.mixin.client subpackage, and update ClientEvents' import of CameraAccessor accordingly. - createnuclear.forge.mixins.json: move RadiationHeartMixin, GameRendererMixin and CameraAccessor out of the common "mixins" list into the "client" list (with their new "client." prefix), so they are only applied on the client distribution instead of being loaded on dedicated servers; also drop the now-unused "accessWidener" entry. - Rename mixin injector methods to the "CN$" prefix convention (cn_tick -> CN$tick, cn_render -> CN$render, createnuclear$changeHeartTexture -> CN$changeHeartTexture) for consistency across the mixin classes. - RadiationHeartMixin: fix VANILLA_ICONS to use the single-argument ResourceLocation constructor (implicit "minecraft" namespace) instead of the deprecated explicit-namespace constructor.
…single Holder - RodType and ReactorFluidType now hold a single Holder<Item>/Holder<Fluid> (fields renamed item/fluid) instead of a HolderSet<Item>/HolderSet<Fluid> that always contained exactly one entry in practice; codecs switch from RegistryCodecs.homogeneousList to RegistryFixedCodec, and generated JSON data (fluids/type/*.json, rods/type/*.json) is regenerated with the singular "fluid"/"item" fields instead of "fluids"/"items" arrays. - RodType.Builder.addItems(ItemLike...) is replaced by a single-item item(ItemLike) setter; ReactorFluidType.Builder.fluid(...) now replaces rather than accumulates. Update all call sites (ItemRodTypesValue, CNRodTypes javadoc, DefaultHeatCalculator's rod.items().size() > 0 checks switched to rod.isNotEmptyItem()). - Default sentinel instances (ItemRodTypesValue.DEFAULT_ROD_TYPE, ReactorFluidTypesValue.DEFAULT_REACTOR_FLUID_TYPE) now use Items.AIR.builtInRegistryHolder() / Fluids.EMPTY.builtInRegistryHolder() instead of an empty HolderSet, and isNotEmptyItem()/isNotEmptyFluid() check identity against AIR/EMPTY instead of checking set size. - ReactorFluidType: remove the unused useConfig/setRodConfig config-override mechanism (dead code — the CNConfigs lookup was already commented out) along with its now-redundant maxHeat()/ efficiency() overrides. - toString() on both records is updated to report the single fluid/item name instead of joining a list.
…echanism discrepancy
- CNConfiguredFeatures: bump lead ore's OreConfiguration vein size
from 10 to 12.
- CNPlacedFeatures: rebalance ore placement counts — uranium 5 -> 4,
thorium 8 -> 6 per chunk, and reduce striated_ores_overworld
frequency from "on average once every 1 chunk" to once every 64
chunks (was effectively placed almost everywhere before).
- Regenerate the corresponding datagen output
(worldgen/configured_feature/lead_ore.json,
worldgen/placed_feature/{striated_ores_overworld,thorium_ore,uranium_ore}.json).
- AUDIT_ACTUEL.md: add a new "on hold" §2 note (per user request,
2026-07-25) flagging that Nitrate Ore's loot table uses vanilla
minecraft:ore_drops while Thorium/Uranium use set_count +
uniform_bonus_count — a pattern inconsistency to resolve later
(harmonize or document as intentional), not addressed in this
change.
…add its Reinforced Glass Bottle recipe chain
- Rename BiomeRestoreCellItem -> BiomeIrradationExtractorItem and the
registered item biome_restore_cell -> biome_irradiation_extractor
("Biome Irradiation Extractor"), updating every reference
(CNItems, CreateNuclearClient, CNBuilderTransformers) and the item
model/texture path from item/biome_restore_cell/* to
item/biome_irradiation_extractor/*. Old biome_restore_cell models
and textures are deleted; new biome_irradiation_extractor models,
advancement and lang entries are generated in their place.
- The extractor is no longer a standalone craftable item: it now has a
shaped crafting recipe (8x) from 8 Reinforced Glass Bottles + 1
Nether Star, gated behind a new has_reinforced_glass_bottle
advancement/unlock, and its max stack size changes from 1 to 16.
- Add a new REINFORCED_GLASS_BOTTLE item (CNItems), craftable (3x)
from Reinforced Glass in a diamond pattern, with its own generated
model, recipe and texture.
- CBiomeRestore config: lower the default maxCharge from 16 to 8, and
remove the now-unused alwaysShowBar option (and its comment).
- tooltips.json: add a beta-warning tooltip and a
biome_irradiation_extractor restorations-counter tooltip
("Restorations: %d / %d"); minor unrelated whitespace cleanup
(removed stray blank lines).
- Regenerate affected datagen output: en_us.json/en_ud.json lang
files, the .cache index, and new recipe/advancement JSON for both
biome_irradiation_extractor and reinforced_glass_bottle.
…ts across CNC* classes
- CRods: rename fields to a consistent noun-first style
(baseValueUranium -> uraniumBaseValue, uraniumProxyBonus ->
uraniumProximityBonus, baseValueGraphite -> graphiteBaseValue,
graphiteProxyMalus -> graphiteProximityMalus) and remove two
already-commented-out dead config entries (maxHeat,
rodFuelMaxForCoolerRod) along with their now-unused comments.
Update every call site: CNItems (rod registration), and the
DefaultHeatCalculatorGameTest assertions.
- CNotify: rename distanceOfWarning -> warningDistance and its TOML
key to snake_case; update all four call sites (ReactorAssembler,
ReactorControllerBlock, IExplosionService,
ReactorMeltdownMonitor). Fix CNCServer's copy-paste bug where the
notify field was built with Comments.ratio instead of a proper
notify comment.
- CWorldGen: invert disableWorldGen (default false) into
enable/EnableWorldGen (default true), and update
ConfigPlacementFilter.shouldPlace to match the flipped polarity.
- CRadiation: reorder configuredLists to be declared after the
scalar fields, rename the entityBlackList TOML key to
entity_blacklist, and substantially trim/rewrite the verbose
multi-paragraph comments (enabled, radiationLevel1-3,
amplifierLevel0-2, list, blackListEntity) into concise single-line
or shortened descriptions.
- CNCClient: rename TOML keys nuclearBombFlash -> nuclear_bomb_flash
and screenShaking -> screen_shake to snake_case, make screenShaking
final, and reword both comments.
- CNCCommon: reword the worldGen comment.
- tooltips.json: fix a missing space in the enriched_soul_soil
tooltip ("fire_.Can" -> "fire_. Can").
- Regenerate affected datagen output (en_us.json, en_ud.json, the
.cache index) to reflect the renamed config-adjacent lang entries.
- Add an explicit import for ForgeConfigSpec.ConfigValue and use the unqualified ConfigValue<List<? extends String>> type for ENTITY_BLACKLIST instead of the fully-qualified ForgeConfigSpec.ConfigValue reference. No behavioral change.
…mity math asymmetry - DefaultHeatCalculator.computeHeat: read the rod pattern directly from the blueprint item via ReactorBluePrintItem.getItemStorage(...) (an ItemStackHandler) instead of manually parsing raw "pattern"/ "Items" NBT compound tags — removes the ListTag/Tag NBT walk in favor of the same accessor GameTest fixtures already use. - Rewrite the fuel/cooler proximity scoring to be symmetric: a fuel rod's neighbor scan now only ever contributes when adjacent to another fuel rod (RodType.TypeRodPredicate.isFuel), and a cooler's scan only contributes when adjacent to another cooler (isCooled) — replacing the previous asymmetric logic where a cooler never scored anything and a fuel-next-to-cooler used a fuel.base/cooler.proximity division. Add the RodType(RodType) new isFuel/isCooled predicate overloads used for this. NOTE: this changes DefaultHeatCalculatorGameTest's asymmetry test from correct to outdated — that test still asserts the old fuel/cooler division behavior and needs re-verification against this new logic. - computeHeat now skips TypeRod.NONE rods explicitly and clamps the final result to a minimum of 0 (Math.max(0, heat + overHeat)) instead of allowing negative heat. - Thread a new previousHeat/currentHeat parameter through the whole heat-calculation call chain (IHeatService, DefaultHeatService, HeatManager, IOverheatController, DefaultOverheatController, IReactorHeatUpdateCoordinator, ReactorHeatUpdateCoordinator, ReactorControllerBlockEntity) so DefaultOverheatController can force the overheat timer to increment once the reactor's heat exceeds its active fluid's configured maxHeat, in addition to the pre-existing fluid-shortage/negative-ratio conditions. - Minor cleanup: drop unused imports in HeatManager, remove a stray blank line in ReactorControllerInventory, and remove a dead `formattedPattern[j][k] == 99` sentinel check in DefaultHeatCalculator (now unreachable since slots are matched by value, not sentinel).
… cooler-to-cooler - DefaultHeatCalculator.computeHeat: correct the cooler branch's neighbor check — the previous commit's rewrite still compared isCooled(rod) && isCooled(neighborRod), which never triggers a cooler's own contribution (two coolers never award heat to each other under this formula); now correctly checks isCooled(rod) && isFuel(neighborRod), matching the external design spec's "Graphite extra: -1/4Q of the heating rod" and the reference JS calculator (verified 128 on both sides for the [G,T,G]/[T,U,T]/[G,T,G] pattern). - AUDIT_ACTUEL.md: document this fix in §0 (commit 691dfb1 + this follow-up), close the §2.2 fuel/cooler asymmetry item as resolved, update §3's GameTest coverage row and add a new ReactorFluidType.maxHeat() row noting it's no longer dead code, update §7 item 6's optimization note, and add the corresponding §8.1 changelog row — all cross-referencing that DefaultHeatCalculatorGameTest still asserts the old (now incorrect) division-based behavior and needs to be rewritten to match.
…a and add a 3x3 wiki-reference test - DefaultHeatCalculatorGameTest: rename and rewrite test 3 (fuelCoolerMix_onlyFuelScansContributeProximityHeat_coolerAdjacencyIsAsymmetric -> fuelCoolerMix_coolerScansItsOwnFuelNeighborsSymmetrically) to assert the current cooler-scans-fuel-neighbor multiplication formula (neighborRod.baseRodHeat() * rod.proximityRodHeat()) instead of the old fuel-scans-cooler-neighbor division formula, per the DefaultHeatCalculator fix landed in the previous commit. - Fix test 2 (singleCoolerRod_noNeighbors_addsOnlyItsOwnBaseRodHeat): computeHeat now floors its result at 0 (Math.max(0, heat + overHeat)), so an isolated cooler's negative baseRodHeat was previously being swallowed by the floor and the test's -32 expectation was unreachable; add a large overHeat (50) to keep the total positive and actually exercise baseRodHeat's contribution. - Add a new test 4 (threeByThreeDiamond_matchesWikiCalculatorReferenceValue) covering a full interior 3x3 rod pattern (4 corner graphites, 4 edge thoriums, 1 center uranium), asserting against a config-derived expected value that matches the community wiki calculator's reference result of 128 for this pattern under default balance. - AUDIT_ACTUEL.md: update §2.2, §3's GameTest coverage row, and the §8.1 changelog entry to record that DefaultHeatCalculatorGameTest is now up to date with the corrected formula, and document the in-game GameTest run (./gradlew runGameTestServer, 30 tests, 3 failures — 2 already-known/expected ReactorInputFluidManager over-extraction contract markers, 1 fixed here from the new Math.max(0, ...) floor).
…he O(81) position lookup - DefaultHeatCalculator: replace the per-rod double loop over the full 9x9 formattedPattern grid (used just to relocate a rod's own slot before scanning its neighbors) with a static NEIGHBORS_BY_SLOT map (Map<Integer slot, List<Integer> neighborSlots>), built once via buildNeighborsBySlot() from the pattern/offsets. computeHeat now looks up a rod's neighbor slots directly instead of re-scanning all 81 grid cells per rod (~57x81 ≈ 4617 iterations/tick on a full reactor down to O(1) map lookups), matching the low-risk optimization already tracked in AUDIT_ACTUEL.md §2.2/§7. - formattedPattern/offsets fields become static final FORMATTED_PATTERN/OFFSETS constants shared across instances instead of being rebuilt per DefaultHeatCalculator instance. - No behavioral change: neighbor resolution order and the fuel/cooler proximity formulas are unchanged.
…_ACTUEL.md, cross-referenced to 37613d8 - §2.2: mark the remaining O(81) position-lookup loop as resolved (commit 37613d8), pointing to the new §8.1 entry instead of repeating the recommendation inline. - §3 (multiblock optimization table): flip the DefaultHeatCalculator.computeHeat row from "partially fixed, low priority" to "fixed, closed", referencing the new NEIGHBORS_BY_SLOT map and commit 37613d8. - §7 (priority 6, minor optimizations): mark the slot->neighbor precompute item as done, describing NEIGHBORS_BY_SLOT and buildNeighborsBySlot(). - §8.1 (changelog table): correct the previous fuel/cooler-asymmetry entry's hash reference (drop the "+ correctif suivant... non commité" placeholder, now that that follow-up has its own commit), and add a new changelog row for 37613d8 documenting the O(81) -> O(1) neighbor-lookup optimization (FORMATTED_PATTERN/OFFSETS made static final, new precomputed NEIGHBORS_BY_SLOT map), noting it is a no-behavior-change performance fix.
…mble/disassemble sound events - CNSoundEvents: rename the NUCLEAR_EXPLOSION_RINGING sound entry from "explosion/nuclear_explosion_ringing" to "explosion/ringing", matching the renamed audio asset (nuclear_explosion_ringing.ogg deleted, replaced by the new ringing.ogg). - NuclearMushroomCloudParticle: fix the ringing playback to actually use CNSoundEvents.NUCLEAR_EXPLOSION_RINGING instead of NUCLEAR_EXPLOSION_SHOCKWAVE (kept as a commented-out reference). - ReactorControllerBlock: switch the assemble/disassemble sound effects from REACTOR_ACTIVATION/REACTOR_SHUT_OFF to the dedicated MOTOR_ASSEMBLE/MOTOR_DISASSEMBLE sound events. - gradle.properties: bump mod_version from 2.0.17-beta-sound to 2.0.17-beta-sound2. - Regenerate affected datagen output (sounds.json, en_us.json, en_ud.json, .cache index entries) to reflect the renamed sound file.
…version - IrradiatedBiomes: register a new .backgroundMusic(new Music(...)) entry for the irradiated_land biome, reusing the same BIOME_WASTELAND sound event as the ambient loop sound (min_delay 0, max_delay 300, replace_current_music true). The existing .ambientLoopSound(...) call is kept but flagged in a new comment as pending replacement by a dedicated ambient-loop sound distinct from the background music. - BiomeIrradiationService: add unused ServerPlayer and CreateNuclear imports (no behavioral change yet in this diff). - gradle.properties: bump mod_version from 2.0.17-beta-sound2 to 2.0.17-beta-sound3. - Regenerate the corresponding datagen output (worldgen/biome/irradiated_land.json gains a "music" block; .cache index updated).
…verheat, in addition to fluid conditions - Add new HeatBalance record (content/multiblock/reactorLogic) holding weighted heatPoints (fuel) and coolingPoints (cooler) sums, with a resolve() method comparing their ratio against the wiki-reference 6:1 TARGET_RATIO to produce an EquilibriumState. - Add new EquilibriumState enum (OVERHEATING / BALANCED / OVERCOOLING); only OVERHEATING currently drives behavior (BALANCED/OVERCOOLING are placeholders for a future status display / output bonus-malus). - Move heat-balance computation from a static ReactorHeatUpdateCoordinator.calculateActualTotalHeatRatio(...) helper into the IReactorHeatUpdateCoordinator interface as an instance method calculateHeatBalance(...), now returning a HeatBalance instead of a single int — it separately accumulates heatPoints for FUEL rods and coolingPoints for COOLER rods (each weighted by RodType.ratio()) instead of summing every rod's heatRatio into one signed total. Document all four IReactorHeatUpdateCoordinator methods with full parameter Javadoc. - DefaultOverheatController.updateState: take a HeatBalance instead of a raw totalHeatRatio int. The overheat timer now escalates on two independent malus points — rodMalus (HeatBalance.resolve() == OVERHEATING) and fluidMalus (insufficient fluid / exceeds fluid maxHeat) — and when both are active simultaneously, overHeat increases by 2 per tick instead of 1, and overFlowLimiter decreases by the same malusPoints count (floored at 2) instead of always by 1. - Thread the new HeatBalance type through the whole heat-calculation call chain in place of the old totalHeatRatio int: IHeatService, DefaultHeatService, HeatManager, IOverheatController, ReactorHeatUpdateCoordinator, ReactorControllerBlockEntity (new heatBalance field, initialized to HeatBalance(0, 0), now populated via heatCoordinator.calculateHeatBalance(...) instead of the removed static helper). - RodType: rename the heatRatio field/accessor/builder methods to ratio (and its codec key "heatRatio" -> "ratio", default unchanged at 1); update all call sites (CNItems rod registration, RodsStats tooltip, ReactorBluePrintMenu's totalHeatRatio -> totalRatio local var and NBT key "totalHeatRatio" -> "totalRatio"). - CRods: change graphiteHeatRatio's default value from -6 to 1, since cooling/heating weighting is now handled by HeatBalance's separate heatPoints/coolingPoints sums rather than by sign. - tooltips.json / regenerated en_us.json, en_ud.json: rename the "heatRatio" tooltip key to "ratio" and reword its text to "Rod Value for ratio: %d".
…unused worldgen imports - ReactorOutputEntity: remove the dead/unused controllerEntity, controller fields and their setController(...)/setSpeed(...)/ getDir()/setDir(...) accessors, plus the overridden tick() method that looked up the reactor controller 3 blocks above and force-set speed to 0 whenever it wasn't found or wasn't assembled — none of this was reachable from outside the class and getGeneratedSpeed() never consulted these fields. Also drop now-unused imports (BlockGetter, Level, CNBlocks, ReactorControllerBlock, ReactorControllerBlockEntity, the static DIR import), a stray commented-out ScrollValueBehaviour field/getGeneratedSpeed body, and redundant blank lines; make the inner ReactorOutputValue class static since it no longer needs an outer-instance reference. - IrradiatedBiomes: remove unused imports (Carvers, MiscOverworldPlacements, GenerationStep) left over from prior worldgen cleanup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.