本文整理汇总了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";
}