Flip bool expression (#114)

This commit is contained in:
DevSolaris 2023-02-12 19:44:49 +01:00 committed by GitHub
parent 2be57a66d2
commit 7a26acefd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -252,8 +252,11 @@ public class Warp extends Addon {
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);
final Level addon = (Level) l;
//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;
}).orElse(null);