Improves the generation of the list of available chat colors

This commit is contained in:
Kristian Knarvik 2022-02-09 17:19:51 +01:00
parent 61b05bcce9
commit 28bb6f2109
9 changed files with 13 additions and 20 deletions

View File

@ -45,18 +45,14 @@ import java.util.logging.Logger;
@SuppressWarnings("unused")
public class Stargate extends JavaPlugin {
//Used for changing gate open/closed material.
private static final Queue<BlockChangeRequest> blockChangeRequestQueue = new LinkedList<>();
private static final Queue<ChunkUnloadRequest> chunkUnloadQueue = new PriorityQueue<>();
private static Logger logger;
private static Stargate stargate;
private static String pluginVersion;
private static PluginManager pluginManager;
private static StargateConfig stargateConfig;
private static String updateAvailable = null;
/**
@ -430,4 +426,5 @@ public class Stargate extends JavaPlugin {
public static StargateConfig getStargateConfig() {
return stargateConfig;
}
}

View File

@ -35,4 +35,5 @@ public class CommandStarGate implements CommandExecutor {
return true;
}
}
}

View File

@ -217,22 +217,10 @@ public class ConfigTabCompleter implements TabCompleter {
*/
private List<ChatColor> getChatColors() {
List<ChatColor> chatColors = new ArrayList<>();
chatColors.add(ChatColor.WHITE);
chatColors.add(ChatColor.BLUE);
chatColors.add(ChatColor.DARK_BLUE);
chatColors.add(ChatColor.DARK_PURPLE);
chatColors.add(ChatColor.LIGHT_PURPLE);
chatColors.add(ChatColor.GOLD);
chatColors.add(ChatColor.GREEN);
chatColors.add(ChatColor.BLACK);
chatColors.add(ChatColor.DARK_GREEN);
chatColors.add(ChatColor.DARK_RED);
chatColors.add(ChatColor.RED);
chatColors.add(ChatColor.AQUA);
chatColors.add(ChatColor.DARK_AQUA);
chatColors.add(ChatColor.DARK_GRAY);
chatColors.add(ChatColor.GRAY);
chatColors.add(ChatColor.YELLOW);
char[] colors = new char[]{'a', 'b', 'c', 'd', 'e', 'f', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
for (char color : colors) {
chatColors.add(ChatColor.getByChar(color));
}
chatColors.add(ChatColor.of("#ed76d9"));
chatColors.add(ChatColor.of("#ffecb7"));
return chatColors;

View File

@ -520,4 +520,5 @@ public final class StargateConfig {
public LanguageLoader getLanguageLoader() {
return languageLoader;
}
}

View File

@ -16,6 +16,7 @@ import java.util.Map;
* The Stargate gate config keeps track of all global config values related to gates
*/
public final class StargateGateConfig {
private static final int activeTime = 10;
private static final int openTime = 10;
private final Map<ConfigOption, Object> configOptions;
@ -320,4 +321,5 @@ public final class StargateGateConfig {
PortalSignDrawer.setHighlightColor(ChatColor.WHITE);
}
}
}

View File

@ -49,4 +49,5 @@ public class PluginEventListener implements Listener {
Stargate.logInfo("Vault plugin lost.");
}
}
}

View File

@ -46,4 +46,5 @@ public class WorldEventListener implements Listener {
PortalRegistry.clearPortals(world);
}
}
}

View File

@ -345,4 +345,5 @@ public class Portal {
return cleanNetwork.equalsIgnoreCase(other.cleanNetwork);
}
}
}

View File

@ -448,4 +448,5 @@ public class PortalHandler {
}
return input.replaceAll("[|:#]", "").trim();
}
}