Fix crash when empty blood fluid container ticks in inventory#1167
Draft
Copilot wants to merge 2 commits intomaster-1.21from
Draft
Fix crash when empty blood fluid container ticks in inventory#1167Copilot wants to merge 2 commits intomaster-1.21from
Copilot wants to merge 2 commits intomaster-1.21from
Conversation
…nd fix consume to handle empty fluid resource Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix automatic blood filler crash with fluid detections
Fix crash when empty blood fluid container ticks in inventory
Mar 6, 2026
Pull Request Test Coverage Report for Build 22777099647Details
💛 - 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.
NeoForge 21.11.38-beta+ made
ResourceHandler.extract()strict about non-empty resources.DamageIndicatedItemFluidContainer.canDrain(cyclopscore) callsextract(getResource(0), ...)— when the item is empty,getResource(0)returnsFluidResource.EMPTY(minecraft:empty), which now throwsIllegalArgumentExceptioninstead of silently returning 0.This surfaced as a server crash whenever an empty
ItemInvigoratingPendant(or anyItemBloodContainer) was in a player's inventory and itsinventoryTickfired:Changes
ItemBloodContainer.canDrain(override): Short-circuits withfalsewhen the item has no fluid viaFluidUtil.getFirstStackContained, avoiding the parent'sextractcall on an empty resource.ItemBloodContainer.consume: Guards thefluidHandler.extract(resource, ...)call withresource.isEmpty()to handle the case where the item is empty but other inventory containers can supply the blood.GameTestsPendant: Two regression game tests — one directly callingclearBadEffectson an emptyItemInvigoratingPendant, one assertingcanConsumereturnsfalseon an emptyItemPrimedPendant.RegistryEntries: AddedITEM_INVIGORATING_PENDANTandITEM_PRIMED_PENDANTtyped holders needed by the new tests.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.