Using the same event priority as another plugin..

Discussion in 'Plugin Development' started by Tirelessly, Feb 8, 2014.

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

    Tirelessly

    If PvPTag and WorldGuard both use high priority, and PvPTag sets the event cancelled while WorldGuard sets it uncancelled, what determines whose outcome is the real outcome? Is there a way I can manipulate this to allow both of us to use high priority while letting WorldGuard still take precedence?
     
  2. Offline

    AoH_Ruthless

    Tirelessly
    You could check if the server has a plugin with the name "worldguard". If so, use event.setCancelled(false). If there isn't the plugin, event.setCancelled(true).
     
  3. Offline

    Tirelessly

    AoH_Ruthless But it's more complex than that, as worldguard will only cancel if a specific set of events happens. Does the order that plugins are loaded determine this?
     
  4. Offline

    AoH_Ruthless

    Tirelessly
    I don't think the load order will have any effect on it but I could be wrong..
     
  5. Offline

    zeeveener

    The easiest method would be to put in your plugin.yml a load before statement. That might make your plugin take higher priority than the other. At the same time, it might not make any difference at all.
     
  6. Offline

    ZeusAllMighty11

    I did something like this with WorldGuard. I allowed pvp in a non-pvp region, but WorldGuard takes priority in cancelling the event, so I had to cancel the event on the same priority, and uncancel it on a higher one.
     
  7. Offline

    zeeveener

    If I am not mistaken, WorldGuard does some fancy footwork with how it handles Bukkit right? I'd imagine that WorldGuard is likely forcing itself to take precedence.
     
  8. Offline

    xize

    Tirelessly
    what I know is I hope it for your case that worldguard has a IgnoreIsCancelled in its event which means other plugins can ignore worldguard event and messages and things and actually sort of override it through the cancel states but maybe thats not what you where looking for.

    I believe but I could be mistaken events get odered per plugin enable but each server configuration difference so that couldn't be a good idea but maybe you can trick behaviour through depends or soft-depends in the plugin.yml ?

    I already tried a look if there whas a setPriority in the HandlerList but nope:(

    edit
    you may can try to use the EventPriority.MONITOR perhaps its higher but can't be sure.
     
Thread Status:
Not open for further replies.

Share This Page