From caa4a08b269eeb3bb55dbd059c335dfebb824a3a Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Thu, 23 Apr 2020 09:21:52 +0100 Subject: [PATCH] getOfflinePlayer once --- .../bukkit/placeholder/Placeholders.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/placeholder/Placeholders.java b/Bukkit/src/main/java/com/plotsquared/bukkit/placeholder/Placeholders.java index d0ad0cfdb..c5666fd4b 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/placeholder/Placeholders.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/placeholder/Placeholders.java @@ -105,13 +105,14 @@ public class Placeholders extends PlaceholderExpansion { if (uid == null) { return ""; } - final String name = UUIDHandler.getName(uid); + String name = UUIDHandler.getName(uid); - return (name != null) ? - name : - ((Bukkit.getOfflinePlayer(uid).getName() != null) ? - Bukkit.getOfflinePlayer(uid).getName() : - "unknown"); + if (name != null) { + return name; + } + + name = Bukkit.getOfflinePlayer(uid).getName(); + return name != null ? name : "unknown"; } case "currentplot_world": { return p.getWorld().getName();