Backport: minekea — glass jar, armoire, shutters, demo-world (26.1.2) - #84
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>
…d work The largest payload by file count (4,035) but not by substance: 3,993 of those are datagen output, regenerated here rather than ported. The real work is 24 Java files plus the demo-world generator. Glass jar (the biggest cluster, GlassJarBlockEntity +244/-113): - 1.1a the BE implemented ImplementedInventory but returned null from getItems(), so every inherited Container default NPE'd the moment a vanilla hopper found the jar via `instanceof Container`. Backed by a real NonNullList with the contract implemented properly (reserve cascade on removeItem, lossless extract/putback guard). - 1.1b a one-slot container reads "full" at 64, and a pushing hopper short-circuits on isInventoryFull before it ever calls canPlaceItem - so automation could never fill the jar's compressed reserve. The jar now presents as two slots: slot 0 real, slot 1 a virtual always-empty overflow input that routes into the reserve and yields nothing on extraction. - 1.1c that left slot 1 always empty, so a hopper beside a completely full jar re-probed canPlaceItem (tag lookup + capacity math) every cooldown. At capacity the overflow slot reports a phantom full stack so the hopper stops at isInventoryFull's cheap early-out; the phantom is inert and canTakeItem blocks it from extraction. - 2.2 getBottle() had an unreachable second !hasFluid() check and a dead honey branch: it compared the stored Fluid against ModFluids.HONEY_FLUID, the RegistrySupplier holding it rather than the fluid. Java allows == between a class and an unrelated interface, so it compiled and was always false - a jar of honey could never be bottled. Plus 2.9 hand threading and 2.10 server-side mutation. - 1.4 GlassJarItemEntityCache was keyed on ItemStack, which has no value-based equals/hashCode, so it was effectively identity-keyed: stacks are recreated constantly, nearly every lookup missed and nothing was evicted - an unbounded per-frame client leak. Re-keyed on the components that drive the render state (CUSTOM_DATA, ENTITY_DATA, CUSTOM_NAME) with LRU eviction at 256. Also drops VanillaRegistries.createLookup() from the runtime deserialization path in favour of the level's registryAccess(). - Renderer crash: getFluidColor/getFluidTexture routed through getAttributes(), which only handled honey and milk and threw for anything else - in the render path, for a block that accepts any fluid. A water or lava jar hard-crashed the client. Both platform renderers now handle water/lava/milk/honey and fall back to water rather than throwing. Armoire: chestplates and leggings were displayed by equipping four invisible marker armor stands per block. They are now rendered directly in the BER, under the exact transform LivingEntityRenderer applied to those stands, and the accesswidener swaps ArmorStand setSmall/setMarker for EntityRenderDispatcher.equipmentAssets. OpenShutterHalfBlock: an orphaned open-half (a /setblock, world edit, the demo world, a half-broken shutter) made useWithoutItem and playerWillDestroy cycle OPEN / read WATERLOGGED on whatever non-shutter block sat where the parent should be, which throws. Both paths now bail out. ArmoireBlock gets the same guard. 4.6 CompressedBlocks/DyedBlocks modelled their block tables with oshi.util.tuples - the hardware-info library's Pair/Triplet/Quartet, read via opaque getA().getB()/getC() chains - replaced by named domain records. Pure 1:1 transform. Plus 4.8 ItemStorageBlock fixes, 3.5 ContainerOpenersCounters in the crate and barrel, 3.4 WrenchItem as an AbstractWrenchItem subclass, and the 1.6 consumer fix in ShelfBlockEntity (tryInsert compared the remainder against the input with ItemStack.matches, but the default tryInsert can mutate and return that same instance, so the insert sound never played). Adds 3 GameTests in a new gametest source set (glass jar container contract, glass jar interaction, orphaned shutter half). Adaptations from 26.2: - Beams/Covers/CompressedBlocks were the three CRLF-mismatch files: CRLF in the c5f2cc4 blob, LF here and on main, so the patch could not apply. Took main's version and reversed the colour/copper collections - 144 ColorCollection accessors (GLAZED_TERRACOTTA/DYED_TERRACOTTA/CONCRETE) back to flat constants, noting DYED_TERRACOTTA.white() -> WHITE_TERRACOTTA, not WHITE_DYED_TERRACOTTA; and 11 weathering() chains back to EXPOSED_/WEATHERED_/OXIDIZED_CUT_COPPER. Beams and Covers then reduce to their one real payload line each, the purpur_pillar _top/_side texture fix. - GlassJarBlockEntity: EntityType.byString(id) kept, not 26.2's Identifier.tryParse + ENTITY_TYPE::getOptional chain. - ModDataGenerator KEEPS the DATA_COMPONENT_INITIALIZERS bind - the plan originally said to drop it as 26.2-only; that was wrong (see the Wave 1 commit). valueLookupBuilder is kept over 26.2's builder. - The accesswidener does NOT gain 26.2's TextureSlot.create entry (public here). - GlassJarInteractionGameTest used GameTestHelper.makeMockServerPlayer(GameType), absent on 26.1.2; same fix as houdini-block, a directly-constructed ServerPlayer overriding gameMode(). Datagen regenerated rather than ported. Note the first run silently produced nothing but loot tables and recipes because a stale generated/.cache made the model provider skip every write; clearing .cache forced the real rewrite. Result is 1,501 changed files: 9 real content changes (the purpur_pillar beam/cover models), all byte-identical to main's, and 1,492 recipes that simply drop "count": 1 now that the serializer omits the default - also byte-identical to main's. demo-world regenerates byte-identically, confirming the block set matches. Gate: :minekea:{common,fabric,neoforge}:build green; :minekea:fabric:runGameTest 13/13; :minekea:fabric:runDatagen clean. Wave 2 of docs/backport-26.1.2; see minekea.md. Backport of d460136, 37f1508, 063819c, ac7a0b8, f9f3cc5, a10f4cc, 3defb97, c392de4, 8acc6af, 09fdcaf and the 20 demo-world commits. 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/minekea.md.1,541 files — but only 24 are Java. 1,501 are regenerated datagen output; the rest is the demo-world generator and docs.
Glass jar (the biggest cluster)
ImplementedInventorybut returnednullfromgetItems(), so every inheritedContainerdefault NPE'd the moment a vanilla hopper found the jar viainstanceof Container.isInventoryFullbefore it ever callscanPlaceItem— so automation could never fill the jar's compressed reserve. The jar now presents as two slots, slot 1 being a virtual always-empty overflow input.canPlaceItem(tag lookup + capacity math) every cooldown. At capacity the overflow slot now reports a phantom full stack; it's inert andcanTakeItemblocks extraction.getBottle()had an unreachable second!hasFluid()check and a dead honey branch: it compared the storedFluidagainstModFluids.HONEY_FLUID— theRegistrySupplierholding it, not the fluid. Java permits==between a class and an unrelated interface, so it compiled and was always false: a jar of honey could never be bottled.GlassJarItemEntityCachewas keyed onItemStack, which has no value-basedequals/hashCode— effectively identity-keyed. Stacks are recreated constantly, so nearly every lookup missed and nothing was evicted: an unbounded per-frame client leak.getFluidColor/getFluidTextureonly handled honey and milk and threw for anything else — in the render path, for a block that accepts any fluid. A water or lava jar hard-crashed the client.Elsewhere
OpenShutterHalfBlockan orphaned open-half madeuseWithoutItem/playerWillDestroycycleOPENon whatever non-shutter block sat where the parent should be, which throws. Both paths bail out now.CompressedBlocks/DyedBlocksmodelled their tables withoshi.util.tuples— the hardware-info library'sPair/Triplet/Quartet, read via opaquegetA().getB()chains. Replaced by named records, 1:1.Adds 3 GameTests in a new
gametestsource set.Adaptations
Beams/Covers/CompressedBlocksare the three CRLF-mismatch files, so the patch couldn't apply. Tookmain's version and reversed 144 ColorCollection accessors and 11weathering()chains. NoteDYED_TERRACOTTA.white()→WHITE_TERRACOTTA, notWHITE_DYED_TERRACOTTA. Beams and Covers then reduce to their one real payload line each.EntityType.byString,valueLookupBuilder, and the datagen component bind (the plan's instruction to drop it was wrong — see Backport Wave 1: chimeric-lib shared API, fixes and test harness (26.1.2) #82).GlassJarInteractionGameTestusedmakeMockServerPlayer(GameType), absent on 26.1.2; constructs aServerPlayeroverridinggameMode()instead.Datagen
Regenerated, not ported. ⚠ The first run silently produced only loot tables and recipes because a stale
generated/.cachemade the model provider skip every write — clearing it forced the real rewrite. Result: 9 real content changes (the purpur_pillar models), all byte-identical tomain's, plus 1,492 recipes dropping"count": 1now that the serializer omits the default — also byte-identical tomain's. demo-world regenerates byte-identically.Verification
:minekea:fabric:runGameTest13/13;runDatagenclean; both loaders build.🤖 Generated with Claude Code