Update to BentoBox 1.15.4 API

This commit is contained in:
BONNe 2021-01-02 13:32:59 +02:00
parent 2a31fc9f67
commit 8ad527b462
2 changed files with 39 additions and 14 deletions

View File

@ -36,8 +36,8 @@
<powermock.version>2.0.2</powermock.version> <powermock.version>2.0.2</powermock.version>
<!-- More visible way how to change dependency versions --> <!-- More visible way how to change dependency versions -->
<spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version> <spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.14.0</bentobox.version> <bentobox.version>1.15.4</bentobox.version>
<level.version>1.6.0</level.version> <level.version>2.5.0</level.version>
<vault.version>1.7</vault.version> <vault.version>1.7</vault.version>
<!-- Revision variable removes warning about dynamic version --> <!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision> <revision>${build.version}-SNAPSHOT</revision>

View File

@ -7,8 +7,9 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import world.bentobox.bentobox.api.events.island.IslandEvent; import world.bentobox.bentobox.api.events.island.IslandCreatedEvent;
import world.bentobox.bentobox.api.events.island.IslandEvent.Reason; import world.bentobox.bentobox.api.events.island.IslandRegisteredEvent;
import world.bentobox.bentobox.api.events.island.IslandResettedEvent;
import world.bentobox.challenges.ChallengesAddon; import world.bentobox.challenges.ChallengesAddon;
/** /**
@ -24,15 +25,39 @@ public class ResetListener implements Listener {
this.addon = addon; this.addon = addon;
} }
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onIslandReset(IslandEvent e) { /**
if (addon.getChallengesSettings().isResetChallenges()) * This method handles Island Created event.
{ *
if (e.getReason().equals(IslandEvent.Reason.CREATED) || * @param e Event that must be handled.
e.getReason().equals(IslandEvent.Reason.RESETTED) || */
e.getReason().equals(IslandEvent.Reason.REGISTERED)) { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
addon.getChallengesManager().resetAllChallenges(e.getOwner(), e.getLocation().getWorld(), e.getOwner()); 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());
} }
} }