本文整理匯總了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);
}
}
示例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);
}
}
}
示例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;
}
}
}
示例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);
}
}
}
示例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;
}
}
}
示例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;
}