Fixed Placeholders (forgot to add the replacer in Util#sendMessage() )

This commit is contained in:
Poslovitch 2017-05-31 17:13:15 +02:00
parent 0980ab8358
commit 465d85f358
3 changed files with 6 additions and 8 deletions

View File

@ -1,11 +1,8 @@
package us.tastybento.bskyblock; package us.tastybento.bskyblock;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID; import java.util.UUID;
import org.bukkit.Location;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin; 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.IslandsManager;
import us.tastybento.bskyblock.database.managers.OfflineHistoryMessages; import us.tastybento.bskyblock.database.managers.OfflineHistoryMessages;
import us.tastybento.bskyblock.database.managers.PlayersManager; 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; import us.tastybento.bskyblock.util.VaultHelper;
/** /**

View File

@ -10,6 +10,7 @@ import org.bukkit.command.CommandSender;
import us.tastybento.bskyblock.BSkyBlock; import us.tastybento.bskyblock.BSkyBlock;
import us.tastybento.bskyblock.util.nms.NMSAbstraction; import us.tastybento.bskyblock.util.nms.NMSAbstraction;
import us.tastybento.bskyblock.util.placeholders.PlaceholderHandler;
/** /**
* A set of utility methods * A set of utility methods
@ -20,10 +21,12 @@ import us.tastybento.bskyblock.util.nms.NMSAbstraction;
public class Util { public class Util {
private static BSkyBlock plugin = BSkyBlock.getInstance(); 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()) { if (!ChatColor.stripColor(message).trim().isEmpty()) {
for(String part : message.split("\n")){ for(String part : message.split("\n")){
sender.sendMessage(part); receiver.sendMessage(part);
} }
} }
} }

View File

@ -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(){ public static boolean hasHooks(){
return apis != null ? true : false; return apis != null ? true : false;