CoKTools-Neoforge-mc26.2-26.2.0.40.jar
Curse Maven Snippet
What's new
● Version 26.2.0
• NeoForge 26.2.0.59 update
• Root cause: the hammer area-break loop dropped items but never spawned experience. HammerEvents#onBlockBreak (neoforge) / FabricHammerEvents#onBeforeBlockBreak (fabric) ran state.getDrops(...) + Block.popResource(...) per non-origin block but had no getExpDrop/popExperience/spawnAfterBreak call anywhere in the mod. The origin block gets XP because it goes through vanilla's own break pipeline (ServerPlayerGameMode -> Block.playerDestroy -> spawnAfterBreak); the manually-broken area blocks bypassed it, so only the aimed ore yielded XP. Affected coal/diamond/redstone/lapis/emerald/nether quartz/nether gold, etc.
Fix (both loaders): in the non-creative break branch, after popping item drops, call `state.spawnAfterBreak(serverLevel, pos, tool, true)` for each area block - the exact call vanilla's Block.playerDestroy makes with dropExperience=true. It spawns the block's XP and respects Silk Touch via the passed tool (silk-harvested blocks yield 0 XP), and does NOT re-drop loot (loot stays on the existing getDrops path, so no dupes). Placed inside the existing isCreative else-branch so Creative still grants no XP. Ungated by hammer type, so per the user's decision the TNT 9x9x9 hammer grants XP too (its survival breaks run through the same non-creative branch; only hurtAndBreak remains !isTNTHammer-gated).
Files: CoK_Tools/neoforge/.../util/HammerEvents.java, CoK_Tools/fabric/.../util/FabricHammerEvents.java. Both compile clean; jars built at 26.2.0.36. Maps to TLS-206/TLS-207.
Note: build was verified with an explicit JDK override because CoK_Tools/gradle.properties currently pins org.gradle.java.home=C:/Program Files/Java/jdk-25.0.2, which is not installed on this machine (jdk-25.0.4.1 is) - separate from this fix, flagged to the user.
• Root cause: the multi-block break handlers popped drops and wore the tool for every non-origin area block with no Creative-mode guard. In HammerEvents#onBlockBreak (neoforge) / FabricHammerEvents#onBeforeBlockBreak (fabric), each area block ran state.getDrops(...) + Block.popResource(...) and, for non-TNT hammers, tool.hurtAndBreak(1, ...). The origin block goes through vanilla's own break pipeline, which correctly suppresses drops/wear in Creative — so only the surrounding blocks leaked. Example: 3x3x1 hammer on stone in Creative dropped 8 cobblestone (the 8 non-origin blocks), expected 0.
Fix (both loaders, identical): compute `boolean isCreative = serverPlayer.getAbilities().instabuild;` alongside isTNTHammer. In the break loop, when isCreative, still setBlock(pos, AIR) to remove the block but skip the loot-context build, getDrops, popResource, and hurtAndBreak entirely; the awardStat call is kept for both paths. Non-Creative behaviour is unchanged.
Files: CoK_Tools/neoforge/.../util/HammerEvents.java, CoK_Tools/fabric/.../util/FabricHammerEvents.java. Both compile clean; jars built at 26.2.0.33. Applies to all hammer shapes (3x3x1/3x3x3/5x5x1/5x5x5) and the 9x9x9 TNT hammer (TNT path already skipped hurtAndBreak; now also skips drops in Creative).
NOTE: separate, still-open observation on the same handler (NOT fixed here): a survival area break charges 8 durability for a 9-block 3x3x1 break — the origin's durability is left to vanilla and isn't landing, so it's a 1-point undercharge vs the documented "1 per block". Tracked as a test-plan note pending a design call; do not conflate with this Creative fix.
• Rock Crusher no longer shows the running-machine animation (spinning gears/belts) when it's just holding a water bucket or has rock but no water — the working model now only appears while it's actually crushing.
• The Glass Cutter now Silk-Touch-harvests ice on left-click (packed/blue ice too) and destroys it on right-click, matching its glass and amethyst behaviour.
• Root cause: Maul's scanLeaves() flood-fill was only bounded by a total block-count cap (MAX_SCAN=1000), not by distance from the tree — any contiguous chain of leaf blocks got consumed, so touching canopies/hedges/leaf walls near the chopped tree got eaten too. Fixed by adding a 5-hop max-depth cap on the leaf BFS (CoK_Tools/src/main/java/org/cokteam/coktools/custom/Maul.java, commit 0ab0d1e3 on development). Covers every vanilla tree's natural canopy depth. Compiled and full-built clean; not live-tested.
• Two-part fix, superseding the earlier partial fix (109a0562) which only handled the reverse direction (wrench finding repairable items in the grid):
1. New ExtraGridTickHandler (PlayerTickEvent.Post) replays ItemStack.inventoryTick() every server tick for stacks sitting in EXTRA_INVENTORY/EXTRA_HOTBAR -- vanilla's own Inventory#tick never reaches them since they're plain data attachments, not a real Container, so the wrench's auto-repair (and Scythe's auto-replant) silently never fired while parked there, no matter what capability plumbing existed. Diffs via ItemStack.isSameItemSameComponents + count and only writes back + syncs when something actually changed.
2. Mending_Wrench.inventoryTick now keys off LivingEntity instead of Player: a claimed squad unit (CoK_Legions) wears real equipment via the same EquipmentSlot values, and vanilla ticks equipped items on any LivingEntity, so a wrench worn by a unit now repairs the unit's own gear too. Player-only concepts (main inventory grid, the cross-mod extra-slots capability) stay gated to Player.
Commit bea590cc on development. Compiled and full-built clean; not live-tested.
Not addressed: the report's "also legions units inventory" ask, specifically a wrench sitting IN a unit's own inventory grid (rather than worn) -- Legions doesn't yet have a CoKToolsCapabilities provider for that, left as a follow-up.
• Root cause: Maul's replant-spot search only accepted an air block as valid (findClosestReplantSpot/placeSapling). Mangrove propagules are SimpleWaterloggedBlock and grow standing in swamp water constantly — the isAir()-only check rejected essentially every real mangrove tree's replant spot. Fixed to also accept still water for waterloggable saplings, and to set WATERLOGGED=true when placing into water (commit 0ab0d1e3 on development, same commit as bug #52 — both were in Maul.java). Compiled and full-built clean; not live-tested.
• Fixed Glass Cutters dropping shards instead of a mature Amethyst Cluster when left-click mining.
• 🐞 Please report any bugs or issues you encounter to help improve future updates
This mod has no additional files

