Fix Purifier and Environmental Accumulator duplicating items when broken - #1275
Merged
Merged
Conversation
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
Coverage Report for CI Build 36225085602Coverage increased (+1.7%) to 38.19%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions31 previously-covered lines in 3 files lost coverage.
Coverage Stats💛 - Coveralls |
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.
Closes #1274
Cause
Since the port to
preRemoveSideEffects(MC 1.21.5+),BlockEntityTankInventorydrops its inventory on removal.BlockEntityPurifierandBlockEntitySanguinaryEnvironmentalAccumulatoralso overridepreRemoveSideEffects, callsuperand then drop the inventory again.dropItemscopies stacks without clearing, so every item dropped twice.Not present on
master-1.20-ltsormaster-1.21-lts(drops are handled once inBlock#onRemovethere), somaster-1.21is the lowest affected branch.Changes
preRemoveSideEffectsoverrides in both block entities.GameTestsPurifierwas never registered inEvilCraft#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 buildpasses../gradlew runGameTestServer: all 87 tests pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01L65ULANSvQqMQEVKM6uHeV
Generated by Claude Code