Solved PlayerChatEvent - Alternative?

Discussion in 'Plugin Development' started by Bubelbub, May 8, 2013.

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

    Bubelbub

    Hey guys,

    anybody knows a alternative for the PlayerChatEvent?

    I think the warning is ok...
    But why is it deprecated -.-


    For example, i used my function like this. (i check the requirements, "close" the event and manage the rest)

    Code:
    @EventHandler(priority = EventPriority.HIGH)
    public void onPlayerChat(PlayerChatEvent e) {
        final String msg = e.getMessage();
        if (this.checkMsg(msg))
        {
            final Player p = e.getPlayer();
            final ChatTest ct = this;
            ct.getServer().getScheduler().runTask(ct, new Runnable()
            {
                @Override
                public void run() {
                    ct.doActionBecauseAd(p, msg);
                }
            });
            e.setCancelled(true);
        }
    }
    Alternatives which be better?
     
  2. Offline

    Burnett1

  3. Offline

    Bubelbub

    Ah thank you ...

    My autocompleter shows only Commands which starts with my input...
    -> "PlayerChat"
    Because that, they doesnt show the "AsyncPlayerChatEvent"....

    I would like it, if the @deprecated messages have a "tip" like "use AsyncPlayerChatEvent instead" ;)
     
  4. Offline

    kiwhen

    Yeah, wouldn't that be great! Oh, wait a minute...

    http://jd.bukkit.org/rb/doxygen/da/d58/deprecated.html#_deprecated000028 :p
     
  5. Offline

    Bubelbub

    Thank you, too :cool:

    Thats my problem:
    I work with the craftbukkit.jar and not with the craftbukkit sources.
    I should read the documentation if i have problems... Then ask...
     
  6. Offline

    Burnett1

    You use the craftbukkit.jar instead of bukkit.jar in your plugins? Or were you needing the NMS
     
Thread Status:
Not open for further replies.

Share This Page