All event handlers are now ignoreCancelled = true, removed old

implementation of this feature.
This commit is contained in:
Boosik 2014-02-16 00:00:51 +01:00
parent 11985a8d62
commit f09256f589
10 changed files with 10 additions and 34 deletions

View File

@ -166,11 +166,8 @@ public class BoosCoolDownListener implements Listener {
* @param event
* ud<EFBFBD>lost PlayerCommandPreprocessEvent
*/
@EventHandler(priority = EventPriority.LOWEST)
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
private void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
if (event.isCancelled()) {
return;
}
Player player = event.getPlayer();
String originalCommand = event.getMessage().replace("\\", "\\\\");
originalCommand = originalCommand.replace("$", "S");

View File

@ -34,11 +34,8 @@ public class BoosEntityDamageListener implements Listener {
* @param event
* událost EntityDamageEvent
*/
@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
private void onEntityDamage(EntityDamageEvent event) {
if (event.isCancelled())
return;
Entity entity = event.getEntity();
if (entity != null && entity instanceof Player) {
Player player = (Player) entity;

View File

@ -29,7 +29,7 @@ public class BoosPlayerDeathListener implements Listener {
* @param event
* událost PlayerDeathEvent
*/
@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
private void onPlayerDeath(PlayerDeathEvent event) {
Entity entity = event.getEntity();
if (entity != null && entity instanceof Player) {

View File

@ -34,11 +34,8 @@ public class BoosPlayerGameModeChangeListener implements Listener {
* @param event
* událost PlayerGameModeChangeEvent
*/
@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
private void onPlayerGameModeChange(PlayerGameModeChangeEvent event) {
if (event.isCancelled())
return;
Entity entity = event.getPlayer();
if (entity != null && entity instanceof Player) {
Player player = (Player) entity;

View File

@ -35,11 +35,8 @@ public class BoosPlayerInteractListener implements Listener {
* @param event
* událost PlayerInteractEvent
*/
@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
private void onPlayerInteract(PlayerInteractEvent event) {
if (event.isCancelled())
return;
Entity entity = event.getPlayer();
if (entity != null && entity instanceof Player) {
Player player = (Player) entity;

View File

@ -61,11 +61,8 @@ public class BoosPlayerMoveListener implements Listener {
* @param event
* událost PlayerMoveEvent
*/
@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
private void onPlayerMove(PlayerMoveEvent event) {
if (event.isCancelled()) {
return;
}
if (tempTimer < 20) {
tempTimer = tempTimer + 1;
return;

View File

@ -32,11 +32,8 @@ public class BoosPlayerToggleSneakListener implements Listener {
* @param event
* událost PlayerToggleSneakEvent
*/
@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
private void onPlayerToggleSneak(PlayerToggleSneakEvent event) {
if (event.isCancelled())
return;
Player player = event.getPlayer();
if (player != null
&& !player.hasPermission("booscooldowns.nocancel.sneak")) {

View File

@ -32,11 +32,8 @@ public class BoosPlayerToggleSprintListener implements Listener {
* @param event
* událost PlayerToggleSprintEvent
*/
@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
private void onPlayerToggleSprint(PlayerToggleSprintEvent event) {
if (event.isCancelled())
return;
Player player = event.getPlayer();
if (player != null
&& !player.hasPermission("booscooldowns.nocancel.sprint")) {

View File

@ -17,11 +17,8 @@ public class BoosSignChangeListener implements Listener {
/**
* @param event
*/
@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
private void onSignChange(SignChangeEvent event) {
if (event.isCancelled())
return;
Player player = event.getPlayer();
String line1 = event.getLine(0);
String line2 = event.getLine(1);

View File

@ -30,7 +30,7 @@ public class BoosSignInteractListener implements Listener {
/**
* @param event
*/
@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
private void onSignInteract(PlayerInteractEvent event) {
String msg;
if (event.isCancelled())