Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.7.10 sendMessage and sending boss bar are broken #182

Open
kangarko opened this issue Jul 11, 2024 · 2 comments
Open

1.7.10 sendMessage and sending boss bar are broken #182

kangarko opened this issue Jul 11, 2024 · 2 comments
Labels
platform: bukkit type: bug Something isn't working

Comments

@kangarko
Copy link

I would like to remove our own implementation of legacy Boss bar in favor of Foundation but it's currently broken.

Code:

audience.showBossBar(BossBar.bossBar(
				Component.text("Test"),
				1F, Color.WHITE, Overlay.PROGRESS));

Stack trace:

18:40:09 INFO]: java.lang.NoSuchMethodError: org.bukkit.entity.Entity.setCustomName(Ljava/lang/String;)V
[18:40:09 INFO]: 	at net.kyori.adventure.platform.bukkit.CraftBukkitFacet$FakeEntity.name(CraftBukkitFacet.java:1372)
[18:40:09 INFO]: 	at net.kyori.adventure.platform.facet.Facet$BossBarEntity.bossBarNameChanged(Facet.java:687)
[18:40:09 INFO]: 	at net.kyori.adventure.platform.facet.Facet$BossBar.bossBarInitialized(Facet.java:525)
[18:40:09 INFO]: 	at net.kyori.adventure.platform.bukkit.CraftBukkitFacet$BossBarWither.bossBarInitialized(CraftBukkitFacet.java:1408)
[18:40:09 INFO]: 	at net.kyori.adventure.platform.facet.FacetBossBarListener.bossBarInitialized(FacetBossBarListener.java:43)
[18:40:09 INFO]: 	at net.kyori.adventure.platform.facet.FacetAudience.showBossBar(FacetAudience.java:413)
[18:40:09 INFO]: 	at net.kyori.adventure.platform.bukkit.BukkitAudience.showBossBar(BukkitAudience.java:107)

Thank you!

@kangarko kangarko changed the title 1.7.10 boss bar is not supported 1.7.10 boss bar is broken Jul 11, 2024
@mbax
Copy link

mbax commented Jul 11, 2024

Pull requests are welcomed!

Happy 10th birthday, 1.7.10 🥳

@kangarko
Copy link
Author

kangarko commented Jul 11, 2024

Happy birthday also! Wow we are getting old fast!

Just found out that even using sendMessage() is broken. This can easily be fixed by only trying to look for the two constructors in the image below in the CraftBukkitFacet class on modern Minecraft versions.

I am unfamiliar with Adventure, I applied a dirty fix with my own library:

a

If you have a hot minute, could you please edit the class using your knowledge?

The second issue is that even after the fix, the \n in Component.text("hello\nworld") are not properly recognized. This is because 1.7.10 needs one component per \n and client does not divide them.

a

Assuming there is a method to split components in Adventure, if someone is knowledgeable enough the pull request should not be too big. Thank you.

@kangarko kangarko changed the title 1.7.10 boss bar is broken 1.7.10 sendMessage and boss bar is broken Jul 11, 2024
@kangarko kangarko changed the title 1.7.10 sendMessage and boss bar is broken 1.7.10 sendMessage and sending boss bar are broken Jul 11, 2024
@kezz kezz added type: bug Something isn't working platform: bukkit labels Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: bukkit type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants