From e72d91503c5dbedd8d768eb48e9c4135cdcc0463 Mon Sep 17 00:00:00 2001 From: Luck Date: Mon, 26 Sep 2016 18:42:46 +0100 Subject: [PATCH] Maybe nicer looking messages --- .../lucko/luckperms/calculators/PermissionCalculator.java | 8 +++++--- .../java/me/lucko/luckperms/commands/CommandManager.java | 4 ++-- .../java/me/lucko/luckperms/commands/MainCommand.java | 2 +- .../main/java/me/lucko/luckperms/commands/SubCommand.java | 2 +- .../main/java/me/lucko/luckperms/constants/Message.java | 4 ++-- default-lang.yml | 4 ++-- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/common/src/main/java/me/lucko/luckperms/calculators/PermissionCalculator.java b/common/src/main/java/me/lucko/luckperms/calculators/PermissionCalculator.java index afc6f9d9f..8f508219e 100644 --- a/common/src/main/java/me/lucko/luckperms/calculators/PermissionCalculator.java +++ b/common/src/main/java/me/lucko/luckperms/calculators/PermissionCalculator.java @@ -50,12 +50,14 @@ public class PermissionCalculator { } public Tristate getPermissionValue(String permission) { + permission = permission.toLowerCase(); + Tristate t = cache.computeIfAbsent(permission, this::lookupPermissionValue); + if (debug) { - plugin.getLog().info("Checking if " + objectName + " has permission: " + permission); + plugin.getLog().info("Checking if " + objectName + " has permission: " + permission + " - (" + t.toString() + ")"); } - permission = permission.toLowerCase(); - return cache.computeIfAbsent(permission, this::lookupPermissionValue); + return t; } private Tristate lookupPermissionValue(String permission) { diff --git a/common/src/main/java/me/lucko/luckperms/commands/CommandManager.java b/common/src/main/java/me/lucko/luckperms/commands/CommandManager.java index 5a2dda683..fdebbf4d1 100644 --- a/common/src/main/java/me/lucko/luckperms/commands/CommandManager.java +++ b/common/src/main/java/me/lucko/luckperms/commands/CommandManager.java @@ -179,9 +179,9 @@ public class CommandManager { } private void sendCommandUsage(Sender sender, String label) { - Util.sendPluginMessage(sender, "&6Running &bLuckPerms v" + plugin.getVersion() + "&6."); + Util.sendPluginMessage(sender, "&2Running &bLuckPerms v" + plugin.getVersion() + "&2."); mainCommands.stream() .filter(c -> c.isAuthorized(sender)) - .forEach(c -> Util.sendPluginMessage(sender, "&e-> &d" + String.format(c.getUsage(), label))); + .forEach(c -> Util.sendPluginMessage(sender, "&3> &a" + String.format(c.getUsage(), label))); } } diff --git a/common/src/main/java/me/lucko/luckperms/commands/MainCommand.java b/common/src/main/java/me/lucko/luckperms/commands/MainCommand.java index dd650608c..2e13b9a49 100644 --- a/common/src/main/java/me/lucko/luckperms/commands/MainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/commands/MainCommand.java @@ -137,7 +137,7 @@ public abstract class MainCommand { */ protected void sendUsage(Sender sender, String label) { if (getSubCommands().isEmpty()) { - Util.sendPluginMessage(sender, "&e-> &d" + String.format(getUsage(), label)); + Util.sendPluginMessage(sender, "&3> &a" + String.format(getUsage(), label)); return; } diff --git a/common/src/main/java/me/lucko/luckperms/commands/SubCommand.java b/common/src/main/java/me/lucko/luckperms/commands/SubCommand.java index 5a188993f..9a86ea2e4 100644 --- a/common/src/main/java/me/lucko/luckperms/commands/SubCommand.java +++ b/common/src/main/java/me/lucko/luckperms/commands/SubCommand.java @@ -103,7 +103,7 @@ public abstract class SubCommand { * @param sender the sender to send the usage to */ public void sendUsage(Sender sender) { - Util.sendPluginMessage(sender, "&e-> &6" + getName() + (usage.isEmpty() ? "" : "&e - &7" + getUsage())); + Util.sendPluginMessage(sender, "&3> &a" + getName() + (usage.isEmpty() ? "" : "&3 - &7" + getUsage())); } /** diff --git a/common/src/main/java/me/lucko/luckperms/constants/Message.java b/common/src/main/java/me/lucko/luckperms/constants/Message.java index f4c23b6e5..be87e4403 100644 --- a/common/src/main/java/me/lucko/luckperms/constants/Message.java +++ b/common/src/main/java/me/lucko/luckperms/constants/Message.java @@ -34,7 +34,7 @@ public enum Message { /* * General & Commands */ - PREFIX("&7&l[&b&lL&a&lP&7&l] &c", false), + PREFIX("&7&l[&b&lL&3&lP&7&l] &c", false), EMPTY("{0}", true), PLAYER_ONLINE("&aOnline", false), PLAYER_OFFLINE("&cOffline", false), @@ -120,7 +120,7 @@ public enum Message { UPDATE_TASK_RUN("&bRunning update task for all online users.", true), INFO( - PREFIX + "&6Running &bLuckPerms v{0}&6 by &bLuck&6." + "\n" + + PREFIX + "&2Running &bLuckPerms v{0}&2 by &bLuck&2." + "\n" + PREFIX + "&f-> &ePlatform: &6{1}" + "\n" + PREFIX + "&f-> &eStorage Method: &6{2}" + "\n" + PREFIX + "&f-> &eServer Name: &6{3}" + "\n" + diff --git a/default-lang.yml b/default-lang.yml index c19a8725b..513c45d52 100644 --- a/default-lang.yml +++ b/default-lang.yml @@ -2,7 +2,7 @@ # Locale: en_US # Author: Luck -prefix: "&7&l[&b&lL&a&lP&7&l] &c" +prefix: "&7&l[&b&lL&3&lP&7&l] &c" empty: "{0}" player-online: "&aOnline" player-offline: "&cOffline" @@ -80,7 +80,7 @@ track-empty: "The track cannot be used as it is empty or contains only one group update-task-run: "&bRunning update task for all online users." info: > - {PREFIX}&6Running &bLuckPerms v{0}&6 by &bLuck&6.\n + {PREFIX}&2Running &bLuckPerms v{0}&2 by &bLuck&2.\n {PREFIX}&f-> &ePlatform: &6{1}\n {PREFIX}&f-> &eStorage Method: &6{2}\n {PREFIX}&f-> &eServer Name: &6{3}\n