mirror of
https://github.com/LordBoos/boosCooldowns.git
synced 2024-11-01 08:20:32 +01:00
All event handlers are now ignoreCancelled = true, removed old
implementation of this feature.
This commit is contained in:
parent
11985a8d62
commit
f09256f589
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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")) {
|
||||
|
@ -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")) {
|
||||
|
@ -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);
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user