Backport: sponj — merge sponge blocks, explicit absorption cap (26.1.2) - #85
Merged
Conversation
Wave 1 of docs/backport-26.1.2. Everything Wave 2's mods compile against.
Bug fixes:
- ImplementedInventory.isMatchingPartialStack compared with ItemStack.matches,
which also compares counts, so two otherwise-identical partial stacks only
merged when their counts happened to be equal. Every tryInsert consumer
(minekea shelves/armoires/glass jars, the block painter, the hopper filter)
silently failed to merge partials. Use isSameItemSameComponents. (1.6)
- clearContent now preserves the fixed slot count of a NonNullList.withSize. (4.7)
- BlockConfig.getTexture() used Map.getOrDefault, whose default argument is
evaluated unconditionally, so a config with an explicit texture but no
ingredient threw "No default ingredient set" from a fallback it never needed.
Look the texture up first. (2.4)
New shared API (the Wave 2 dependency surface):
- screen/InventoryScreenHandler - base for fixed-grid container menus (layout,
quickMoveStack, removed()/stopOpen()). Simple/DoubleWide collapse to thin
subclasses that only pin the column count. (3.2, 2.6)
- inventories/ContainerOpenersCounters - factory replacing three hand-rolled
anonymous counters. Takes the menu class as a required parameter and confirms
ownership against the block entity, which is what makes shulker-stuff's 2.5
unrepeatable. (3.5)
- item/AbstractWrenchItem - the wrench logic duplicated byte-for-byte between
minekea and hopper-xtreme. (3.4)
- blocks/BlockUtils - moved here from sponj. (3.9)
- neoforge/loot/LootModifierHelper.createRegister(modId). (3.6)
ColorHelpers: palette arrays are private and handed out only as defensive
copies via a new getTints(String); getTint gains a lower bound. The 26.1.2 flat
Blocks/Items constants are kept - main's ColorCollection accessors
(Blocks.WOOL.red()) do not exist here. (4.7)
Test harness: common/testFixtures publishes BootstrapMinecraft plus
GameTestContainers/Entities/Menus; 9 JUnit classes (43 tests) and 5 fabric
GameTest classes (11 tests) in the never-shipped gametest source set.
Two adaptations the plan did not predict, both now recorded in it:
1. Data components ARE lazily bound on 26.1.2. The plan said the
"Components not bound yet" bake was 26.2-only and should be deleted; that was
inferred from `git grep DATA_COMPONENT_INITIALIZERS 26.1.2` returning nothing,
which only proves the repo never used it. Without the bake, 8 of 43 tests fail;
javap on the 26.1.2 jar shows BuiltInRegistries.DATA_COMPONENT_INITIALIZERS and
DataComponentInitializers.build(Provider) -> List<PendingComponents> with
apply(), identically shaped to 26.2. BootstrapMinecraft keeps main's bake.
This also means minekea must KEEP its datagen component bind - minekea.md,
README.md, docs/TESTING.md and CLAUDE.md are all corrected here.
2. new BlockEntityType<>(factory, blocks) is private on 26.1.2 (public on 26.2).
Mods that call it directly each widen it in their own access widener;
chimeric-lib has none enabled. Rather than add a shipping access widener to
serve a test fixture, the gametest builds the type with fabric-api's public
FabricBlockEntityTypeBuilder - that source set is fabric-only and never ships.
Gate: :chimeric-lib:{common,fabric,neoforge}:build green;
:chimeric-lib:fabric:test 43/43; :chimeric-lib:fabric:runGameTest 11/11.
Backport of e5233d8, e69d6e8, 60a8169, 3aaa3bb, 5315faa, 8d7fa89,
875eaa2, 5f70e69, d0ed03c, 8acc6af, e8aaffb, c392de4.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…icit cap
2.1 - the connected-sponj search is now bounded by an explicit
ModBlocks.MAX_CONNECTED_SPONJES rather than by an obscure distance quirk.
Worth spelling out, because the history reads like a fix and a revert: the
first attempt "corrected" BlockUtils.isWithinDistance for comparing distSqr
against a raw limit, which had capped the flood fill at sqrt(32) ~ 5.7 blocks
instead of 32. That reach turned out to be deliberate load-bounding, not a
units bug - a sponj's clear radius (6 + 3*(n-1)) and block budget (64 * n) both
scale with the connected count, so a large sponj wall at full reach would clear
tens of thousands of liquid blocks in one tick. The shipped behaviour keeps the
bound but states it: n is capped at 16, worst case ~64*16 block updates, and
the constant carries the reasoning so the next reader does not "fix" it again.
3.3 - the four sponge blocks were ~95% identical. Two bases now carry the
logic: AbstractSponjBlock (dry absorb / flood fill, parameterized by fluid tag,
dry-wet block pair, connected-block list, break-particle fluid state, and
whether water-only "washable" replaceables are cleared) and
AbstractWetSponjBlock (dry-out + drip particles). The four leaves shrink to
their constants.
3.9 - sponj's local BlockUtils is deleted; its contents moved to chimeric-lib
in Wave 1 and the imports now point there.
Adds SponjAbsorptionRangeGameTest (4 tests) - the regression gate that makes
the revert-of-a-revert above safe.
Conflicts: SponjBlock and LavaSponjBlock were the two files the 26.2 port also
touched, solely to swap the removed net.minecraft.util.Tuple for
com.mojang.datafixers.util.Pair in the flood-fill queue. No reversal needed -
Pair is a DataFixerUpper class present on 26.1.2 too - and since the payload
rewrites both files onto AbstractSponjBlock anyway, main's version was taken
wholesale. Keeping Pair also avoids gratuitously diverging from main.
Gate: :sponj:{common,fabric,neoforge}:build green;
:sponj:fabric:runGameTest 4/4.
Wave 2 of docs/backport-26.1.2; see sponj.md.
Backport of b72f4be + 04f128e + 6a317eb + d0ed03c + 41ab0ad + 2b53182.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
chimericdream
force-pushed
the
backport/26.1.2/chimeric-lib
branch
from
July 27, 2026 00:43
7c945fb to
c213381
Compare
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.
Wave 2, stacked on #82. Plan:
docs/backport-26.1.2/sponj.md.2.1 — read this bit, the history looks like a fix and a revert
The first attempt "corrected"
BlockUtils.isWithinDistancefor comparingdistSqragainst a raw limit, which had capped the flood fill atsqrt(32) ≈ 5.7blocks instead of 32.That reach turned out to be deliberate load-bounding, not a units bug. A sponj's clear radius (
6 + 3*(n-1)) and block budget (64 * n) both scale with the connected count, so a large sponj wall at full reach would clear tens of thousands of liquid blocks in one tick.The shipped behaviour keeps the bound but states it:
nis capped at 16 viaModBlocks.MAX_CONNECTED_SPONJES, worst case ~64*16block updates, and the constant carries the reasoning so the next reader doesn't "fix" it again.3.3 / 3.9
The four sponge blocks were ~95% identical.
AbstractSponjBlock(dry absorb / flood fill) andAbstractWetSponjBlock(dry-out + drip particles) now carry the logic; the leaves shrink to their constants. sponj's localBlockUtilsis deleted — it moved to chimeric-lib in #82.Adds
SponjAbsorptionRangeGameTest(4 tests) — the regression gate that makes the revert-of-a-revert safe.Conflicts
SponjBlockandLavaSponjBlockwere the two files the 26.2 port also touched, solely to swap the removednet.minecraft.util.Tupleforcom.mojang.datafixers.util.Pair. No reversal needed —Pairis a DataFixerUpper class present on 26.1.2 too — and since the payload rewrites both files ontoAbstractSponjBlockanyway,main's version was taken wholesale. KeepingPairalso avoids gratuitously diverging frommain.Verification
:sponj:fabric:runGameTest4/4; both loaders build.🤖 Generated with Claude Code