Percent in chat: Errors

Discussion in 'Plugin Development' started by Bammerbom, Jun 20, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Bammerbom

    Hello everyone!

    Today I was working on a chatlistener in my plugin, but I found a bug.
    When I set the format, if the format contains an % it throws an error. (if you want the error, please comment it).
    Anyone knows how to fix this?
     
  2. Offline

    Garris0n

    No, I'll just use my magical telepathy powers to read the error with my mind.

    Of course we need the error.
    And the code for that matter.
     
    NoLiver92 and viper_monster like this.
  3. Offline

    Bammerbom

    Garris0n
    Code:
    [19:26:30] [Async Chat Thread - #4/ERROR]: Could not pass event AsyncPlayerChatEvent to UltimateCore v0.4.1
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:294) ~[Server.jar:git-Bukkit-1476]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[Server.jar:git-Bukkit-1476]
        at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:35) ~[Server.jar:git-Bukkit-1476]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [Server.jar:git-Bukkit-1476]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:484) [Server.jar:git-Bukkit-1476]
        at net.minecraft.server.v1_7_R3.PlayerConnection.chat(PlayerConnection.java:922) [Server.jar:git-Bukkit-1476]
        at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:862) [Server.jar:git-Bukkit-1476]
        at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [Server.jar:git-Bukkit-1476]
        at net.minecraft.server.v1_7_R3.PacketPlayInChat$1.run(PacketPlayInChat.java:59) [Server.jar:git-Bukkit-1476]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.7.0_21]
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [?:1.7.0_21]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.7.0_21]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.7.0_21]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.7.0_21]
        at java.lang.Thread.run(Unknown Source) [?:1.7.0_21]
    Caused by: java.util.UnknownFormatConversionException: Conversion = '%'
        at org.bukkit.event.player.AsyncPlayerChatEvent.setFormat(AsyncPlayerChatEvent.java:100) ~[Server.jar:git-Bukkit-1476]
        at Bammerbom.UltimateCore.Events.EventChat.ChatListener(EventChat.java:130) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_21]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_21]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_21]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_21]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:292) ~[Server.jar:git-Bukkit-1476]
        ... 14 more
     
  4. Offline

    jebbo

    I got that too I never get it fixxed, i just replaced the % by another symbol but would be great to see a fix.
     
  5. Offline

    Dinosaurs

    Instead of an single %, use two.
    Code:
    %%
    
     
  6. Offline

    Bammerbom

    Dinosaurs
    Got another error now:
    Code:
    [19:54:35] [Async Chat Thread - #0/ERROR]: Could not pass event AsyncPlayerChatEvent to UltimateCore v0.4.1
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:294) ~[Server.jar:git-Spigot-1476]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[Server.jar:git-Spigot-1476]
        at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:35) ~[Server.jar:git-Spigot-1476]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [Server.jar:git-Spigot-1476]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:484) [Server.jar:git-Spigot-1476]
        at net.minecraft.server.v1_7_R3.PlayerConnection.chat(PlayerConnection.java:922) [Server.jar:git-Spigot-1476]
        at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:862) [Server.jar:git-Spigot-1476]
        at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [Server.jar:git-Spigot-1476]
        at net.minecraft.server.v1_7_R3.PacketPlayInChat$1.run(PacketPlayInChat.java:59) [Server.jar:git-Spigot-1476]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.7.0_21]
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [?:1.7.0_21]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.7.0_21]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.7.0_21]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.7.0_21]
        at java.lang.Thread.run(Unknown Source) [?:1.7.0_21]
    Caused by: java.util.FormatFlagsConversionMismatchException: Conversion = b, Flags = 
        at org.bukkit.event.player.AsyncPlayerChatEvent.setFormat(AsyncPlayerChatEvent.java:100) ~[Server.jar:git-Spigot-1476]
        at Bammerbom.UltimateCore.Events.EventChat.ChatListener(EventChat.java:128) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_21]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_21]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_21]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_21]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:292) ~[Server.jar:git-Spigot-1476]
        ... 14 more
    [19:54:35] [Async Chat Thread - #0/INFO]: <Jhtzb> Hi 100% biig boy
     
  7. Offline

    xTigerRebornx

  8. Offline

    Bammerbom

    xTigerRebornx
    How does it work now then? I dont understand the difference.
     
  9. Offline

    xTigerRebornx

    Bammerbom Not sure if they've actually changed it, but the String passed in needs to be a 'compatible format String'
     
  10. Offline

    Dinosaurs

    Is this the string you are trying to format?
    Code:
    <Jhtzb> Hi 100% biig boy
    Are you trying to listen into chat and then format it?
     
  11. Offline

    Bammerbom

    Dinosaurs
    I am trying to format any string with a % inside
    just typed something random xD
    It actually gives errors and then uses the default format.
    My format is Jhtzb: Message
     
  12. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    We support Bukkit plugin development. Seek support where you acquired your server mod.
     
Thread Status:
Not open for further replies.

Share This Page