how to block all plugins while...

Discussion in 'Plugin Development' started by Danza, Mar 25, 2011.

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

    Danza

    Hi. How to block(disable or somethink - tried event.setCancelled(true) not work as i need) all plugin while my plugin is not done work... Main plugin is antigreif. his must block any commands(like register login and other plugins...). Iv tried it with anjosecurity and withi myself auth plugin.

    with my auth its working fine, but with anjo i see somethink wrong, i still cant type /register and other, but anjo block onPlayerMove and i cant cancel it
    anjo's onPlayerMove:
    Code:
    @Override
        public void onPlayerMove(PlayerMoveEvent event) {
            Player p = event.getPlayer();
            plugin.handleCancellable(p, event);
            if(event.isCancelled()){
                p.teleportTo(event.getFrom());
            }
        }
    how to cancel it? +

    anjo's onPlayerTeleport:
    Code:
    @Override
        public void onPlayerTeleport(PlayerMoveEvent event) {
            Player p = event.getPlayer();
            plugin.handleCancellable(p, event);
            if(event.isCancelled()){
                p.teleportTo(event.getFrom());
            }
        }
    onPlayerTeleport (my plugin) - fix for anjo's onplayerteleport:
    Code:
    Location loc = ...
    event.setTo(loc);
    event.setFrom(loc);
    event.setCancelled(false);
    but what need to do with onplayermove i cant understand. please help! )
     
Thread Status:
Not open for further replies.

Share This Page