Adjust event priority's

This commit is contained in:
GeorgH93 2018-08-11 19:06:40 +02:00
parent d2975ac796
commit c7101ed5e9
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
2 changed files with 7 additions and 10 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>at.pcgamingfreaks</groupId>
<artifactId>MinePacks</artifactId>
<version>1.17.12</version>
<version>1.17.13-SNAPSHOT</version>
<scm>
<connection>scm:git:git@github.com:GeorgH93/Minepacks.git</connection>

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2014-2017 GeorgH93
* Copyright (C) 2014-2018 GeorgH93
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -48,7 +48,7 @@ public EventListener(MinePacks mp)
joinCooldown = plugin.config.getCommandCooldownAfterJoin();
}
@EventHandler
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onDeath(PlayerDeathEvent event)
{
final Player player = event.getEntity();
@ -78,7 +78,7 @@ public void onFail() {}
}
}
@EventHandler
@EventHandler(priority = EventPriority.MONITOR)
public void onClose(InventoryCloseEvent event)
{
if (event.getInventory() != null && event.getInventory().getHolder() instanceof Backpack && event.getPlayer() instanceof Player)
@ -110,7 +110,7 @@ public void onClose(InventoryCloseEvent event)
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onClick(InventoryClickEvent event)
{
if (event.getInventory() != null && event.getInventory().getHolder() instanceof Backpack && event.getWhoClicked() instanceof Player)
@ -137,7 +137,7 @@ public void onPlayerLoginEvent(PlayerJoinEvent event)
}
}
@EventHandler
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerLeaveEvent(PlayerQuitEvent event)
{
Backpack backpack = plugin.DB.getBackpack(event.getPlayer());
@ -146,9 +146,6 @@ public void onPlayerLeaveEvent(PlayerQuitEvent event)
backpack.save();
if(!backpack.isOpen()) plugin.DB.unloadBackpack(backpack);
}
if(plugin.cooldowns.containsKey(event.getPlayer()))
{
plugin.cooldowns.remove(event.getPlayer());
}
plugin.cooldowns.remove(event.getPlayer());
}
}