mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-24 19:45:14 +01:00
Update to BentoBox 1.15.4 API
This commit is contained in:
parent
2a31fc9f67
commit
8ad527b462
4
pom.xml
4
pom.xml
@ -36,8 +36,8 @@
|
||||
<powermock.version>2.0.2</powermock.version>
|
||||
<!-- More visible way how to change dependency versions -->
|
||||
<spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version>
|
||||
<bentobox.version>1.14.0</bentobox.version>
|
||||
<level.version>1.6.0</level.version>
|
||||
<bentobox.version>1.15.4</bentobox.version>
|
||||
<level.version>2.5.0</level.version>
|
||||
<vault.version>1.7</vault.version>
|
||||
<!-- Revision variable removes warning about dynamic version -->
|
||||
<revision>${build.version}-SNAPSHOT</revision>
|
||||
|
@ -7,8 +7,9 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import world.bentobox.bentobox.api.events.island.IslandEvent;
|
||||
import world.bentobox.bentobox.api.events.island.IslandEvent.Reason;
|
||||
import world.bentobox.bentobox.api.events.island.IslandCreatedEvent;
|
||||
import world.bentobox.bentobox.api.events.island.IslandRegisteredEvent;
|
||||
import world.bentobox.bentobox.api.events.island.IslandResettedEvent;
|
||||
import world.bentobox.challenges.ChallengesAddon;
|
||||
|
||||
/**
|
||||
@ -24,15 +25,39 @@ public class ResetListener implements Listener {
|
||||
this.addon = addon;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onIslandReset(IslandEvent e) {
|
||||
if (addon.getChallengesSettings().isResetChallenges())
|
||||
{
|
||||
if (e.getReason().equals(IslandEvent.Reason.CREATED) ||
|
||||
e.getReason().equals(IslandEvent.Reason.RESETTED) ||
|
||||
e.getReason().equals(IslandEvent.Reason.REGISTERED)) {
|
||||
addon.getChallengesManager().resetAllChallenges(e.getOwner(), e.getLocation().getWorld(), e.getOwner());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method handles Island Created event.
|
||||
*
|
||||
* @param e Event that must be handled.
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onIslandCreated(IslandCreatedEvent e)
|
||||
{
|
||||
addon.getChallengesManager().resetAllChallenges(e.getOwner(), e.getLocation().getWorld(), e.getOwner());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method handles Island Resetted event.
|
||||
*
|
||||
* @param e Event that must be handled.
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onIslandCreated(IslandResettedEvent e)
|
||||
{
|
||||
addon.getChallengesManager().resetAllChallenges(e.getOwner(), e.getLocation().getWorld(), e.getOwner());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method handles Island Registered event.
|
||||
*
|
||||
* @param e Event that must be handled.
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onIslandCreated(IslandRegisteredEvent e)
|
||||
{
|
||||
addon.getChallengesManager().resetAllChallenges(e.getOwner(), e.getLocation().getWorld(), e.getOwner());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user