SpigotMC / BungeeCord

BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers.
https://www.spigotmc.org/go/bungeecord
Other
1.56k stars 1.1k forks source link

ProxiedPlayer chat function does not work in 1.19+ #3499

Open MineFact opened 1 year ago

MineFact commented 1 year ago

Bungeecord version

git:BungeeCord-Bootstrap:1.20-R0.1-SNAPSHOT:23fb838:1722

Server version

git-Paper-59 (MC: 1.20.1)

Client version

1.20.1

Bungeecord plugins

The bug

Since Minecraft version 1.19 the proxiedplayer.chat() function no longer seems to work. When you use it on the latest server versions it always creates an error like this:

[13:54:31 WARN]: Error in dispatching command
java.lang.UnsupportedOperationException: Cannot spoof chat on this client version!
        at net.md_5.bungee.UserConnection.chat(UserConnection.java:449) ~[BungeeCord.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
        at net.buildtheearth.proxy.commands.socials.DiscordCommand.execute(DiscordCommand.java:91) ~[?:?]
        at net.buildtheearth.proxy.commands.Command.execute(Command.java:43) ~[?:?]
        at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:213) ~[BungeeCord.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
        at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:164) ~[BungeeCord.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
        at net.md_5.bungee.connection.UpstreamBridge.handleChat(UpstreamBridge.java:212) ~[BungeeCord.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
        at net.md_5.bungee.connection.UpstreamBridge.handle(UpstreamBridge.java:186) ~[BungeeCord.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
        at net.md_5.bungee.protocol.packet.ClientCommand.handle(ClientCommand.java:109) ~[BungeeCord.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
        at net.md_5.bungee.netty.HandlerBoss.channelRead(HandlerBoss.java:114) ~[BungeeCord.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]

One year ago someone mentioned this bug and md-5 said that chat spoofing is no longer supported. (https://github.com/SpigotMC/BungeeCord/issues/3327) Other than that I couldn't find any info anywhere that this function should no longer be used. After one year the chat function is still added with no warning of it being broken since 1.19+.

My request: Could you either make the proxiedplayer.chat() deprecated or add a warning in the function documentation to no longer use it in the latest versions? Otherwise people will continue to have a hard time when trying to use that function and not knowing about the chat signing change in 1.19.

Log output (links)

No response

Checking

Janmm14 commented 1 year ago

Feel free to fork this project, edit and create a PR for it. https://github.com/SpigotMC/BungeeCord/edit/master/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java#L189

xism4 commented 1 year ago

Feel free to fork this project, edit and create a PR for it. https://github.com/SpigotMC/BungeeCord/edit/master/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java#L189

To make that answer you can really save the comment, he followed all the steps to receive a proper answer.

Janmm14 commented 1 year ago

Feel free to fork this project, edit and create a PR for it. https://github.com/SpigotMC/BungeeCord/edit/master/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java#L189

To make that answer you can really save the comment, he followed all the steps to receive a proper answer.

Given the issue is javadoc related, I do not see a problem asking the user to just actually edit it himself.