From 465d85f35805c16bcdeb7715578b72cb6124e7c6 Mon Sep 17 00:00:00 2001 From: Poslovitch Date: Wed, 31 May 2017 17:13:15 +0200 Subject: [PATCH] Fixed Placeholders (forgot to add the replacer in Util#sendMessage() ) --- src/main/java/us/tastybento/bskyblock/BSkyBlock.java | 5 ----- src/main/java/us/tastybento/bskyblock/util/Util.java | 7 +++++-- .../bskyblock/util/placeholders/PlaceholderHandler.java | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/us/tastybento/bskyblock/BSkyBlock.java b/src/main/java/us/tastybento/bskyblock/BSkyBlock.java index 13c39dd01..adcaba3c5 100755 --- a/src/main/java/us/tastybento/bskyblock/BSkyBlock.java +++ b/src/main/java/us/tastybento/bskyblock/BSkyBlock.java @@ -1,11 +1,8 @@ package us.tastybento.bskyblock; import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; import java.util.UUID; -import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; @@ -18,8 +15,6 @@ import us.tastybento.bskyblock.database.BSBDatabase.DatabaseType; import us.tastybento.bskyblock.database.managers.IslandsManager; import us.tastybento.bskyblock.database.managers.OfflineHistoryMessages; import us.tastybento.bskyblock.database.managers.PlayersManager; -import us.tastybento.bskyblock.database.objects.Island; -import us.tastybento.bskyblock.database.objects.Island.SettingsFlag; import us.tastybento.bskyblock.util.VaultHelper; /** diff --git a/src/main/java/us/tastybento/bskyblock/util/Util.java b/src/main/java/us/tastybento/bskyblock/util/Util.java index bacf6bafd..180a9c48f 100755 --- a/src/main/java/us/tastybento/bskyblock/util/Util.java +++ b/src/main/java/us/tastybento/bskyblock/util/Util.java @@ -10,6 +10,7 @@ import org.bukkit.command.CommandSender; import us.tastybento.bskyblock.BSkyBlock; import us.tastybento.bskyblock.util.nms.NMSAbstraction; +import us.tastybento.bskyblock.util.placeholders.PlaceholderHandler; /** * A set of utility methods @@ -20,10 +21,12 @@ import us.tastybento.bskyblock.util.nms.NMSAbstraction; public class Util { private static BSkyBlock plugin = BSkyBlock.getInstance(); - public static void sendMessage(CommandSender sender, String message){ + public static void sendMessage(CommandSender receiver, String message){ + message = PlaceholderHandler.replacePlaceholders(receiver, message); + if (!ChatColor.stripColor(message).trim().isEmpty()) { for(String part : message.split("\n")){ - sender.sendMessage(part); + receiver.sendMessage(part); } } } diff --git a/src/main/java/us/tastybento/bskyblock/util/placeholders/PlaceholderHandler.java b/src/main/java/us/tastybento/bskyblock/util/placeholders/PlaceholderHandler.java index 7305c2134..99918094a 100644 --- a/src/main/java/us/tastybento/bskyblock/util/placeholders/PlaceholderHandler.java +++ b/src/main/java/us/tastybento/bskyblock/util/placeholders/PlaceholderHandler.java @@ -94,7 +94,7 @@ public class PlaceholderHandler { } /** - * @return tre if APIs are registered (including Internal), otherwise false + * @return true if APIs are registered (including Internal), otherwise false */ public static boolean hasHooks(){ return apis != null ? true : false;