From d1a04e0f7de6910da8afc6afeee573be4f307527 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 25 Jun 2017 00:20:19 +1200 Subject: [PATCH] Ask who listens for updates, fix underscore disguises not working --- src/me/libraryaddict/disguise/LibsDisguises.java | 9 +++++++++ .../libraryaddict/disguise/utilities/DisguiseParser.java | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/me/libraryaddict/disguise/LibsDisguises.java b/src/me/libraryaddict/disguise/LibsDisguises.java index b25fc12c..a685f3a9 100644 --- a/src/me/libraryaddict/disguise/LibsDisguises.java +++ b/src/me/libraryaddict/disguise/LibsDisguises.java @@ -174,6 +174,15 @@ public class LibsDisguises extends JavaPlugin { } } }); + + final boolean updates = getConfig().getBoolean("NotifyUpdate"); + + metrics.addCustomChart(new Metrics.SimplePie("updates") { + @Override + public String getValue() { + return updates ? "Enabled" : "Disabled"; + } + }); } @Override diff --git a/src/me/libraryaddict/disguise/utilities/DisguiseParser.java b/src/me/libraryaddict/disguise/utilities/DisguiseParser.java index 18f7d306..aa168da8 100644 --- a/src/me/libraryaddict/disguise/utilities/DisguiseParser.java +++ b/src/me/libraryaddict/disguise/utilities/DisguiseParser.java @@ -185,7 +185,7 @@ public class DisguiseParser { public static DisguisePerm getDisguisePerm(String name) { for (DisguisePerm perm : getDisguisePerms()) { - if (!perm.toReadable().equalsIgnoreCase(name) && !perm.toReadable().replace(" ", "").equalsIgnoreCase(name)) + if (!perm.toReadable().replaceAll("[ |_]", "").equalsIgnoreCase(name.replaceAll("[ |_]", ""))) continue; return perm;