Update to BentoBox API 1.18

This commit is contained in:
tastybento 2021-10-01 17:40:07 -07:00
parent 1b29f7f6ac
commit d212fcee99
5 changed files with 30 additions and 3 deletions

View File

@ -59,7 +59,7 @@
<powermock.version>2.0.9</powermock.version> <powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions --> <!-- More visible way how to change dependency versions -->
<spigot.version>1.17-R0.1-SNAPSHOT</spigot.version> <spigot.version>1.17-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.17.0</bentobox.version> <bentobox.version>1.18.0-SNAPSHOT</bentobox.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>
<!-- Do not change unless you want different name for local builds. --> <!-- Do not change unless you want different name for local builds. -->

View File

@ -203,7 +203,7 @@ public class IslandLevelCalculator {
private long calculateLevel(long blockAndDeathPoints) { private long calculateLevel(long blockAndDeathPoints) {
String calcString = addon.getSettings().getLevelCalc(); String calcString = addon.getSettings().getLevelCalc();
String withValues = calcString.replace("blocks", String.valueOf(blockAndDeathPoints)).replace("level_cost", String.valueOf(this.addon.getSettings().getLevelCost())); String withValues = calcString.replace("blocks", String.valueOf(blockAndDeathPoints)).replace("level_cost", String.valueOf(this.addon.getSettings().getLevelCost()));
return (long)eval(withValues) - this.island.getLevelHandicap() - (addon.getSettings().isZeroNewIslandLevels() ? results.initialLevel.get() : 0); return (long)eval(withValues) - (addon.getSettings().isZeroNewIslandLevels() ? results.initialLevel.get() : 0);
} }
/** /**

View File

@ -3,6 +3,9 @@ package world.bentobox.level.events;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import org.bukkit.event.HandlerList;
import org.eclipse.jdt.annotation.NonNull;
import world.bentobox.bentobox.api.events.IslandBaseEvent; import world.bentobox.bentobox.api.events.IslandBaseEvent;
import world.bentobox.bentobox.database.objects.Island; import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.level.calculators.Results; import world.bentobox.level.calculators.Results;
@ -18,6 +21,17 @@ public class IslandLevelCalculatedEvent extends IslandBaseEvent {
private UUID targetPlayer; private UUID targetPlayer;
private static final HandlerList handlers = new HandlerList();
@Override
public @NonNull HandlerList getHandlers() {
return getHandlerList();
}
public static HandlerList getHandlerList() {
return handlers;
}
/** /**
* @param targetPlayer - target player * @param targetPlayer - target player
* @param island - island * @param island - island

View File

@ -2,6 +2,9 @@ package world.bentobox.level.events;
import java.util.UUID; import java.util.UUID;
import org.bukkit.event.HandlerList;
import org.eclipse.jdt.annotation.NonNull;
import world.bentobox.bentobox.api.events.IslandBaseEvent; import world.bentobox.bentobox.api.events.IslandBaseEvent;
import world.bentobox.bentobox.database.objects.Island; import world.bentobox.bentobox.database.objects.Island;
@ -13,6 +16,16 @@ import world.bentobox.bentobox.database.objects.Island;
public class IslandPreLevelEvent extends IslandBaseEvent { public class IslandPreLevelEvent extends IslandBaseEvent {
private final UUID targetPlayer; private final UUID targetPlayer;
private static final HandlerList handlers = new HandlerList();
@Override
public @NonNull HandlerList getHandlers() {
return getHandlerList();
}
public static HandlerList getHandlerList() {
return handlers;
}
/** /**

View File

@ -2,7 +2,7 @@ name: Level
main: world.bentobox.level.Level main: world.bentobox.level.Level
version: ${version}${build.number} version: ${version}${build.number}
icon: DIAMOND icon: DIAMOND
api-version: 1.17 api-version: 1.18
authors: tastybento authors: tastybento