Skip to content

Fix Purifier and Environmental Accumulator duplicating items when broken - #1275

Merged
rubensworks merged 1 commit into
master-1.21from
claude/quirky-carson-fldi7u
Sep 26, 2026
Merged

rubensworks merged 1 commit into
master-1.21from
claude/quirky-carson-fldi7u

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Closes #1274

Cause

Since the port to preRemoveSideEffects (MC 1.21.5+), BlockEntityTankInventory drops its inventory on removal. BlockEntityPurifier and BlockEntitySanguinaryEnvironmentalAccumulator also override preRemoveSideEffects, call super and then drop the inventory again. dropItems copies stacks without clearing, so every item dropped twice.

Not present on master-1.20-lts or master-1.21-lts (drops are handled once in Block#onRemove there), so master-1.21 is the lowest affected branch.

Changes

  • Removed the redundant preRemoveSideEffects overrides in both block entities.
  • Added game tests that break each block with items inside and assert each item drops exactly once. Both fail without the fix.
  • GameTestsPurifier was never registered in EvilCraft#getGameTestClasses, so its existing tests never ran. Registered it (plus the new accumulator test class). Two existing tests then timed out: the purifier only reached ~52 of the required 60 work ticks within 200 game ticks. Raised their timeouts to 400 and the blacklist test's check delay from 150 to 300 so it actually covers a full purify cycle.

Testing

  • ./gradlew build passes.
  • ./gradlew runGameTestServer: all 87 tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L65ULANSvQqMQEVKM6uHeV


Generated by Claude Code

Both overrode preRemoveSideEffects to drop their inventory, while
BlockEntityTankInventory already does so, causing items to drop twice.

Also registers the previously unregistered Purifier game tests, and
increases their timeouts so they can complete.

Closes #1274

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L65ULANSvQqMQEVKM6uHeV
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 36225085602

Coverage increased (+1.7%) to 38.19%

Details

  • Coverage increased (+1.7%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 31 coverage regressions across 3 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

31 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
org/cyclops/evilcraft/blockentity/BlockEntityPurifier.java 17 58.24%
org/cyclops/evilcraft/blockentity/BlockEntitySanguinaryEnvironmentalAccumulator.java 13 15.17%
org/cyclops/evilcraft/blockentity/BlockEntityBoxOfEternalClosure.java 1 75.76%

Coverage Stats

Coverage Status
Relevant Lines: 15605
Covered Lines: 6860
Line Coverage: 43.96%
Relevant Branches: 5398
Covered Branches: 1161
Branch Coverage: 21.51%
Branches in Coverage %: Yes
Coverage Strength: 2.11 hits per line

💛 - Coveralls

@rubensworks
rubensworks merged commit cf08c3f into master-1.21 Sep 26, 2026
3 checks passed
@rubensworks
rubensworks deleted the claude/quirky-carson-fldi7u branch September 26, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants