diff --git a/src/main/java/com/craftaro/skyblock/placeholder/PlaceholderManager.java b/src/main/java/com/craftaro/skyblock/placeholder/PlaceholderManager.java index 426b6dcc..6948711f 100644 --- a/src/main/java/com/craftaro/skyblock/placeholder/PlaceholderManager.java +++ b/src/main/java/com/craftaro/skyblock/placeholder/PlaceholderManager.java @@ -3,25 +3,25 @@ package com.craftaro.skyblock.placeholder; import com.craftaro.skyblock.SkyBlock; import com.craftaro.skyblock.manager.Manager; import com.craftaro.skyblock.placeholder.hook.PlaceholderAPI; +import net.md_5.bungee.api.ChatColor; import org.bukkit.entity.Player; import org.bukkit.plugin.PluginManager; public class PlaceholderManager extends Manager { - private boolean placeholderAPIEnabled = false; + private final PlaceholderAPI skyBlockPlaceholderAPI; + private final boolean placeholderAPIEnabled; public PlaceholderManager(SkyBlock plugin) { super(plugin); + this.skyBlockPlaceholderAPI = new PlaceholderAPI(this.plugin); - PluginManager pluginManager = plugin.getServer().getPluginManager(); - - if (pluginManager.getPlugin("PlaceholderAPI") != null) { - this.placeholderAPIEnabled = true; - } + PluginManager pluginManager = this.plugin.getServer().getPluginManager(); + this.placeholderAPIEnabled = pluginManager.getPlugin("PlaceholderAPI") != null; } public void registerPlaceholders() { if (this.placeholderAPIEnabled) { - new PlaceholderAPI(this.plugin).register(); + this.skyBlockPlaceholderAPI.register(); } } @@ -34,6 +34,7 @@ public class PlaceholderManager extends Manager { if (this.placeholderAPIEnabled) { retValue = me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(player, message); + retValue = ChatColor.translateAlternateColorCodes('&', retValue); } return retValue; }