本文整理汇总了Java中org.bukkit.ChatColor.YELLOW属性的典型用法代码示例。如果您正苦于以下问题:Java ChatColor.YELLOW属性的具体用法?Java ChatColor.YELLOW怎么用?Java ChatColor.YELLOW使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.ChatColor
的用法示例。
在下文中一共展示了ChatColor.YELLOW属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: provideLore
private String[] provideLore(Player player, String... permissions) {
if (permissions != null && permissions.length == 1 && permissions[0] != null) {
if (permissions.length == 1 && permissions[0].equals("minecraft-heads")) {
return new String[]{ChatColor.GRAY + "Use exclusive pet heads as costume.", ChatColor.YELLOW + "Sponsored by Minecraft-Heads.com"};
}
if (permissions.length == 1 && permissions[0].equals("head-database")) {
final Plugin plugin = Bukkit.getPluginManager().getPlugin("HeadDatabase");
if (plugin == null) {
return new String[]{ChatColor.DARK_RED + "" + ChatColor.ITALIC + "Plugin is not installed - " + ChatColor.YELLOW + "Click me!"};
}
}
}
final String[] modifiedLore = new String[this.lore.length];
for (int i = 0; i < modifiedLore.length; i++) {
modifiedLore[i] = this.lore[i];
if (this.lore[i].contains("<permission>")) {
if (permissions != null && (permissions.length == 0 || this.hasPermission(player, permissions))) {
modifiedLore[i] = this.lore[i].replace("<permission>", Config.getInstance().getPermissionIconYes());
} else {
modifiedLore[i] = this.lore[i].replace("<permission>", Config.getInstance().getPermissionIconNo());
}
}
}
return modifiedLore;
}
示例2: onLogin
public void onLogin(Player player)
{
if (this.holograms.containsKey(player.getUniqueId()))
this.onLogout(player);
int pearls = this.hub.getInteractionManager().getGraouManager().getPlayerPearls(player.getUniqueId()).size();
Hologram hologram;
if (pearls > 0)
hologram = new Hologram(GRAOU_NAME, ChatColor.GOLD + "" + pearls + ChatColor.YELLOW + " perle" + (pearls > 1 ? "s" : "") + " à échanger");
else
hologram = new Hologram(GRAOU_NAME);
hologram.generateLines(this.graouEntity.getBukkitEntity().getLocation().clone().add(0.0D, 0.75D, 0.0D));
hologram.addReceiver(player);
this.holograms.put(player.getUniqueId(), hologram);
}
示例3: onLogin
public void onLogin(Player player)
{
if (this.holograms.containsKey(player.getUniqueId()))
this.onLogout(player);
int fishes = 0;
for (Bonus bonus : this.hub.getInteractionManager().getMeowManager().getBonus())
if (bonus.isAbleFor(player))
fishes++;
Hologram hologram;
if (fishes > 0)
hologram = new Hologram(MEOW_NAME, ChatColor.GOLD + "" + fishes + ChatColor.YELLOW + " poisson" + (fishes > 1 ? "s" : "") + " disponible" + (fishes > 1 ? "s" : ""));
else
hologram = new Hologram(MEOW_NAME);
hologram.generateLines(this.meowEntity.getBukkitEntity().getLocation().clone().add(0.0D, 0.75D, 0.0D));
hologram.addReceiver(player);
this.holograms.put(player.getUniqueId(), hologram);
}
示例4: createTeleportationEvent
public void createTeleportationEvent()
{
this.nextEvent = new TimedEvent(19, 0, "Téléportation", ChatColor.YELLOW, true, () ->
{
SamaGamesAPI.get().getGameManager().setMaxReconnectTime(-1);
this.game.disableDamages();
((RunBasedGame) this.game).teleportDeathMatch();
for (SurvivalPlayer player : (Collection<SurvivalPlayer>) this.game.getInGamePlayers().values())
{
if(!player.isOnline())
continue;
try
{
player.getPlayerIfOnline().removePotionEffect(PotionEffectType.SPEED);
player.getPlayerIfOnline().removePotionEffect(PotionEffectType.FAST_DIGGING);
}
catch (Exception e)
{
e.printStackTrace();
}
}
this.game.setWorldBorderSize(400.0D);
this.game.setWorldBorderSize(50.0D, 10L * 60L);
this.game.getCoherenceMachine().getMessageManager().writeCustomMessage("La map est désormais réduite. Les bordures sont en coordonnées " + ChatColor.RED + "-200 +200" + ChatColor.RESET + ".", true);
this.game.getCoherenceMachine().getMessageManager().writeCustomMessage("Les dégats et le PvP seront activés dans 30 secondes !", true);
this.createDeathmatchEvent();
});
}
示例5: getIcon
public ItemStack getIcon(Player viewer) {
ItemStack i = super.getIcon(viewer);
ItemMeta meta = i.getItemMeta();
ChatColor c = this.petType == null ? ChatColor.YELLOW : (viewer.hasPermission("echopet.pet.type." + this.getPetType().toString().toLowerCase().replace("_", ""))) ? ChatColor.GREEN : ChatColor.RED;
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', c + this.getName()));// NPE
i.setItemMeta(meta);
if (this.petType == PetType.HUMAN && i.getItemMeta() instanceof SkullMeta) {
SkullMeta sm = (SkullMeta) i.getItemMeta();
sm.setOwner(viewer.getName());
i.setItemMeta(sm);
}
return i;
}
示例6: onFactionCreate
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onFactionCreate(FactionCreateEvent event) {
Faction faction = event.getFaction();
if (faction instanceof PlayerFaction) {
CommandSender sender = event.getSender();
for (Player player : Bukkit.getOnlinePlayers()) {
Relation relation = faction.getRelation(player);
String msg = ChatColor.YELLOW + "The faction " + relation.toChatColour() + (player == null ? faction.getName() : faction.getName()) + ChatColor.YELLOW + " has been " + ChatColor.GREEN
+ "created" + ChatColor.YELLOW + " by " + ChatColor.AQUA + (sender instanceof Player ? ((Player) sender).getName() : sender.getName()) + ChatColor.YELLOW + '.';
player.sendMessage(msg);
}
}
}
示例7: createReducingEvent
@Override
public void createReducingEvent()
{
this.fallDamages = true;
this.nextEvent = new TimedEvent(5, 30, "Seconde réduction", ChatColor.YELLOW, false, () ->
{
this.game.setWorldBorderSize(50.0D);
this.game.getCoherenceMachine().getMessageManager().writeCustomMessage("La map va désormais effectuer une seconde réduction pendant 8 minutes !", true);
this.createSecondReducingEvent();
});
}
示例8: run
@Override
public void run()
{
if (this.style == 0)
{
if (this.loop < 20)
this.lastMessage = ChatColor.YELLOW + "Vous jouez sur " + ChatColor.GOLD + "mc.samagames.net" + ChatColor.YELLOW + " !";
else if (this.loop < 22)
this.lastMessage = ChatColor.YELLOW + "Vous jouez sur " + ChatColor.RED + "mc.samagames.net" + ChatColor.YELLOW + " !";
else if (this.loop < 24)
this.lastMessage = ChatColor.YELLOW + "Vous jouez sur " + ChatColor.GOLD + "mc.samagames.net" + ChatColor.YELLOW + " !";
else if (this.loop < 26)
this.lastMessage = ChatColor.YELLOW + "Vous jouez sur " + ChatColor.RED + "mc.samagames.net" + ChatColor.YELLOW + " !";
else if (this.loop < 28)
this.lastMessage = ChatColor.YELLOW + "Vous jouez sur " + ChatColor.GOLD + "mc.samagames.net" + ChatColor.YELLOW + " !";
else if (this.loop < 30)
this.lastMessage = ChatColor.YELLOW + "Vous jouez sur " + ChatColor.RED + "mc.samagames.net" + ChatColor.YELLOW + " !";
}
else if (this.style == 1)
{
if (this.loop < 20)
this.lastMessage = ChatColor.YELLOW + "Vous jouez sur " + ChatColor.GOLD + "mc.samagames.net" + ChatColor.YELLOW + " !";
else if (this.loop < 36)
this.lastMessage = ChatColor.YELLOW + "Vous jouez sur " + ChatColor.GOLD + this.colorIpAt() + ChatColor.YELLOW + " !";
}
this.bossBar.setTitle(this.lastMessage);
this.loop++;
if ((this.style == 0 && this.loop >= 30) || (this.style == 1 && this.loop >= 36))
{
this.loop = 0;
this.style++;
if (this.style >= 2)
this.style = 0;
}
}
示例9: getDtrColour
public ChatColor getDtrColour() {
this.updateDeathsUntilRaidable();
if (deathsUntilRaidable < 0) {
return ChatColor.RED;
} else if (deathsUntilRaidable < 1) {
return ChatColor.YELLOW;
} else {
return ChatColor.GREEN;
}
}
示例10: coloredVisibility
private static String coloredVisibility(ServerDoc.Visibility visibility) {
switch(visibility) {
case PRIVATE: return ChatColor.BLUE + "private";
case UNLISTED: return ChatColor.YELLOW + "unlisted";
case PUBLIC: return ChatColor.GREEN + "public";
default: return ChatColor.RED + "unknown";
}
}
示例11: onEnable
public void onEnable() {
Hive.getInstance().setType(GameType.WALLS);
GREEN = new Team(ChatColor.GREEN);
RED = new Team(ChatColor.RED);
YELLOW = new Team(ChatColor.YELLOW);
BLUE = new Team(ChatColor.BLUE);
GameEvents = new GameEvents();
Events = new Events();
PreEvents = new PreEvents();
new Config();
getCommand("team").setExecutor(new TeamChatCmd());
getCommand("help").setExecutor(new HelpCmd());
getCommand("time").setExecutor(new TimeCmd());
getCommand("teleport").setExecutor(new TeleportCmd());
getCommand("kit").setExecutor(new KitCmd());
getCommand("blue").setExecutor(new TeamCmd());
getCommand("red").setExecutor(new TeamCmd());
getCommand("yellow").setExecutor(new TeamCmd());
getCommand("green").setExecutor(new TeamCmd());
PreTask.TIMER.schedule(new PreTask(), 0, 1000);
Kit.load();
new BukkitRunnable() {
public void run() {
for (Player p : Bukkit.getOnlinePlayers()) {
if (Kit.getKit(p).getName().equalsIgnoreCase("scout"))
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 2147483647, 1), false);
}
}
}.runTaskTimerAsynchronously(this, 0, 120);
}
示例12: getPromptText
@Override
public String getPromptText(ConversationContext context) {
return ChatColor.YELLOW + "Are you sure you want to do this? " + ChatColor.RED + ChatColor.BOLD + "All factions" + ChatColor.YELLOW + " will be cleared. " + "Type " + ChatColor.GREEN
+ "yes" + ChatColor.YELLOW + " to confirm or " + ChatColor.RED + "no" + ChatColor.YELLOW + " to deny.";
}
示例13: getTeamMessageFormat
private String getTeamMessageFormat(Player player, String message) {
return ChatColor.DARK_AQUA + "(Team) " + player.getName() + ": " + ChatColor.YELLOW + message;
}
示例14: getPromptText
@Override
public String getPromptText(ConversationContext context) {
return ChatColor.YELLOW + "Are you sure you want to do this? The server will be in EOTW mode, If EOTW mode is active, all claims whilst making Spawn a KOTH. " + "You will still have "
+ EotwHandler.EOTW_WARMUP_WAIT_SECONDS + " seconds to cancel this using the same command though. " + "Type " + ChatColor.GREEN + "yes" + ChatColor.YELLOW + " to confirm or "
+ ChatColor.RED + "no" + ChatColor.YELLOW + " to deny.";
}
示例15: display
@Override
public void display(Player player)
{
this.inventory = this.hub.getServer().createInventory(null, 45, "Menu Principal");
this.setSlotData(ChatColor.GOLD + "Zone " + ChatColor.GREEN + "VIP", Material.DIAMOND, 9, makeButtonLore(new String[] { "Testez les jeux avant tout le monde !" }, false, true), "beta_vip");
this.setSlotData(ChatColor.GOLD + "Spawn", Material.BED, 18, makeButtonLore(new String[] { "Retournez au spawn grâce à la magie", "de la téléportation céleste !" }, false, true), "spawn");
this.setSlotData(ChatColor.GOLD + "Parcours du ciel", Material.PACKED_ICE, 26, makeButtonLore(new String[] { "En espérant que vous atteignez le", "paradis..."}, false, true), "parkour");
this.setSlotData(ChatColor.GOLD + "Informations", Material.EMPTY_MAP, 27, getInformationLore(), "none");
this.setSlotData(ChatColor.GOLD + "Changer de hub", Material.ENDER_CHEST, 35, makeButtonLore(new String[] { "Cliquez pour ouvrir l'interface" }, true, false), "switch_hub");
for (String gameIdentifier : this.hub.getGameManager().getGames().keySet())
{
AbstractGame game = this.hub.getGameManager().getGameByIdentifier(gameIdentifier);
if (game.getSlotInMainMenu() >= 0)
{
String prefix;
switch (game.getState())
{
case NEW:
prefix = ChatColor.GREEN + "" + ChatColor.BOLD + "NOUVEAU !";
break;
case POPULAR:
prefix = ChatColor.YELLOW + "" + ChatColor.BOLD + "POPULAIRE !";
break;
case SOON:
prefix = ChatColor.RED + "" + ChatColor.BOLD + "BIENTOT !";
break;
case LOCKED:
prefix = ChatColor.GOLD + "" + ChatColor.MAGIC + "aaaaaaaa";
break;
default:
prefix = "";
break;
}
if (!prefix.equals(""))
prefix += " ";
boolean glow = game.getState() == AbstractGame.State.NEW || game.getState() == AbstractGame.State.POPULAR;
this.setSlotData(prefix + ChatColor.GOLD + game.getName(), ItemUtils.hideAllAttributes(game.getState() == AbstractGame.State.LOCKED ? new ItemStack(Material.IRON_FENCE, 1) : (glow ? GlowEffect.addGlow(game.getIcon()) : game.getIcon())), game.getSlotInMainMenu(), makeGameLore(game), "game_" + gameIdentifier);
}
}
this.hub.getServer().getScheduler().runTask(this.hub, () -> player.openInventory(this.inventory));
}