From f8d34d7f467594bc5d8cc1c050db4bdad23d91d3 Mon Sep 17 00:00:00 2001 From: Luck Date: Mon, 9 Apr 2018 20:58:52 +0100 Subject: [PATCH] Fix compile --- .../me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java index ab27c5a5..b560701e 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java @@ -48,6 +48,7 @@ import org.bukkit.entity.Player; import java.util.Arrays; import java.util.Objects; +import java.util.Optional; import java.util.UUID; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -337,7 +338,7 @@ public class VaultPermissionHook extends AbstractVaultPermission { Contexts contextForLookup(User user, String world) { MutableContextSet context; - Player player = user == null ? null : this.plugin.getBootstrap().getPlayer(user.getUuid()); + Player player = Optional.ofNullable(user).flatMap(u -> this.plugin.getBootstrap().getPlayer(u.getUuid())).orElse(null); if (player != null) { context = this.plugin.getContextManager().getApplicableContext(player).mutableCopy(); } else {