mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-25 03:55:10 +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>
|
<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>
|
||||||
|
@ -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.
|
||||||
|
*
|
||||||
|
* @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)
|
||||||
{
|
{
|
||||||
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());
|
addon.getChallengesManager().resetAllChallenges(e.getOwner(), e.getLocation().getWorld(), e.getOwner());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user