Some events still can not be cancelled at all.

This commit is contained in:
asofold 2012-11-05 13:16:06 +01:00
parent e73620e5c2
commit b2f513b1ad

View File

@ -111,37 +111,34 @@ public class NCPExemptionManager {
exemptPermanently(player.getEntityId(), checkType); exemptPermanently(player.getEntityId(), checkType);
} }
/** /**
* This should be registered before all other listeners of NoCheatPlus. * This should be registered before all other listeners of NoCheatPlus.
* *
* NOTE: For internal use only, DO NOT CALL FROM OUTSIDE. * NOTE: For internal use only, DO NOT CALL FROM OUTSIDE.
* *
* @return the listener * @return the listener
*/ */
public static Listener getListener() { public static Listener getListener() {
return new Listener() { return new Listener() {
@SuppressWarnings("unused") @SuppressWarnings("unused")
@EventHandler( @EventHandler(priority = EventPriority.LOWEST)
ignoreCancelled = true, priority = EventPriority.LOWEST) public void onPlayerJoin(final PlayerJoinEvent event) {
public void onPlayerJoin(final PlayerJoinEvent event) { NCPExemptionManager.registerPlayer(event.getPlayer());
NCPExemptionManager.registerPlayer(event.getPlayer()); }
}
@SuppressWarnings("unused") @SuppressWarnings("unused")
@EventHandler( @EventHandler(priority = EventPriority.MONITOR)
ignoreCancelled = true, priority = EventPriority.MONITOR) public void onPlayerQuit(final PlayerQuitEvent event) {
public void onPlayerQuit(final PlayerQuitEvent event) { NCPExemptionManager.tryToRemove(event.getPlayer());
NCPExemptionManager.tryToRemove(event.getPlayer()); }
}
@SuppressWarnings("unused")
@SuppressWarnings("unused") @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
@EventHandler( public void onPlayerKick(final PlayerKickEvent event) {
ignoreCancelled = true, priority = EventPriority.MONITOR) NCPExemptionManager.tryToRemove(event.getPlayer());
public void onPlayerKick(final PlayerKickEvent event) { }
NCPExemptionManager.tryToRemove(event.getPlayer()); };
} }
};
}
/** /**
* Check if an entity is exempted from a check right now by entity id. * Check if an entity is exempted from a check right now by entity id.