Repository navigation
Fix field not being unset if emptyContents returns false - #14345
Merged
Merged
Conversation
Warriorrrr
approved these changes
Oct 4, 2026
WouterGritter
suggested changes
Oct 4, 2026
Member
There was a problem hiding this comment.
It makes more sense to null itemLeftInHandAfterPlayerBucketEmptyEvent in emptyContents() instead of use(), otherwise the field is only cleared when the failure goes through use() (the field is set and can go stale in emptyContents()). This PR works now, but only because use() is currently the only caller that sees a Player.
It makes more sense to null it right before returning false in emptyContents() (after it had already been set):
if (!level.setBlock(pos, this.content.defaultFluidState().createLegacyBlock(), Block.UPDATE_ALL_IMMEDIATE)
&& !blockState.getFluidState().isSource()) {
itemLeftInHandAfterPlayerBucketEmptyEvent = null; // Paper - Fix PlayerBucketEmptyEvent result itemstack
return false;
}
Contributor
Author
|
Agreed. Updated now. |
WouterGritter
approved these changes
Oct 4, 2026
kennytv
approved these changes
Oct 5, 2026
WinPlay02
added a commit
to WoMa-Entertainment/Icicle
that referenced
this pull request
Oct 5, 2026
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@288d43e1 Add getInstrument method to BlockType PaperMC/Paper#14251 PaperMC/Paper@6bc56abc Add `throws CommandSyntaxException` to BasicCommand PaperMC/Paper#14339 PaperMC/Paper@a9d03827 Fix startup crash using autoEnableOnServerStart in plugin-provided datapacks PaperMC/Paper#14238 PaperMC/Paper@ddb45eb4 Fix incorrect container setChanged() called in optimized hopper patch PaperMC/Paper#14269 PaperMC/Paper@60c8e563 Force absolute positions for item frames PaperMC/Paper@1d254ec4 Fix adding entities with api with already valid passengers PaperMC/Paper#14336 PaperMC/Paper@371c96aa Fix username duplication in chat when defaultRenderer is explicitly set PaperMC/Paper#13868 PaperMC/Paper@6e88e469 Fix possible CME race conditions for post effects PaperMC/Paper#14335 PaperMC/Paper@1a7b6265 Bump JLine to 4.4.6, drop JNI backend as Paper compiles to Java 25 PaperMC/Paper#14323 PaperMC/Paper@1dbde610 Make test block codec conditional PaperMC/Paper@780818ff Clear bucket empty event result when fluid placement fails PaperMC/Paper#14345 PaperMC/Paper@2de3a930 Fix silent ignore of Block#getState(boolean) parameter PaperMC/Paper#14341 PaperMC/Paper@65c408ad Don't remove player twice when disconnected during config switch PaperMC/Paper#14346 PaperMC/Paper@4728a906 Fix bundle contents corruption with item obfuscation and shelves PaperMC/Paper#14352
granny
added a commit
to PurpurMC/Purpur
that referenced
this pull request
Oct 6, 2026
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@288d43e1 Add getInstrument method to BlockType PaperMC/Paper#14251 PaperMC/Paper@6bc56abc Add `throws CommandSyntaxException` to BasicCommand PaperMC/Paper#14339 PaperMC/Paper@a9d03827 Fix startup crash using autoEnableOnServerStart in plugin-provided datapacks PaperMC/Paper#14238 PaperMC/Paper@ddb45eb4 Fix incorrect container setChanged() called in optimized hopper patch PaperMC/Paper#14269 PaperMC/Paper@60c8e563 Force absolute positions for item frames PaperMC/Paper@1d254ec4 Fix adding entities with api with already valid passengers PaperMC/Paper#14336 PaperMC/Paper@371c96aa Fix username duplication in chat when defaultRenderer is explicitly set PaperMC/Paper#13868 PaperMC/Paper@6e88e469 Fix possible CME race conditions for post effects PaperMC/Paper#14335 PaperMC/Paper@1a7b6265 Bump JLine to 4.4.6, drop JNI backend as Paper compiles to Java 25 PaperMC/Paper#14323 PaperMC/Paper@1dbde610 Make test block codec conditional PaperMC/Paper@780818ff Clear bucket empty event result when fluid placement fails PaperMC/Paper#14345 PaperMC/Paper@2de3a930 Fix silent ignore of Block#getState(boolean) parameter PaperMC/Paper#14341 PaperMC/Paper@65c408ad Don't remove player twice when disconnected during config switch PaperMC/Paper#14346 PaperMC/Paper@4728a906 Fix bundle contents corruption with item obfuscation and shelves PaperMC/Paper#14352
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.
If
BucketItem#emptyContentsreturns false, anditemLeftInHandAfterPlayerBucketEmptyEventis set, then it wont unset it since it returned false, making it not callgetEmptySuccessItemwhich clears the field. This simply sets the field tonullif the function returns false