mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-01-22 21:41:23 +01:00
Adjust event priority's
This commit is contained in:
parent
d2975ac796
commit
c7101ed5e9
2
pom.xml
2
pom.xml
@ -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>
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user