當前位置: 首頁>>代碼示例>>Java>>正文


Java IChatComponent.appendSibling方法代碼示例

本文整理匯總了Java中net.minecraft.util.IChatComponent.appendSibling方法的典型用法代碼示例。如果您正苦於以下問題:Java IChatComponent.appendSibling方法的具體用法?Java IChatComponent.appendSibling怎麽用?Java IChatComponent.appendSibling使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.util.IChatComponent的用法示例。


在下文中一共展示了IChatComponent.appendSibling方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: join

import net.minecraft.util.IChatComponent; //導入方法依賴的package包/類
public static IChatComponent join(List<IChatComponent> components)
{
    IChatComponent ichatcomponent = new ChatComponentText("");

    for (int i = 0; i < components.size(); ++i)
    {
        if (i > 0)
        {
            if (i == components.size() - 1)
            {
                ichatcomponent.appendText(" and ");
            }
            else if (i > 0)
            {
                ichatcomponent.appendText(", ");
            }
        }

        ichatcomponent.appendSibling((IChatComponent)components.get(i));
    }

    return ichatcomponent;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:24,代碼來源:CommandBase.java

示例2: getChatComponentFromNthArg

import net.minecraft.util.IChatComponent; //導入方法依賴的package包/類
public static IChatComponent getChatComponentFromNthArg(ICommandSender sender, String[] args, int index, boolean p_147176_3_) throws PlayerNotFoundException
{
    IChatComponent ichatcomponent = new ChatComponentText("");

    for (int i = index; i < args.length; ++i)
    {
        if (i > index)
        {
            ichatcomponent.appendText(" ");
        }

        IChatComponent ichatcomponent1 = new ChatComponentText(args[i]);

        if (p_147176_3_)
        {
            IChatComponent ichatcomponent2 = PlayerSelector.matchEntitiesToChatComponent(sender, args[i]);

            if (ichatcomponent2 == null)
            {
                if (PlayerSelector.hasArguments(args[i]))
                {
                    throw new PlayerNotFoundException();
                }
            }
            else
            {
                ichatcomponent1 = ichatcomponent2;
            }
        }

        ichatcomponent.appendSibling(ichatcomponent1);
    }

    return ichatcomponent;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:36,代碼來源:CommandBase.java

示例3: func_180605_a

import net.minecraft.util.IChatComponent; //導入方法依賴的package包/類
public void func_180605_a(String p_180605_1_, ChatRawMessage[] p_180605_2_)
{
    for (ChatRawMessage chatrawmessage : p_180605_2_)
    {
        this.func_176027_a(chatrawmessage.userName, chatrawmessage);

        if (this.func_176028_a(chatrawmessage.modes, chatrawmessage.subscriptions, this.mc.gameSettings.streamChatUserFilter))
        {
            IChatComponent ichatcomponent = new ChatComponentText(chatrawmessage.userName);
            IChatComponent ichatcomponent1 = new ChatComponentTranslation("chat.stream." + (chatrawmessage.action ? "emote" : "text"), new Object[] {this.twitchComponent, ichatcomponent, EnumChatFormatting.getTextWithoutFormattingCodes(chatrawmessage.message)});

            if (chatrawmessage.action)
            {
                ichatcomponent1.getChatStyle().setItalic(Boolean.valueOf(true));
            }

            IChatComponent ichatcomponent2 = new ChatComponentText("");
            ichatcomponent2.appendSibling(new ChatComponentTranslation("stream.userinfo.chatTooltip", new Object[0]));

            for (IChatComponent ichatcomponent3 : GuiTwitchUserMode.func_152328_a(chatrawmessage.modes, chatrawmessage.subscriptions, (IStream)null))
            {
                ichatcomponent2.appendText("\n");
                ichatcomponent2.appendSibling(ichatcomponent3);
            }

            ichatcomponent.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, ichatcomponent2));
            ichatcomponent.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.TWITCH_USER_INFO, chatrawmessage.userName));
            this.mc.ingameGUI.getChatGUI().printChatMessage(ichatcomponent1);
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:32,代碼來源:TwitchStream.java

示例4: func_152328_a

import net.minecraft.util.IChatComponent; //導入方法依賴的package包/類
public static List<IChatComponent> func_152328_a(Set<ChatUserMode> p_152328_0_, Set<ChatUserSubscription> p_152328_1_, IStream p_152328_2_)
{
    String s = p_152328_2_ == null ? null : p_152328_2_.func_152921_C();
    boolean flag = p_152328_2_ != null && p_152328_2_.func_152927_B();
    List<IChatComponent> list = Lists.<IChatComponent>newArrayList();

    for (ChatUserMode chatusermode : p_152328_0_)
    {
        IChatComponent ichatcomponent = func_152329_a(chatusermode, s, flag);

        if (ichatcomponent != null)
        {
            IChatComponent ichatcomponent1 = new ChatComponentText("- ");
            ichatcomponent1.appendSibling(ichatcomponent);
            list.add(ichatcomponent1);
        }
    }

    for (ChatUserSubscription chatusersubscription : p_152328_1_)
    {
        IChatComponent ichatcomponent2 = func_152330_a(chatusersubscription, s, flag);

        if (ichatcomponent2 != null)
        {
            IChatComponent ichatcomponent3 = new ChatComponentText("- ");
            ichatcomponent3.appendSibling(ichatcomponent2);
            list.add(ichatcomponent3);
        }
    }

    return list;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:33,代碼來源:GuiTwitchUserMode.java

示例5: func_175355_a

import net.minecraft.util.IChatComponent; //導入方法依賴的package包/類
public String func_175355_a(EnumDifficulty p_175355_1_)
{
    IChatComponent ichatcomponent = new ChatComponentText("");
    ichatcomponent.appendSibling(new ChatComponentTranslation("options.difficulty", new Object[0]));
    ichatcomponent.appendText(": ");
    ichatcomponent.appendSibling(new ChatComponentTranslation(p_175355_1_.getDifficultyResourceKey(), new Object[0]));
    return ichatcomponent.getFormattedText();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:9,代碼來源:GuiOptions.java


注:本文中的net.minecraft.util.IChatComponent.appendSibling方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。