SpongePowered / Sponge

The SpongeAPI implementation targeting vanilla Minecraft and 3rd party platforms.
MIT License
374 stars 210 forks source link

Stack overflow on Objective#updateDisplayName and Objective#updateDisplayMode #3263

Open thibaulthenry opened 3 years ago

thibaulthenry commented 3 years ago
SpongeVanilla version: 1.16.4-8.0.0 (commit 29d45444b0694c80836dd5298e503f4724188781)
Java version: 8
Operating System: Windows 10
Plugins: Cosmos

Hey, I'm publishing this issue now otherwise I'll forget to do it. As the title says:

[21:43:47] [Server thread/ERROR] [Sponge/]:  Exception Details:                                                                                                  
[21:43:47] [Server thread/ERROR] [Sponge/]:      java.lang.StackOverflowError: null                                                                              
[21:43:47] [Server thread/ERROR] [Sponge/]:      org.spongepowered.common.adventure.SpongeAdventure.asAdventure(SpongeAdventure.java:190)                        
[21:43:47] [Server thread/ERROR] [Sponge/]:      net.minecraft.scoreboard.ScoreObjective.handler$zfb000$onSetDisplayName(ScoreObjective.java:1076)               
[21:43:47] [Server thread/ERROR] [Sponge/]:      net.minecraft.scoreboard.ScoreObjective.setDisplayName(ScoreObjective.java)                                     
[21:43:47] [Server thread/ERROR] [Sponge/]:      org.spongepowered.common.scoreboard.SpongeObjective.updateDisplayName(SpongeObjective.java:200)                 
[21:43:47] [Server thread/ERROR] [Sponge/]:      org.spongepowered.common.scoreboard.SpongeObjective.setDisplayName(SpongeObjective.java:86)   

Same stack with updateDisplayMode

I'll try to look deeper and make a PR fix in the next days

Thanks for reading this issue.

JBYoshi commented 3 years ago

Does this still happen on the latest versions? Running this code on commit 02135c2a9b6d824725a44813c819de705b6242b9 seems to work fine:

Objective obj = Objective.builder().name("test").displayName(Component.text("Test"))
        .criterion(Criteria.DUMMY).build();
obj.setDisplayName(Component.text("Test 2"));
thibaulthenry commented 3 years ago

Hey @JBYoshi I will be really busy for the next weeks because I'm spending my free time on another project in my job.

I'll not be able to try the latest commit

JBYoshi commented 3 years ago

If you could find some time to provide some more specific instructions on how to reproduce this, or find a longer version of the error trace in your old logs, that could also be helpful.