Fixed chat color issue

This commit is contained in:
2021-03-27 20:32:32 +01:00
parent b894afafa7
commit 9f50a45f8c
2 changed files with 5 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ package de.web.basman93;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Color;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
@@ -19,7 +19,7 @@ public class KickPlayerOnJoin extends JavaPlugin implements Listener {
private boolean active = true;
private FileConfiguration config = getConfig();
private List<String> playerlist = new ArrayList<String>();
private final String prefix = Color.SILVER + "[K" + Color.GRAY + "P" + Color.SILVER + "OJ] ";
private final String prefix = ChatColor.GRAY + "[K" + ChatColor.DARK_GRAY + "P" + ChatColor.GRAY + "OJ] ";
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
@@ -83,9 +83,9 @@ public class KickPlayerOnJoin extends JavaPlugin implements Listener {
} else {
sender.sendMessage(prefix + "Version: " + getDescription().getVersion());
if(cop(sender, "kpoj.info"))
sender.sendMessage(prefix + "Active: " + (active ? Color.GREEN + "yes" : Color.RED + "no"));
sender.sendMessage(prefix + "Active: " + (active ? ChatColor.GREEN + "yes" : ChatColor.RED + "no"));
if(sender.hasPermission("kpoj.info") && sender instanceof Player)
sender.sendMessage(prefix + "Status: " + (playerlist.contains(sender.getName()) ? Color.GREEN + "Allowed" : Color.RED + "Disallowed"));
sender.sendMessage(prefix + "Status: " + (playerlist.contains(sender.getName()) ? ChatColor.GREEN + "Allowed" : ChatColor.RED + "Disallowed"));
}
return true;
}