Skip to content

Patch scoreboard not getting written#224

Open
farpo wants to merge 4 commits intoLadysnake:1.21from
farpo:patch-scoreboard-writing
Open

Patch scoreboard not getting written#224
farpo wants to merge 4 commits intoLadysnake:1.21from
farpo:patch-scoreboard-writing

Conversation

@farpo
Copy link

@farpo farpo commented Mar 6, 2026

This fixes the bug in which scoreboard components would never be written due to their component data not being checked when determining whether to write the scoreboard.

This bug was reported as issue #222

I've also added a subcommand to the testmod that could make preventing similair bugs easier.

@Pyrofab
Copy link
Member

Pyrofab commented Mar 10, 2026

Hi ! Sorry for not looking at this issue earlier, your contribution is very much appreciated 🙏

Comment on lines +17 to +20
@ModifyExpressionValue(method = "set", at = @At(value = "INVOKE", target = "Lnet/minecraft/scoreboard/ScoreboardState$Packed;equals(Ljava/lang/Object;)Z"))
private boolean compareComponentValues(boolean original, ScoreboardState.Packed packed){
return original && Objects.equals(((CcaPackedState) (Object) packed).cca$getSerializedComponents(), ((CcaPackedState) (Object) packedState).cca$getSerializedComponents());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to directly inject into Packed#equals actually, I'll push the change if you don't object

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