當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。