From bf5862942a45643144c4ed9a3df2f3582f863893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Sat, 18 Apr 2020 22:26:13 +0200 Subject: [PATCH] Disable prefixes for flag info headers and footers and suppress NPE in the update utility --- .../bukkit/listener/PlayerEvents.java | 26 +++++++++---------- .../core/configuration/Captions.java | 4 +-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java index b13197be0..af9c43ef7 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java @@ -673,19 +673,19 @@ public class PlayerEvents extends PlotListener implements Listener { return; } - if (!UpdateUtility.internalVersion.equals(UpdateUtility.spigotVersion)) { - new PlotMessage("-----------------------------------").send(pp); - new PlotMessage( - Captions.PREFIX + "There appears to be a PlotSquared update available!") - .color("$1").tooltip("https://www.spigotmc.org/resources/1177/updates") - .send(pp); - new PlotMessage(Captions.PREFIX + "The latest version is " + spigotVersion) - .color("$1").tooltip("https://www.spigotmc.org/resources/1177/updates") - .send(pp); - new PlotMessage(Captions.PREFIX + "https://www.spigotmc.org/resources/1177/updates") - .color("$1").tooltip("https://www.spigotmc.org/resources/1177/updates") - .send(pp); - new PlotMessage("-----------------------------------").send(pp); + try { + if (!UpdateUtility.internalVersion.equals(UpdateUtility.spigotVersion)) { + new PlotMessage("-----------------------------------").send(pp); + new PlotMessage(Captions.PREFIX + "There appears to be a PlotSquared update available!") + .color("$1").tooltip("https://www.spigotmc.org/resources/1177/updates").send(pp); + new PlotMessage(Captions.PREFIX + "The latest version is " + spigotVersion).color("$1").tooltip("https://www.spigotmc.org/resources/1177/updates") + .send(pp); + new PlotMessage(Captions.PREFIX + "https://www.spigotmc.org/resources/1177/updates") + .color("$1").tooltip("https://www.spigotmc.org/resources/1177/updates").send(pp); + new PlotMessage("-----------------------------------").send(pp); + } + } catch (final Exception e) { + e.printStackTrace(); } } } diff --git a/Core/src/main/java/com/plotsquared/core/configuration/Captions.java b/Core/src/main/java/com/plotsquared/core/configuration/Captions.java index 8dcebcb43..fc72306a4 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/Captions.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/Captions.java @@ -568,8 +568,8 @@ public enum Captions implements Caption { FLAG_PARSE_ERROR("$2Failed to parse flag '%flag_name%', value '%flag_value%': %error%", "Flag"), // // - FLAG_INFO_HEADER("$3&m---------&r $1Plot² Flags $3&m---------", "Flag"), - FLAG_INFO_FOOTER("$3&m---------&r $1Plot² Flags $3&m---------", "Flag"), + FLAG_INFO_HEADER("$3&m---------&r $1Plot² Flags $3&m---------", false, "Flag"), + FLAG_INFO_FOOTER("$3&m---------&r $1Plot² Flags $3&m---------", false, "Flag"), FLAG_INFO_COLOR_KEY("$1", "Flag"), FLAG_INFO_COLOR_VALUE("$2", "Flag"), FLAG_INFO_NAME("Name: ", "Flag"),