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


Java TextFormatting.getTextWithoutFormattingCodes方法代碼示例

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


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

示例1: processUpdateSign

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

    if (worldserver.isBlockLoaded(blockpos))
    {
        IBlockState iblockstate = worldserver.getBlockState(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;
        }

        String[] astring = packetIn.getLines();

        for (int i = 0; i < astring.length; ++i)
        {
            tileentitysign.signText[i] = new TextComponentString(TextFormatting.getTextWithoutFormattingCodes(astring[i]));
        }

        tileentitysign.markDirty();
        worldserver.notifyBlockUpdate(blockpos, iblockstate, iblockstate, 3);
    }
}
 
開發者ID:NSExceptional,項目名稱:Zombe-Modpack,代碼行數:37,代碼來源:NetHandlerPlayServer.java

示例2: rotateCorpse

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

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

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

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

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

示例3: getEntityTexture

import net.minecraft.util.text.TextFormatting; //導入方法依賴的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 = TextFormatting.getTextWithoutFormattingCodes(entity.getName());

    if (s != null && "Toast".equals(s))
    {
        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:sudofox,項目名稱:Backmemed,代碼行數:40,代碼來源:RenderRabbit.java

示例4: rotateCorpse

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

    if (entityLiving.deathTime > 0)
    {
        float f = ((float)entityLiving.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(entityLiving), 0.0F, 0.0F, 1.0F);
    }
    else
    {
        String s = TextFormatting.getTextWithoutFormattingCodes(entityLiving.getName());

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

示例5: getEntityTexture

import net.minecraft.util.text.TextFormatting; //導入方法依賴的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 = TextFormatting.getTextWithoutFormattingCodes(entity.getName());

    if (s != null && "Toast".equals(s))
    {
        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:F1r3w477,項目名稱:CustomWorldGen,代碼行數:34,代碼來源:RenderRabbit.java

示例6: removeTextColorsIfConfigured

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


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