diff --git a/pom.xml b/pom.xml index 54e14c5..fb8fce4 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.16.3-R0.1-SNAPSHOT 1.15.4 - 1.5.0 + 2.7.0-SNAPSHOT ${build.version}-SNAPSHOT diff --git a/src/main/java/world/bentobox/warps/Warp.java b/src/main/java/world/bentobox/warps/Warp.java index 7d19c89..565c661 100644 --- a/src/main/java/world/bentobox/warps/Warp.java +++ b/src/main/java/world/bentobox/warps/Warp.java @@ -210,10 +210,18 @@ public class Warp extends Addon { * Get the island level * @param world - world * @param uniqueId - player's UUID - * @return island level or null if there is no level plugin + * @return island level or null if there is no level plugin or Level is not operating in this world */ public Long getLevel(World world, UUID uniqueId) { - return this.getPlugin().getAddonsManager().getAddonByName(LEVEL_ADDON_NAME).map(l -> ((Level) l).getIslandLevel(world, uniqueId)).orElse(null); + // Get name of the game mode + String name = this.getPlugin().getIWM().getAddon(world).map(g -> g.getDescription().getName()).orElse(""); + return this.getPlugin().getAddonsManager().getAddonByName(LEVEL_ADDON_NAME) + .map(l -> { + if (!name.isEmpty() && ((Level) l).getSettings().getGameModes().contains(name)) { + return ((Level) l).getIslandLevel(world, uniqueId); + } + return null; + }).orElse(null); } /* (non-Javadoc)