当前位置: 首页>>代码示例>>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;未经允许,请勿转载。