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


Java ChatStyle.setBold方法代码示例

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


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

示例1: drawCountDown

import net.minecraft.util.ChatStyle; //导入方法依赖的package包/类
@Override
protected void drawCountDown(int secondsRemaining)
{
       ChatComponentText text = new ChatComponentText("" + secondsRemaining + "...");
       ChatStyle style = new ChatStyle();
       style.setBold(true);
       if (secondsRemaining <= 5)
           style.setColor(EnumChatFormatting.RED);

       text.setChatStyle(style);
       Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(text, 1);
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:13,代码来源:AgentQuitFromTimeUpImplementation.java

示例2: getParsedText

import net.minecraft.util.ChatStyle; //导入方法依赖的package包/类
private ChatComponentText getParsedText(String text)
{
	ChatComponentText output = new ChatComponentText("");
	ChatStyle style = new ChatStyle();
	String[] splitted = text.split(" ");
	String temp = "";

	style.setBold(true);
	style.setUnderlined(true);

	for (String s : splitted)
	{
		if (s.startsWith("http"))
		{
			output.appendText(temp);
			temp = "";

			style.setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, s));
			output.appendSibling(new ChatComponentText(s).setChatStyle(style));
			output.appendText(" ");
		}
		else
		{
			temp += s + " ";
		}
	}

	output.appendText(temp);

	return output;
}
 
开发者ID:szernex,项目名称:YetAnotherLoginMessageMod,代码行数:32,代码来源:MessageTask.java

示例3: createChatLink

import net.minecraft.util.ChatStyle; //导入方法依赖的package包/类
public static ChatComponentText createChatLink(String text, String url, boolean bold, boolean underline, boolean italic, EnumChatFormatting color) {
	ChatComponentText link = new ChatComponentText(text);
	ChatStyle style = link.getChatStyle();
	style.setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, url));
	style.setBold(Boolean.valueOf(bold));
	style.setUnderlined(Boolean.valueOf(underline));
	style.setItalic(Boolean.valueOf(italic));
	style.setColor(color);
	return link;
}
 
开发者ID:NPException,项目名称:Dimensional-Pockets,代码行数:11,代码来源:Utils.java

示例4: applyModifier

import net.minecraft.util.ChatStyle; //导入方法依赖的package包/类
/**
 * Applies modifier to the style
 * Returns whether or not the modifier was valid
 */
private boolean applyModifier(ChatStyle chatStyle, char modifier) {
    if (modifier >= '0' && modifier <= '9' || modifier >= 'a' && modifier <= 'f') {
        chatStyle.setColor(ColorUtils.colorMap.get(modifier));
        return true;
    }
    switch (modifier) {
        case 'k': chatStyle.setObfuscated(true); return true;
        case 'l': chatStyle.setBold(true); return true;
        case 'm': chatStyle.setStrikethrough(true); return true;
        case 'n': chatStyle.setUnderlined(true); return true;
        case 'o': chatStyle.setItalic(true); return true;
    }
    return false;
}
 
开发者ID:MyEssentials,项目名称:MyEssentials-Core,代码行数:19,代码来源:ChatComponentFormatted.java

示例5: inheritFlat

import net.minecraft.util.ChatStyle; //导入方法依赖的package包/类
/**
   * Merges the given child ChatStyle into the given parent preserving hierarchical inheritance.
   * 
   * @param parent	The parent to inherit style information
   * @param child		The child style who's properties will override those in the parent
   */
  public static void inheritFlat(ChatStyle parent, ChatStyle child) {
if ((parent.getBold() != child.getBold()) && child.getBold()) {
	parent.setBold(true);
}
if ((parent.getItalic() != child.getItalic()) && child.getItalic()) {
	parent.setItalic(true);
}
if ((parent.getStrikethrough() != child.getStrikethrough()) && child.getStrikethrough()) {
	parent.setStrikethrough(true);
}
if ((parent.getUnderlined() != child.getUnderlined()) && child.getUnderlined()) {
	parent.setUnderlined(true);
}
if ((parent.getObfuscated() != child.getObfuscated()) && child.getObfuscated()) {
	parent.setObfuscated(true);
}
      
      Object temp;
      if ((temp = child.getColor()) != null) {
      	parent.setColor((EnumChatFormatting)temp);
      }
      if ((temp = child.getChatClickEvent()) != null) {
      	parent.setChatClickEvent((ClickEvent)temp);
      }
      if ((temp = child.getChatHoverEvent()) != null) {
      	parent.setChatHoverEvent((HoverEvent)temp);
      }
      if ((temp = child.getInsertion()) != null) {
      	parent.setInsertion((String)temp);
      }
  }
 
开发者ID:warriordog,项目名称:BlazeLoader,代码行数:38,代码来源:ApiChat.java


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