crashdemons / DisplayItem-Spigot

rewrite of DisplayItem for use in Spigot 1.13+ (uses BungeeChat components)
5 stars 0 forks source link

IAE when item name contains dollar signs or backslashes #14

Closed crashdemons closed 3 years ago

crashdemons commented 3 years ago
29.08 01:12:11 [Server] Async Chat Thread - #0/ERROR Could not pass event AsyncPlayerChatEvent to DisplayItem v2.9.1-SNAPSHOT-20200820234906User
29.08 01:12:11 [Server] INFO java.lang.IllegalArgumentException: Illegal group reference
29.08 01:12:11 [Server] INFO at java.util.regex.Matcher.appendReplacement(Matcher.java:857) ~[?:1.8.0_251]
29.08 01:12:11 [Server] INFO at java.util.regex.Matcher.replaceAll(Matcher.java:955) ~[?:1.8.0_251]
29.08 01:12:11 [Server] INFO at java.lang.String.replaceAll(String.java:2223) ~[?:1.8.0_251]
29.08 01:12:11 [Server] INFO at com.github.crashdemons.displayitem_spigot.MacroReplacements.replaceIgnoreCase(MacroReplacements.java:232) ~[?:?]
29.08 01:12:11 [Server] INFO at com.github.crashdemons.displayitem_spigot.MacroReplacements.replaceAllCached(MacroReplacements.java:257) ~[?:?]
29.08 01:12:11 [Server] INFO at com.github.crashdemons.displayitem_spigot.MacroReplacements.replaceAll(MacroReplacements.java:220) ~[?:?]
29.08 01:12:11 [Server] INFO at com.github.crashdemons.displayitem_spigot.chat.MessageFormatter.formatItemComponents(MessageFormatter.java:33) ~[?:?]
29.08 01:12:11 [Server] INFO at com.github.crashdemons.displayitem_spigot.chat.MessageFormatter.messageInsertItem(MessageFormatter.java:71) ~[?:?]
29.08 01:12:11 [Server] INFO at com.github.crashdemons.displayitem_spigot.chat.ChatLineFormatter.chatLineInsertItem(ChatLineFormatter.java:49) ~[?:?]
29.08 01:12:11 [Server] INFO at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.replaceItem(ChatEventExecutor.java:82) ~[?:?]
29.08 01:12:11 [Server] INFO at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.onChat(ChatEventExecutor.java:116) ~[?:?]
29.08 01:12:11 [Server] INFO at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.onChat(ChatEventExecutor.java:86) ~[?:?]
29.08 01:12:11 [Server] INFO at com.github.crashdemons.displayitem_spigot.chat.ChatEventExecutor.execute(ChatEventExecutor.java:56) ~[?:?]
29.08 01:12:11 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-1.16.2.jar:git-Spigot-b5a13e6-3f57283]
29.08 01:12:11 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) [spigot-1.16.2.jar:git-Spigot-b5a13e6-3f57283]
29.08 01:12:11 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) [spigot-1.16.2.jar:git-Spigot-b5a13e6-3f57283]
29.08 01:12:11 [Server] INFO at net.minecraft.server.v1_16_R2.PlayerConnection.chat(PlayerConnection.java:1619) [spigot-1.16.2.jar:git-Spigot-b5a13e6-3f57283]
29.08 01:12:11 [Server] INFO at net.minecraft.server.v1_16_R2.PlayerConnection.a(PlayerConnection.java:1557) [spigot-1.16.2.jar:git-Spigot-b5a13e6-3f57283]
29.08 01:12:11 [Server] INFO at net.minecraft.server.v1_16_R2.PacketPlayInChat$1.run(PacketPlayInChat.java:41) [spigot-1.16.2.jar:git-Spigot-b5a13e6-3f57283]
29.08 01:12:11 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_251]
29.08 01:12:11 [Server] INFO at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_251]
29.08 01:12:11 [Server] INFO at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_251]
29.08 01:12:11 [Server] INFO at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_251]
29.08 01:12:11 [Server] INFO at java.lang.Thread.run(Thread.java:748) [?:1.8.0_251]
crashdemons commented 3 years ago

item name was $Iᗰᑭ ᗷᑌᑕK$

crashdemons commented 3 years ago

Issue was introduced by the workaround for #11 / v2.9.1 since the case-insensitive regex replacement was not escaped. should be fixed by v2.9.2 dev build 30 https://ci.meme.tips/job/DisplayItem-Spigot/30/

this is NOT related to #13

crashdemons commented 3 years ago

c035e57433af8ce727f8926144907060e08ccaee