Flip bool expression (#114)
This commit is contained in:
parent
2be57a66d2
commit
7a26acefd9
|
@ -252,8 +252,11 @@ public class Warp extends Addon {
|
||||||
String name = this.getPlugin().getIWM().getAddon(world).map(g -> g.getDescription().getName()).orElse("");
|
String name = this.getPlugin().getIWM().getAddon(world).map(g -> g.getDescription().getName()).orElse("");
|
||||||
return this.getPlugin().getAddonsManager().getAddonByName(LEVEL_ADDON_NAME)
|
return this.getPlugin().getAddonsManager().getAddonByName(LEVEL_ADDON_NAME)
|
||||||
.map(l -> {
|
.map(l -> {
|
||||||
if (!name.isEmpty() && ((Level) l).getSettings().getGameModes().contains(name)) {
|
final Level addon = (Level) l;
|
||||||
return ((Level) l).getIslandLevel(world, uniqueId);
|
//getGameModes is a list of gamemodes that Level is DISABLED in,
|
||||||
|
//so we need the opposite of the contains.
|
||||||
|
if (!name.isEmpty() && !addon.getSettings().getGameModes().contains(name)) {
|
||||||
|
return addon.getIslandLevel(world, uniqueId);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}).orElse(null);
|
}).orElse(null);
|
||||||
|
|
Loading…
Reference in New Issue