Converting to AsyncPlayerChatEvent! Please Help

Discussion in 'Plugin Development' started by 08jne01, Aug 4, 2012.

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

    08jne01

    My plugin relys heavily on the PlayerChatEvent in a different class that implements the listener but now it is changed it doesn't work, I tried just replacing the event but it doesn't even register the event then so, could someone help me please. I am doing a method for when someone chats.
    Code:
    @EventHandler
    public void onPlayerChat(PlayerChatEvent chat){
    //method here
    }
    Can someone convert this to the new AsyncPlayerChatEvent so it actually works, I do have a method where the method would be, but it is very long and irrelivent.

    Can Someone please help instead of explaining what the new AsyncPlayerChatEvent is because i have looked on other forums and threads at what it is already, but just don't understand how to implement it in my plugin.

    Thanks
     
  2. Offline

    mixxit

    @EventHandler
    public void onPlayerChat(AsyncPlayerChatEvent chat){

    //method here
    }

    You mean that?
     
  3. Offline

    slipcor

    Here you go:

    Code:
    @EventHandler
    public void onPlayerChat(AsyncPlayerChatEvent chat){
    //method here
    }
    
    have fun with your irrelevant method :D
     
  4. Offline

    08jne01

    I did that and it didn't even register the event
    Edit: Being an Idiot using the wrong version of craftbukkit, All fine now
     
  5. Offline

    PunJedi

    I am assuming this is purely a developer side fix and nothing that we can do for client side?

    Asking because the new chat event has broken a large number of plugins. Something we can do to fix? Or just wait until all the developers are on board and updated?
     
  6. Offline

    PunJedi


    Huh? I am fully aware that it is a NEW event. Essentially it DID replace it , because it is no longer there.

    PlayerChatEvent becoming the new ASyncplayerChatEvent is the same as "replacing" but my point wasn't arguing about HOW it was done but if WE have any option to fix it until the plugin developers make the change.


    As it stands this broke everything from Worldguard to Towny and just about anything in between.

    And if you had bothered to read what i ACTUALLY posted.....let's review

    "Asking because the new chat event has broken a large number of plugins"

    Imagine that...
     
  7. Hmm, PlayerChatEvent seems to be deprecated... why ?! :confused:
    Anyway, you can still use that tough and ignore the deprecated warning, if it works properly... until a recommended build appears which will definetly have the newer event fixed :}
     
  8. Offline

    tremor

    What Digi said ^ - PlayChatEvent still seems to work (but I wouldn't rely on it) but you should update to the new system. Not speaking for the Bukkit Team but I'm sure they realized the scope of this change. Being depreciated means it will likely become extinct in later releases, giving plugin developers time to get on board. As of Bukkit#1507 the method above worked for me, not sure about any of the earlier builds.
     
Thread Status:
Not open for further replies.

Share This Page