crashdemons / DisplayItem-Spigot

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

Investigation: IllegalArgumentException <[[DI-MESG-MARKER]]> not in message - dependent on plugins/priority. #13

Open crashdemons opened 4 years ago

crashdemons commented 4 years ago

creating a new issue because I want to handle this error better (if it still exists) regardless of other plugin interference and regardless of whether the original issue is closed. from #11 - may be related to #2

normally this should not be possible because the message has [i] (or the replacement string) changed to [[DI-MESG-MARKER]] right before splitting the message, so generally [i] shouldn't be appearing here.

java.lang.IllegalArgumentException: The requested element-string was not located in the message: <[[DI-MESG-MARKER]]>, <§4§l[§c§lAdmin§4§l] §4ChrisTaylor §7» §r[i]>
    at com.github.crashdemons.displayitem_spigot.SplitChatMessage.fromWithExternalReplacement(SplitChatMessage.java:27) ~[?:?]
    at com.github.crashdemons.displayitem_spigot.SplitChatMessage.from(SplitChatMessage.java:45) ~[?:?]
    at com.github.crashdemons.displayitem_spigot.ChatLineFormatter.chatLineInsertItem(ChatLineFormatter.java:55) ~[?:?]
    at com.github.crashdemons.displayitem_spigot.ChatEventExecutor.replaceItem(ChatEventExecutor.java:78) ~[?:?]
    at com.github.crashdemons.displayitem_spigot.ChatEventExecutor.onChat(ChatEventExecutor.java:107) ~[?:?]
    at com.github.crashdemons.displayitem_spigot.ChatEventExecutor.onChat(ChatEventExecutor.java:82) ~[?:?]
    at com.github.crashdemons.displayitem_spigot.ChatEventExecutor.execute(ChatEventExecutor.java:52) ~[?:?]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[patched_1.15.2.jar:git-Paper-380]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.15.2.jar:git-Paper-380]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.15.2.jar:git-Paper-380]
    at net.minecraft.server.v1_15_R1.PlayerConnection.chat(PlayerConnection.java:1782) ~[patched_1.15.2.jar:git-Paper-380]
    at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1697) ~[patched_1.15.2.jar:git-Paper-380]
    at net.minecraft.server.v1_15_R1.PacketPlayInChat$1.run(PacketPlayInChat.java:41) ~[patched_1.15.2.jar:git-Paper-380]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_252]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_252]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
crashdemons commented 4 years ago

looks like this might actually be the case if a plugin is interfering with the bukkit chatevent.getformat() parameter so that it does not have a message format macro.