Java Code Examples for org.bukkit.ChatColor#GOLD
The following examples show how to use
org.bukkit.ChatColor#GOLD .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MultipleCommandAliasHelpTopic.java From Thermos with GNU General Public License v3.0 | 6 votes |
public MultipleCommandAliasHelpTopic(MultipleCommandAlias alias) { this.alias = alias; name = "/" + alias.getLabel(); // Build short text StringBuilder sb = new StringBuilder(); for (int i = 0; i < alias.getCommands().length; i++) { if (i != 0) { sb.append(ChatColor.GOLD + " > " + ChatColor.WHITE); } sb.append("/"); sb.append(alias.getCommands()[i].getLabel()); } shortText = sb.toString(); // Build full text fullText = ChatColor.GOLD + "Alias for: " + ChatColor.WHITE + getShortText(); }
Example 2
Source File: PingArgument.java From Hawk with GNU General Public License v3.0 | 6 votes |
private ChatColor pingZoneColor(int millis) { int zone = millis / 50; if(zone < 1) { return ChatColor.AQUA; } if(zone < 2) { return ChatColor.GREEN; } if(zone < 3) { return ChatColor.YELLOW; } if(zone < 4) { return ChatColor.GOLD; } return ChatColor.RED; }
Example 3
Source File: MOTD.java From CardinalPGM with MIT License | 6 votes |
@EventHandler(priority = EventPriority.LOWEST) public void onServerListPing(ServerListPingEvent event) { String name = match.getLoadedMap().getName(); ChatColor color = ChatColor.GRAY; switch (match.getState()) { case ENDED: color = ChatColor.AQUA; break; case PLAYING: color = ChatColor.GOLD; break; case STARTING: color = ChatColor.GREEN; break; } event.setMotd(color + "\u00BB " + ChatColor.AQUA + name + color + " \u00AB" + (!Config.motdMessage.equals("") ? "\n" + ChatColor.translateAlternateColorCodes('`', Config.motdMessage) : "")); }
Example 4
Source File: GeneralSection.java From HeavySpleef with GNU General Public License v3.0 | 6 votes |
public GeneralSection(ConfigurationSection section) { String prefix = section.getString("spleef-prefix"); if (prefix != null) { this.spleefPrefix = ChatColor.translateAlternateColorCodes(TRANSLATE_CHAR, prefix); } else { this.spleefPrefix = ChatColor.DARK_GRAY + "[" + ChatColor.GOLD + ChatColor.BOLD + "Spleef" + ChatColor.DARK_GRAY + "]"; } this.whitelistedCommands = section.getStringList("command-whitelist"); String vipPrefix = section.getString("vip-prefix"); if (vipPrefix != null) { this.vipPrefix = ChatColor.translateAlternateColorCodes(TRANSLATE_CHAR, vipPrefix); } else { this.vipPrefix = ChatColor.RED.toString(); } this.vipJoinFull = section.getBoolean("vip-join-full", true); this.pvpTimer = section.getInt("pvp-timer", 0); this.broadcastGameStart = section.getBoolean("broadcast-game-start", true); this.broadcastGameStartBlacklist = section.getStringList("broadcast-game-start-blacklist"); this.winMessageToAll = section.getBoolean("win-message-to-all", true); this.warmupMode = section.getBoolean("warmup-mode", false); this.warmupTime = section.getInt("warmup-time", 10); this.adventureMode = section.getBoolean("adventure-mode", true); }
Example 5
Source File: TPSCommand.java From LagMonitor with MIT License | 5 votes |
private void buildLine(float sampleSecond, List<StringBuilder> graphLines, boolean console) { ChatColor color = ChatColor.DARK_RED; int lines = 0; if (sampleSecond > 19.5F) { lines = GRAPH_LINES; color = ChatColor.DARK_GREEN; } else if (sampleSecond > 18.0F) { lines = GRAPH_LINES - 1; color = ChatColor.GREEN; } else if (sampleSecond > 17.0F) { lines = GRAPH_LINES - 2; color = ChatColor.YELLOW; } else if (sampleSecond > 15.0F) { lines = GRAPH_LINES - 3; color = ChatColor.GOLD; } else if (sampleSecond > 12.0F) { lines = GRAPH_LINES - 4; color = ChatColor.RED; } //in y-direction in reverse order for (int line = GRAPH_LINES - 1; line >= 0; line--) { if (lines == 0) { graphLines.get(line).append(ChatColor.WHITE).append(console ? EMPTY_CHAR : PLAYER_EMPTY_CHAR); continue; } lines--; graphLines.get(line).append(color).append(console ? GRAPH_CHAR : PLAYER_GRAPH_CHAR); } }
Example 6
Source File: PlayerChat.java From FunnyGuilds with Apache License 2.0 | 5 votes |
private void spy(Player player, String message) { String spyMessage = ChatColor.GOLD + "[Spy] " + ChatColor.GRAY + player.getName() + ": " + ChatColor.WHITE + message; for (Player looped : Bukkit.getOnlinePlayers()) { if (User.get(looped).getCache().isSpy()) { looped.sendMessage(spyMessage); } } }
Example 7
Source File: ScoreboardSlot.java From 1.13-Command-API with Apache License 2.0 | 5 votes |
/** * Determines the scoreboard slot value based on an internal Minecraft integer * @param i the scoreboard slot value */ public ScoreboardSlot(int i) { //Initialize displaySlot switch(i) { case 0: displaySlot = DisplaySlot.PLAYER_LIST; break; case 1: displaySlot = DisplaySlot.SIDEBAR; break; case 2: displaySlot = DisplaySlot.BELOW_NAME; break; default: displaySlot = DisplaySlot.SIDEBAR; break; } //Initialize teamColor switch(i) { case 3: teamColor = ChatColor.BLACK; break; case 4: teamColor = ChatColor.DARK_BLUE; break; case 5: teamColor = ChatColor.DARK_GREEN; break; case 6: teamColor = ChatColor.DARK_AQUA; break; case 7: teamColor = ChatColor.DARK_RED; break; case 8: teamColor = ChatColor.DARK_PURPLE; break; case 9: teamColor = ChatColor.GOLD; break; case 10: teamColor = ChatColor.GRAY; break; case 11: teamColor = ChatColor.DARK_GRAY; break; case 12: teamColor = ChatColor.BLUE; break; case 13: teamColor = ChatColor.GREEN; break; case 14: teamColor = ChatColor.AQUA; break; case 15: teamColor = ChatColor.RED; break; case 16: teamColor = ChatColor.LIGHT_PURPLE; break; case 17: teamColor = ChatColor.YELLOW; break; case 18: teamColor = ChatColor.WHITE; break; default: teamColor = null; break; } }
Example 8
Source File: TPSCommand.java From LagMonitor with MIT License | 5 votes |
private void buildLine(float sampleSecond, List<StringBuilder> graphLines, boolean console) { ChatColor color = ChatColor.DARK_RED; int lines = 0; if (sampleSecond > 19.5F) { lines = GRAPH_LINES; color = ChatColor.DARK_GREEN; } else if (sampleSecond > 18.0F) { lines = GRAPH_LINES - 1; color = ChatColor.GREEN; } else if (sampleSecond > 17.0F) { lines = GRAPH_LINES - 2; color = ChatColor.YELLOW; } else if (sampleSecond > 15.0F) { lines = GRAPH_LINES - 3; color = ChatColor.GOLD; } else if (sampleSecond > 12.0F) { lines = GRAPH_LINES - 4; color = ChatColor.RED; } //in y-direction in reverse order for (int line = GRAPH_LINES - 1; line >= 0; line--) { if (lines == 0) { graphLines.get(line).append(ChatColor.WHITE).append(console ? EMPTY_CHAR : PLAYER_EMPTY_CHAR); continue; } lines--; graphLines.get(line).append(color).append(console ? GRAPH_CHAR : PLAYER_GRAPH_CHAR); } }
Example 9
Source File: UCLang.java From UltimateChat with GNU General Public License v3.0 | 5 votes |
public String get(String key) { String FMsg; if (!loadedlang.containsKey(key)) { FMsg = "&c&oMissing language string for " + ChatColor.GOLD + key; } else { FMsg = loadedlang.get(key).toString(); } FMsg = ChatColor.translateAlternateColorCodes('&', FMsg); return FMsg.replace("\\n", "\n"); }
Example 10
Source File: NumberUtils.java From Slimefun4 with GNU General Public License v3.0 | 5 votes |
public static ChatColor getColorFromPercentage(float percentage) { if (percentage < 16.0F) return ChatColor.DARK_RED; else if (percentage < 32.0F) return ChatColor.RED; else if (percentage < 48.0F) return ChatColor.GOLD; else if (percentage < 64.0F) return ChatColor.YELLOW; else if (percentage < 80.0F) return ChatColor.DARK_GREEN; else return ChatColor.GREEN; }
Example 11
Source File: MiscUtil.java From CardinalPGM with MIT License | 5 votes |
public static ChatColor convertDyeColorToChatColor(DyeColor dye) { switch (dye) { case WHITE: return ChatColor.WHITE; case ORANGE: return ChatColor.GOLD; case MAGENTA: return ChatColor.LIGHT_PURPLE; case LIGHT_BLUE: return ChatColor.BLUE; case YELLOW: return ChatColor.YELLOW; case LIME: return ChatColor.GREEN; case PINK: return ChatColor.RED; case GRAY: return ChatColor.DARK_GRAY; case SILVER: return ChatColor.GRAY; case CYAN: return ChatColor.DARK_AQUA; case PURPLE: return ChatColor.DARK_PURPLE; case BLUE: return ChatColor.DARK_BLUE; case BROWN: return ChatColor.GOLD; case GREEN: return ChatColor.DARK_GREEN; case RED: return ChatColor.DARK_RED; case BLACK: return ChatColor.BLACK; } return ChatColor.WHITE; }
Example 12
Source File: PickerMatchModule.java From PGM with GNU Affero General Public License v3.0 | 5 votes |
private String getTeamSizeDescription(final int num, final int max) { return (num >= max ? ChatColor.RED : ChatColor.GREEN).toString() + num + ChatColor.GOLD + " / " + ChatColor.RED + max; }
Example 13
Source File: MiscUtil.java From CardinalPGM with MIT License | 5 votes |
public static ChatColor convertBannerColorToChatColor(DyeColor dye) { switch (dye) { case WHITE: return ChatColor.WHITE; case ORANGE: return ChatColor.GOLD; case MAGENTA: return ChatColor.LIGHT_PURPLE; case LIGHT_BLUE: return ChatColor.BLUE; case YELLOW: return ChatColor.YELLOW; case LIME: return ChatColor.GREEN; case PINK: return ChatColor.RED; case GRAY: return ChatColor.DARK_GRAY; case SILVER: return ChatColor.GRAY; case CYAN: return ChatColor.DARK_AQUA; case PURPLE: return ChatColor.DARK_PURPLE; case BLUE: return ChatColor.BLUE; case BROWN: return ChatColor.GOLD; case GREEN: return ChatColor.DARK_GREEN; case RED: return ChatColor.DARK_RED; case BLACK: return ChatColor.BLACK; } return ChatColor.WHITE; }
Example 14
Source File: ChatUtil.java From CardinalPGM with MIT License | 5 votes |
public static ChatColor getTimerColor(double time) { if (time <= 5) { return ChatColor.DARK_RED; } else if (time <= 30) { return ChatColor.GOLD; } else if (time <= 60) { return ChatColor.YELLOW; } else { return ChatColor.GREEN; } }
Example 15
Source File: Ammo.java From QualityArmory with GNU General Public License v3.0 | 4 votes |
public Ammo(String name, MaterialStorage ms, int maxAmount, boolean indiDrop, int returnamount, double cost, ItemStack[] ingredients, double piercing) { this(name, ChatColor.GOLD + name, null, ms, maxAmount, indiDrop, returnamount, cost, ingredients, piercing); }
Example 16
Source File: Poll.java From CardinalPGM with MIT License | 4 votes |
private String command() { return ChatColor.RED + "\"" + ChatColor.GOLD + command + ChatColor.RED + "\""; }
Example 17
Source File: EventsMenu.java From SkyWarsReloaded with GNU General Public License v3.0 | 4 votes |
EventsMenu(final Player player, GameMap gMap) { int menuSize = 27; Inventory inv = Bukkit.createInventory(null, menuSize + 9, menuName + gMap.getName()); List<String> lores = new ArrayList<>(); for (MatchEvent event: gMap.getEvents()) { lores.clear(); String part1; String part2; String part3; String part4; if (event.isEnabled()) { part1 = ChatColor.GREEN + "Event Enabled"; part3 = ChatColor.AQUA + "Left Click to Disable"; } else { part1 = ChatColor.RED + "Event Disabled"; part3 = ChatColor.AQUA + "Left Click to Enable"; } if (event.hasFired()) { part2 = ChatColor.GREEN + "Event is Ongoing"; part4 = ChatColor.GOLD + "Right Click to End the Event"; } else { part2 = ChatColor.RED + "Event is not Running"; part4 = ChatColor.GOLD + "Right Click to Force Start Event"; } lores.add(part1); lores.add(part2); lores.add(part3); lores.add(part4); ItemStack item = SkyWarsReloaded.getNMS().getItemStack(event.getMaterial(), lores, event.getTitle()); inv.setItem(event.getSlot(), item); } ArrayList<Inventory> invs = new ArrayList<>(); invs.add(inv); SkyWarsReloaded.getIC().create(player, invs, event -> { String name = event.getName(); if (name.equalsIgnoreCase(SkyWarsReloaded.getNMS().getItemName(SkyWarsReloaded.getIM().getItem("exitMenuItem")))) { SkyWarsReloaded.getIC().show(player, gMap.getArenaKey()); new BukkitRunnable() { @Override public void run() { gMap.updateArenaManager(); } }.runTaskLater(SkyWarsReloaded.get(), 2); return; } MatchEvent mEvent = null; for (MatchEvent e: gMap.getEvents()) { if(ChatColor.translateAlternateColorCodes('&', e.getTitle()).equals(name)) { mEvent = e; break; } } if (mEvent != null) { if (event.getClick().equals(ClickType.RIGHT)) { if (mEvent.hasFired()) { mEvent.endEvent(true); } else { mEvent.doEvent(); } new EventsMenu(player, gMap); } else if (event.getClick().equals(ClickType.LEFT)) { mEvent.setEnabled(!mEvent.isEnabled()); mEvent.saveEventData(); new EventsMenu(player, gMap); } } }); if (player != null) { SkyWarsReloaded.getIC().show(player, null); } }
Example 18
Source File: MainMenuWindow.java From Hawk with GNU General Public License v3.0 | 4 votes |
public MainMenuWindow(Hawk hawk, Player player) { super(hawk, player, 1, ChatColor.GOLD + "Hawk Anticheat"); HawkPlayer pp = hawk.getHawkPlayer(player); /*elements[0] = new Element(Material.SAND, "dummy") { @Override public void doAction(Player p, Hawk hawk) { Window testWindow = new TestWindow(hawk, p); hawk.getGuiManager().sendWindow(p, testWindow); } };*/ elements[4] = new Element(Material.WORKBENCH, "Toggle Checks") { @Override public void doAction(Player p, Hawk hawk) { Window checks = new ToggleChecksWindow(hawk, p); hawk.getGuiManager().sendWindow(p, checks); } }; elements[5] = new Element(Material.PAPER, "Reload Configuration") { @Override public void doAction(Player p, Hawk hawk) { Bukkit.dispatchCommand(p, "hawk reload"); } }; ItemStack notify = new ItemStack(Material.INK_SACK); notify.setDurability((short) (pp.canReceiveAlerts() ? 10 : 8)); ItemMeta notifyName = notify.getItemMeta(); notifyName.setDisplayName(pp.canReceiveAlerts() ? "Notifications: ON" : "Notifications: OFF"); notify.setItemMeta(notifyName); elements[3] = new Element(notify) { @Override public void doAction(Player p, Hawk hawk) { pp.setReceiveNotifications(!pp.canReceiveAlerts()); Window mainMenu = new MainMenuWindow(hawk, p); hawk.getGuiManager().sendWindow(p, mainMenu); } }; elements[8] = new Element(Material.WOOD_DOOR, "Exit GUI") { @Override public void doAction(Player p, Hawk hawk) { p.closeInventory(); } }; prepareInventory(); }
Example 19
Source File: Repository.java From CardinalPGM with MIT License | 4 votes |
public String toChatMessage(boolean op) { String source = getSource(op); return ChatColor.YELLOW + "#" + getId() + " " + ChatColor.GOLD + (source == null ? ChatColor.STRIKETHROUGH + "Hidden" : source); }
Example 20
Source File: SunStick.java From NBTEditor with GNU General Public License v3.0 | 4 votes |
public SunStick() { super("sun-stick", ChatColor.GOLD + "Sun Stick", 500); setLore("§bA magic flying stick to controls time.", "§bUse outside."); }