当前位置: 首页>>代码示例>>Java>>正文


Java ChatColor.RESET属性代码示例

本文整理汇总了Java中org.bukkit.ChatColor.RESET属性的典型用法代码示例。如果您正苦于以下问题:Java ChatColor.RESET属性的具体用法?Java ChatColor.RESET怎么用?Java ChatColor.RESET使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.ChatColor的用法示例。


在下文中一共展示了ChatColor.RESET属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: debug

/**
 * Sends a debug plugin message.
 * @param msg
 */
public void debug(String msg) {
	if (!getConfig().getBoolean("logging.enable-debug", false)) { return; }
	msg = "[" + ChatColor.RED + "PSPS" + ChatColor.RESET + "] " + msg;
	if (getConfig().getBoolean("logging.disable-colors", false)) {
		msg = ChatColor.stripColor(msg);
	}
	getServer().getConsoleSender().sendMessage(msg);
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupportPocketStuff,代码行数:12,代码来源:ProtocolSupportPocketStuff.java

示例2: onInventoryClose

@EventHandler
public void onInventoryClose(InventoryCloseEvent event) {
	if (event.getInventory().getHolder() instanceof NBTRecipeHolder) {
		NBTRecipeHolder holder = (NBTRecipeHolder) event.getInventory().getHolder();
		if (holder != this) return;

		Inventory inventory = event.getInventory();
		if (InventoryUtils.isEmpty(inventory)) {
			holder.callbackPlayer.sendMessage(ChatColor.RED + "Do you seriously want to create a recipe without ingredients?");
			return;
		}

		NBTRecipe nmsRecipe = holder.toRecipe();
		CRNBTRecipe nbtRecipe = new CRNBTRecipe(nmsRecipe);
		List<List<String>> recipeIngredients = nbtRecipe.getIngredients().stream()
				.map((CRChoiceIngredient ingr) -> ingr.getChoices().stream()
						.map(InventoryUtils::getItemName).collect(Collectors.toList()))
				.collect(Collectors.toList());
		String recipeString = recipeIngredients + "" +
				ChatColor.RESET + " -> " +
				InventoryUtils.getItemName(nbtRecipe.getResult());

		boolean success = holder.plugin.getCraftingManager().addRecipe(holder.key, nmsRecipe, nbtRecipe);
		if (success) {
			holder.callbackPlayer.sendMessage(String.format("%sAdded NBT recipe: %s%s%s!",
					ChatColor.GREEN, ChatColor.WHITE, recipeString, ChatColor.WHITE));
			plugin.saveCraftingRecipeFile("nbt", nbtRecipe);
		} else {
			holder.callbackPlayer.sendMessage(ChatColor.RED + "Couldn't create an NBT recipe. Possibly a duplicate key.");
		}

		HandlerList.unregisterAll(holder);
	}
}
 
开发者ID:Jannyboy11,项目名称:CustomRecipes,代码行数:34,代码来源:NBTAdder.java

示例3: onInventoryClose

@EventHandler
public void onInventoryClose(InventoryCloseEvent event) {
	if (event.getInventory().getHolder() instanceof CountRecipeHolder) {
		CountRecipeHolder holder = (CountRecipeHolder) event.getInventory().getHolder();
		if (holder != this) return;

		Inventory inventory = event.getInventory();
		if (InventoryUtils.isEmpty(inventory)) {
			holder.callbackPlayer.sendMessage(ChatColor.RED + "Do you seriously want to create a recipe without ingredients?");
			return;
		}

		CountRecipe nmsRecipe = holder.toRecipe();
		CRCountRecipe countRecipe = new CRCountRecipe(nmsRecipe);
		List<List<String>> recipeIngredients = countRecipe.getIngredients().stream()
				.map((CRChoiceIngredient ingr) -> ingr.getChoices().stream()
						.map(InventoryUtils::getItemName).collect(Collectors.toList()))
				.collect(Collectors.toList());
		String recipeString = recipeIngredients + "" +
				ChatColor.RESET + " -> " +
				InventoryUtils.getItemName(countRecipe.getResult());

		boolean success = holder.plugin.getCraftingManager().addRecipe(holder.key, nmsRecipe, countRecipe);
		if (success) {
			holder.callbackPlayer.sendMessage(String.format("%sAdded count recipe: %s%s%s!",
					ChatColor.GREEN, ChatColor.WHITE, recipeString, ChatColor.WHITE));
			plugin.saveCraftingRecipeFile("count", countRecipe);
		} else {
			holder.callbackPlayer.sendMessage(ChatColor.RED + "Couldn't create a count recipe. Possibly a duplicate key.");
		}

		HandlerList.unregisterAll(holder);
	}
}
 
开发者ID:Jannyboy11,项目名称:CustomRecipes,代码行数:34,代码来源:CountAdder.java

示例4: ManagedHelpTopic

public ManagedHelpTopic(String name, Command command, String permission) {
    this.name = "/" + name;
    this.shortText = command.desc();
    this.fullText = ChatColor.GOLD + "Description: " + ChatColor.RESET + command.desc() +
            ChatColor.GOLD + "\nUsage: " + ChatColor.RESET + command.usage();
    this.amendedPermission = permission;
}
 
开发者ID:CyR1en,项目名称:Minecordbot,代码行数:7,代码来源:ManagedHelpTopic.java

示例5: onInventoryClose

@EventHandler
public void onInventoryClose(InventoryCloseEvent event) {
	if (event.getInventory().getHolder() instanceof ShapedRecipeHolder) {
		ShapedRecipeHolder holder = (ShapedRecipeHolder) event.getInventory().getHolder();
		if (holder != this) return;

		Inventory inventory = event.getInventory();
		if (InventoryUtils.isEmpty(inventory)) {
			holder.callbackPlayer.sendMessage(ChatColor.RED + "Do you seriously want to create a recipe without ingredients?");
			return;
		}

		ShapedRecipes nmsRecipe = holder.toRecipe();
		CRShapedRecipe<ShapedRecipes> shapedRecipe = new CRShapedRecipe<>(nmsRecipe);
		List<List<String>> recipeIngredients = shapedRecipe.getIngredients().stream()
				.map((CRChoiceIngredient ingr) -> ingr.getChoices().stream()
						.map(InventoryUtils::getItemName).collect(Collectors.toList()))
				.collect(Collectors.toList());
		String recipeString = recipeIngredients + "" +
				ChatColor.RESET + " -> " +
				InventoryUtils.getItemName(shapedRecipe.getResult());

		boolean success = holder.plugin.getCraftingManager().addRecipe(holder.key, nmsRecipe, shapedRecipe);
		if (success) {
			holder.callbackPlayer.sendMessage(String.format("%sAdded shaped recipe: %s%s%s!",
					ChatColor.GREEN, ChatColor.WHITE, recipeString, ChatColor.WHITE));
			plugin.saveCraftingRecipeFile("shaped", shapedRecipe);
		} else {
			holder.callbackPlayer.sendMessage(ChatColor.RED + "Couldn't create a shaped recipe. Possibly a duplicate key.");
		}

		HandlerList.unregisterAll(holder);
	}
}
 
开发者ID:Jannyboy11,项目名称:CustomRecipes,代码行数:34,代码来源:ShapedAdder.java

示例6: onInventoryClose

@EventHandler
public void onInventoryClose(InventoryCloseEvent event) {
	if (event.getInventory().getHolder() instanceof ShapelessRecipeHolder) {
		ShapelessRecipeHolder holder = (ShapelessRecipeHolder) event.getInventory().getHolder();
		if (holder != this) return;

		ShapelessRecipes nmsRecipe = holder.toRecipe();
		CRShapelessRecipe<ShapelessRecipes> shapelessRecipe = new CRShapelessRecipe<>(nmsRecipe);

		List<List<String>> recipeIngredients = shapelessRecipe
				.getIngredients().stream().map((CRChoiceIngredient ingr) -> ingr.getChoices().stream()
						.map(InventoryUtils::getItemName)
						.collect(Collectors.toList()))
				.collect(Collectors.toList());
		String recipeString = recipeIngredients + "" + ChatColor.RESET + " -> "
				+ InventoryUtils.getItemName(shapelessRecipe.getResult());

		boolean success = holder.plugin.getCraftingManager().addRecipe(holder.key, nmsRecipe, shapelessRecipe);
		if (success) {
			holder.callbackPlayer.sendMessage(String.format("%sAdded shapeless recipe: %s%s%s!",
					ChatColor.GREEN, ChatColor.WHITE, recipeString, ChatColor.WHITE));
			plugin.saveCraftingRecipeFile("shapeless", shapelessRecipe);
		} else {
			holder.callbackPlayer.sendMessage(ChatColor.RED + "Couldn't create a permission recipe. Possibly a duplicate key.");
		}

		HandlerList.unregisterAll(holder);
	}
}
 
开发者ID:Jannyboy11,项目名称:CustomRecipes,代码行数:29,代码来源:ShapelessAdder.java

示例7: differEntry

private String differEntry(String entry, int position) {
    while (entries.contains(entry)) {
        entry += ChatColor.RESET;
    }
    if (entry.length() > MAX_ENTRY_CHARS) {
        throw new IllegalArgumentException("Too much chars for registrable \"" + entry + "\" at: \"" + position + "\"");
    }
    return entry;
}
 
开发者ID:upperlevel,项目名称:uppercore,代码行数:9,代码来源:BoardView.java

示例8: getIslandName

/**
 * Get name of the island owned by owner
 * @param owner
 * @return Returns the name of owner's island, or the owner's name if there is none.
 */
public String getIslandName(UUID owner) {
    String result = plugin.getPlayers().getName(owner);
    if (islandsByUUID.containsKey(owner)) {
        Island island = islandsByUUID.get(owner);
        if (!island.getName().isEmpty()) {
            result = island.getName();
        }
    }
    return ChatColor.translateAlternateColorCodes('&', result) + ChatColor.RESET;
}
 
开发者ID:tastybento,项目名称:bskyblock,代码行数:15,代码来源:IslandCache.java

示例9: pm

/**
 * Sends a plugin message.
 * @param msg
 */
public void pm(String msg) {
	msg = "[" + ChatColor.DARK_PURPLE + "PSPS" + ChatColor.RESET + "] " + msg;
	if (getConfig().getBoolean("logging.disable-colors", false)) {
		msg = ChatColor.stripColor(msg);
	}
	getServer().getConsoleSender().sendMessage(msg);
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupportPocketStuff,代码行数:11,代码来源:ProtocolSupportPocketStuff.java

示例10: getColoredFormattedPlayerName

/**
 * Get a colored formatted player name
 *
 * @param uuid Player's UUID
 *
 * @return Formatted name
 */
public static String getColoredFormattedPlayerName(UUID uuid)
{
    AbstractPlayerData playerData = SamaGamesAPI.get().getPlayerManager().getPlayerData(uuid);
    IPermissionsEntity playerPermissionEntity = SamaGamesAPI.get().getPermissionsManager().getPlayer(uuid);

    return playerPermissionEntity.getDisplayPrefix() + playerData.getDisplayName() + ChatColor.RESET;
}
 
开发者ID:SamaGames,项目名称:SamaGamesAPI,代码行数:14,代码来源:PlayerUtils.java

示例11: Weapon

public Weapon(int id, Material material, String name, List<String> lore) {
    this.id = id;
    this.name = ChatColor.RESET + name;
    this.lore = Parsers.setLoreColor(lore);
    this.material = material;

    weapons[id] = this;
}
 
开发者ID:cadox8,项目名称:WC,代码行数:8,代码来源:Weapon.java

示例12: getStabilityModifiers

/**
 * @return
 * the stability value with all modifiers as hover texts
 */
public BaseComponent[] getStabilityModifiers(ChatColor c) {
    String stability = FMessage.CMD_SHOW_STABILITY.getMessage() + c + getStability();
    String base = FMessage.CMD_SHOW_STABILITY_MOD_BASE.getMessage() + color(this.stability) + "\n";
    String exhaustion = ChatColor.RESET + FMessage.CMD_SHOW_STABILITY_MOD_EXHAUSTION.getMessage() + color((int) (this.exhaustion * this.exhaustion)) + "\n";
    String size = ChatColor.RESET + FMessage.CMD_SHOW_STABILITY_MOD_PROVINCES.getMessage() + color((regions.size() - 1 * regions.size() - 1) / 2) + "\n";
    String adminNotMember = ChatColor.RESET + FMessage.CMD_SHOW_STABILITY_MOD_ABSENT_MONARCH.getMessage() + color(members.contains(admin) ? 0 : -25) + "\n";
    String power = ChatColor.RESET + FMessage.CMD_SHOW_STABILITY_MOD_POWER.getMessage();
    if (getPower() > chunks.size()) {
        power += ChatColor.GREEN + "+10";
    } else if (getPower() < chunks.size()) {
        power += ChatColor.DARK_RED + "-10";
    } else {
        power += ChatColor.YELLOW + "0";
    }
    power += "\n";
    int i = 0;
    for (ResourceSubcategory category : ResourceSubcategory.values()) {
        i += isSubcategorySaturated(category).getStabilityBonus();
    }
    String wealth = ChatColor.RESET + FMessage.CMD_SHOW_STABILITY_MOD_WEALTH.getMessage() + color(i);

    BaseComponent[] msg = TextComponent.fromLegacyText(stability);
    for (BaseComponent component : msg) {
        component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(base + exhaustion + size + adminNotMember + power + wealth)));
    }
    return msg;
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:31,代码来源:Faction.java

示例13: getGameTag

@Override
public String getGameTag()
{
    return ChatColor.DARK_AQUA + "[" + ChatColor.AQUA + (this.nameShortcut != null ? this.nameShortcut : this.game.getGameName()) + ChatColor.DARK_AQUA + "]" + ChatColor.RESET;
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:5,代码来源:CoherenceMachineImpl.java

示例14: getTeamScoreLine

private String getTeamScoreLine(MatchTeam matchTeam) {
    return "  " + ChatColor.RESET + pointsModule.getPoints(matchTeam) + ChatColor.GRAY + "/" + pointsModule.getTarget(matchTeam) + ChatColor.RESET + " Kills";
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:3,代码来源:TDMModule.java

示例15: getTeamScoreLine

private String getTeamScoreLine(MatchTeam matchTeam, int size) {
    return "  " + ChatColor.RESET + size + ChatColor.GRAY + " Alive";
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:3,代码来源:BlitzModule.java


注:本文中的org.bukkit.ChatColor.RESET属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。