Skip to content

Fix usages of ItemStack.save with setNewCompoundTag - #65

Merged
RobertCochran merged 1 commit into
PC-Logix:main-MC1.21.1from
SquidDev:fix-stack-save
Aug 22, 2026
Merged

Fix usages of ItemStack.save with setNewCompoundTag#65
RobertCochran merged 1 commit into
PC-Logix:main-MC1.21.1from
SquidDev:fix-stack-save

Conversation

@SquidDev

Copy link
Copy Markdown
Collaborator

setNewCompoundTag(key, tag => ...) expects the lambda to mutate the tag. However, we were calling this like setNewCompoundTag(key, _ => stack.save(registries)), which means we never actually save the stack. The correct usage should either be .put(stack.save(...)) (which is what we use here) or .setNewCompoundTag(stack.save(..., _)).

This is the cause of #64 too, but in that case deleting the overrides is sufficient.

The correct usage should either be .put(stack.save(...)) or
.setNewCompoundTag(stack.save(..., _)), otherwise we just discard the
stack.
@RobertCochran
RobertCochran merged commit cda7eda into PC-Logix:main-MC1.21.1 Aug 22, 2026
1 check passed
@SquidDev
SquidDev deleted the fix-stack-save branch August 22, 2026 06:43
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.

2 participants