mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-22 18:26:08 +01:00
Correctly replace color codes after replacing PlaceholderAPI placeholder
A user reported that user/group prefixes may containt color codes like `&e` which are not replaced in the end to be rendered correctly I believe the responsible plugin should take care of that but apparently there are multiple... So we just replace them in the end ^^
This commit is contained in:
parent
f22ac073f7
commit
2e37efefd4
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user