From 9ffbd9e2721192634981968fc104b84ba2342947 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 11 Aug 2020 08:08:55 +1200 Subject: [PATCH] Add better /ld uploadlogs info, name placeholder now does displayname too --- .../disguise/commands/DisguiseBaseCommand.java | 11 +++++++---- .../disguise/commands/libsdisguises/LDUploadLogs.java | 7 ++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java b/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java index 5dd40fc4..d3476e39 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java @@ -15,6 +15,7 @@ import me.libraryaddict.disguise.utilities.params.ParamInfoManager; import me.libraryaddict.disguise.utilities.parser.DisguiseParser; import me.libraryaddict.disguise.utilities.parser.DisguisePerm; import me.libraryaddict.disguise.utilities.parser.DisguisePermissions; +import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandExecutor; @@ -50,7 +51,9 @@ public abstract class DisguiseBaseCommand implements CommandExecutor { protected boolean isNotPremium(CommandSender sender) { if (sender instanceof Player && !sender.isOp() && (!LibsPremium.isPremium() || LibsPremium.getPaidInformation() == LibsPremium.getPluginInformation())) { - sender.sendMessage(ChatColor.RED + "This is the free version of Lib's Disguises, player commands are limited to console and Operators only! Purchase the plugin for non-admin usage!"); + sender.sendMessage(ChatColor.RED + + "This is the free version of Lib's Disguises, player commands are limited to console and " + + "Operators only! Purchase the plugin for non-admin usage!"); return true; } @@ -211,10 +214,10 @@ public abstract class DisguiseBaseCommand implements CommandExecutor { if (team == null) { team = ((Player) player).getScoreboard().getEntryTeam(((Player) player).getUniqueId().toString()); + } - if (team == null) { - return player.getName(); - } + if (team == null || (StringUtils.isEmpty(team.getPrefix()) && StringUtils.isEmpty(team.getSuffix()))) { + return ((Player) player).getDisplayName(); } return team.getPrefix() + team.getColor() + player.getName() + team.getSuffix(); diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUploadLogs.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUploadLogs.java index dcc60736..96631262 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUploadLogs.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUploadLogs.java @@ -17,11 +17,8 @@ import java.io.*; import java.net.URL; import java.net.URLEncoder; import java.nio.file.Files; +import java.util.*; import java.util.AbstractMap.SimpleEntry; -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; /** * Created by libraryaddict on 18/06/2020. @@ -101,7 +98,7 @@ public class LDUploadLogs implements LDCommand { @Override public List getTabComplete() { - return Collections.singletonList("uploadlogs"); + return Arrays.asList("uploadlog", "uploadlogs", "uploadconfig", "uploadconfigs"); } @Override