manuelgu / DiscordMC

A Discord <-> Minecraft Chat Gateway for Spigot
https://www.spigotmc.org/resources/17067
GNU General Public License v2.0
27 stars 15 forks source link

Could not pass AsyncPlayerChatEvent #24

Open Joapple opened 7 years ago

Joapple commented 7 years ago
Show stack trace

[21:06:59 ERROR]: Could not pass event AsyncPlayerChatEvent to DiscordMC v1.4.11-SNAPSHOT
org.bukkit.event.EventException
        at org.bukkit.plugin.EventExecutor$1.execute(EventExecutor.java:46) ~[patched_1.11.2.jar:git-Paper-1057]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:74) ~[patched_1.11.2.jar:git-Paper-1057]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.11.2.jar:git-Paper-1057]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:517) [patched_1.11.2.jar:git-Paper-1057]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [patched_1.11.2.jar:git-Paper-1057]
        at net.minecraft.server.v1_11_R1.PlayerConnection.chat(PlayerConnection.java:1299) [patched_1.11.2.jar:git-Paper-1057]
        at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1214) [patched_1.11.2.jar:git-Paper-1057]
        at net.minecraft.server.v1_11_R1.PacketPlayInChat$1.run(PacketPlayInChat.java:39) [patched_1.11.2.jar:git-Paper-1057]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_121]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
Caused by: java.lang.IllegalArgumentException: Illegal group reference
        at java.util.regex.Matcher.appendReplacement(Matcher.java:857) ~[?:1.8.0_121]
        at java.util.regex.Matcher.replaceAll(Matcher.java:955) ~[?:1.8.0_121]
        at java.lang.String.replaceAll(String.java:2223) ~[?:1.8.0_121]
        at eu.manuelgu.discordmc.listener.ChatListener.onAsyncPlayerChat(ChatListener.java:59) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor145.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$1.execute(EventExecutor.java:44) ~[patched_1.11.2.jar:git-Paper-1057]
        ... 12 more

When this happen, the chat won't get sent to the Discord. Is there something you can fix?

Joapple commented 7 years ago

It seems to happen when someone add a $sign in the chat, if that can help in either the minecraft server or Discord it won't travel with some symbols in it

Joapple commented 7 years ago

Oh also if you @someone the message won't get sent either from discord, this can probably because of the characters stuff not being able to be sent

manuelgu commented 7 years ago

Did you enable mentions in config?

Joapple commented 7 years ago

It is set to true, but if you @ alone it take a random player, should i disable that ?

manuelgu commented 7 years ago

I mean, is sending a @mention not going to relay the chat message? Is that what you mean with if you @someone the message won't get sent either from discord,?

Joapple commented 7 years ago

From minecraft to discord it works, but from discord to minecraft it doesn't if you mention someone, but i am going to disable it in the config for that part, i didn't see when i first enabled it. I don't want players to @joapple from minecraft.

Joapple commented 7 years ago

also another error shown up, \ is throwing error that escape character is missing

Show stack trace

[15:17:00] [Async Chat Thread - #18/ERROR]: Could not pass event AsyncPlayerChatEvent to DiscordMC v1.4.11-SNAPSHOT
org.bukkit.event.EventException
    at org.bukkit.plugin.EventExecutor$1.execute(EventExecutor.java:46) ~[patched_1.11.2.jar:git-Paper-1063]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:74) ~[patched_1.11.2.jar:git-Paper-1063]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.11.2.jar:git-Paper-1063]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:517) [patched_1.11.2.jar:git-Paper-1063]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [patched_1.11.2.jar:git-Paper-1063]
    at net.minecraft.server.v1_11_R1.PlayerConnection.chat(PlayerConnection.java:1299) [patched_1.11.2.jar:git-Paper-1063]
    at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1214) [patched_1.11.2.jar:git-Paper-1063]
    at net.minecraft.server.v1_11_R1.PacketPlayInChat$1.run(PacketPlayInChat.java:39) [patched_1.11.2.jar:git-Paper-1063]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_121]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_121]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
Caused by: java.lang.IllegalArgumentException: character to be escaped is missing
    at java.util.regex.Matcher.appendReplacement(Matcher.java:809) ~[?:1.8.0_121]
    at java.util.regex.Matcher.replaceAll(Matcher.java:955) ~[?:1.8.0_121]
    at java.lang.String.replaceAll(String.java:2223) ~[?:1.8.0_121]
    at eu.manuelgu.discordmc.listener.ChatListener.onAsyncPlayerChat(ChatListener.java:59) ~[?:?]
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor141.execute(Unknown Source) ~[?:?]
    at org.bukkit.plugin.EventExecutor$1.execute(EventExecutor.java:44) ~[patched_1.11.2.jar:git-Paper-1063]
    ... 12 more
Joapple commented 7 years ago

Okay did more testing, if i have mentions disabled in the config, if i do @ some message here, it won't get sent to discord. If i mention someone in discord with @Joapple it won't get sent to minecraft. Is the the behaviour that supposed to happen?

manuelgu commented 7 years ago

Definitely not. Will be looking into it.