本文整理匯總了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);
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例14: getTeamScoreLine
private String getTeamScoreLine(MatchTeam matchTeam) {
return " " + ChatColor.RESET + pointsModule.getPoints(matchTeam) + ChatColor.GRAY + "/" + pointsModule.getTarget(matchTeam) + ChatColor.RESET + " Kills";
}
示例15: getTeamScoreLine
private String getTeamScoreLine(MatchTeam matchTeam, int size) {
return " " + ChatColor.RESET + size + ChatColor.GRAY + " Alive";
}