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


Java EnumChatFormatting.getTextWithoutFormattingCodes方法代碼示例

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


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

示例1: getEntityTexture

import net.minecraft.util.EnumChatFormatting; //導入方法依賴的package包/類
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
	EntityRabbit rabbit = (EntityRabbit) entity;
	String s = EnumChatFormatting.getTextWithoutFormattingCodes(rabbit.getCommandSenderName());

	if (s != null && s.equals("Toast"))
		return TOAST;
	else
		switch (rabbit.getRabbitType()) {
			case 0:
			default:
				return BROWN;
			case 1:
				return WHITE;
			case 2:
				return BLACK;
			case 3:
				return WHITE_SPLOTCHED;
			case 4:
				return GOLD;
			case 5:
				return SALT;
		}
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:25,代碼來源:RabbitRenderer.java

示例2: processUpdateSign

import net.minecraft.util.EnumChatFormatting; //導入方法依賴的package包/類
public void processUpdateSign(C12PacketUpdateSign packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
    this.playerEntity.markPlayerActive();
    WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
    BlockPos blockpos = packetIn.getPosition();

    if (worldserver.isBlockLoaded(blockpos))
    {
        TileEntity tileentity = worldserver.getTileEntity(blockpos);

        if (!(tileentity instanceof TileEntitySign))
        {
            return;
        }

        TileEntitySign tileentitysign = (TileEntitySign)tileentity;

        if (!tileentitysign.getIsEditable() || tileentitysign.getPlayer() != this.playerEntity)
        {
            this.serverController.logWarning("Player " + this.playerEntity.getName() + " just tried to change non-editable sign");
            return;
        }

        IChatComponent[] aichatcomponent = packetIn.getLines();

        for (int i = 0; i < aichatcomponent.length; ++i)
        {
            tileentitysign.signText[i] = new ChatComponentText(EnumChatFormatting.getTextWithoutFormattingCodes(aichatcomponent[i].getUnformattedText()));
        }

        tileentitysign.markDirty();
        worldserver.markBlockForUpdate(blockpos);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:36,代碼來源:NetHandlerPlayServer.java

示例3: func_180605_a

import net.minecraft.util.EnumChatFormatting; //導入方法依賴的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: getEntityTexture

import net.minecraft.util.EnumChatFormatting; //導入方法依賴的package包/類
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityRabbit entity)
{
    String s = EnumChatFormatting.getTextWithoutFormattingCodes(entity.getName());

    if (s != null && s.equals("Toast"))
    {
        return TOAST;
    }
    else
    {
        switch (entity.getRabbitType())
        {
            case 0:
            default:
                return BROWN;

            case 1:
                return WHITE;

            case 2:
                return BLACK;

            case 3:
                return WHITE_SPLOTCHED;

            case 4:
                return GOLD;

            case 5:
                return SALT;

            case 99:
                return CAERBANNOG;
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:40,代碼來源:RenderRabbit.java

示例5: rotateCorpse

import net.minecraft.util.EnumChatFormatting; //導入方法依賴的package包/類
protected void rotateCorpse(T bat, float p_77043_2_, float p_77043_3_, float partialTicks)
{
    GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F);

    if (bat.deathTime > 0)
    {
        float f = ((float)bat.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
        f = MathHelper.sqrt_float(f);

        if (f > 1.0F)
        {
            f = 1.0F;
        }

        GlStateManager.rotate(f * this.getDeathMaxRotation(bat), 0.0F, 0.0F, 1.0F);
    }
    else
    {
        String s = EnumChatFormatting.getTextWithoutFormattingCodes(bat.getName());

        if (s != null && (s.equals("Dinnerbone") || s.equals("Grumm")) && (!(bat instanceof EntityPlayer) || ((EntityPlayer)bat).isWearing(EnumPlayerModelParts.CAPE)))
        {
            GlStateManager.translate(0.0F, bat.height + 0.1F, 0.0F);
            GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:28,代碼來源:RendererLivingEntity.java

示例6: func_178909_a

import net.minecraft.util.EnumChatFormatting; //導入方法依賴的package包/類
public static String func_178909_a(String p_178909_0_, boolean p_178909_1_)
{
    return !p_178909_1_ && !Minecraft.getMinecraft().gameSettings.chatColours ? EnumChatFormatting.getTextWithoutFormattingCodes(p_178909_0_) : p_178909_0_;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:5,代碼來源:GuiUtilRenderComponents.java

示例7: getSearchValue

import net.minecraft.util.EnumChatFormatting; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public String getSearchValue ( ) {
	
	return EnumChatFormatting . getTextWithoutFormattingCodes ( name ) +  ( m_stack != null ? EnumChatFormatting . getTextWithoutFormattingCodes ( m_stack . getDisplayName ( ) ) : "" ) ;
	
}
 
開發者ID:Pishka,項目名稱:MineDonate,代碼行數:8,代碼來源:ItemInfo.java

示例8: getSearchValue

import net.minecraft.util.EnumChatFormatting; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public String getSearchValue ( ) {
	
	return EnumChatFormatting . getTextWithoutFormattingCodes ( name + ownerName ) ;
	
}
 
開發者ID:Pishka,項目名稱:MineDonate,代碼行數:8,代碼來源:ShopInfo.java

示例9: getSearchValue

import net.minecraft.util.EnumChatFormatting; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public String getSearchValue ( ) {
	
	return EnumChatFormatting . getTextWithoutFormattingCodes ( name ) ;
	
}
 
開發者ID:Pishka,項目名稱:MineDonate,代碼行數:8,代碼來源:EntityInfo.java

示例10: getSearchValue

import net.minecraft.util.EnumChatFormatting; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public String getSearchValue ( ) {
	
	return EnumChatFormatting . getTextWithoutFormattingCodes ( name + world_name ) ;
	
}
 
開發者ID:Pishka,項目名稱:MineDonate,代碼行數:8,代碼來源:RegionInfo.java


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