本文整理汇总了Java中net.minecraft.nbt.NBTTagString.toString方法的典型用法代码示例。如果您正苦于以下问题:Java NBTTagString.toString方法的具体用法?Java NBTTagString.toString怎么用?Java NBTTagString.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.nbt.NBTTagString
的用法示例。
在下文中一共展示了NBTTagString.toString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_77628_j
import net.minecraft.nbt.NBTTagString; //导入方法依赖的package包/类
public String func_77628_j(ItemStack p_77628_1_) {
if(p_77628_1_.func_77942_o()) {
NBTTagCompound var2 = p_77628_1_.func_77978_p();
NBTTagString var3 = (NBTTagString)var2.func_74781_a("title");
if(var3 != null) {
return var3.toString();
}
}
return super.func_77628_j(p_77628_1_);
}
示例2: func_74158_i
import net.minecraft.nbt.NBTTagString; //导入方法依赖的package包/类
private String func_74158_i() {
if(this.field_74177_s != null && this.field_74178_r >= 0 && this.field_74178_r < this.field_74177_s.func_74745_c()) {
NBTTagString var1 = (NBTTagString)this.field_74177_s.func_74743_b(this.field_74178_r);
return var1.toString();
} else {
return "";
}
}
示例3: getItemDisplayName
import net.minecraft.nbt.NBTTagString; //导入方法依赖的package包/类
public String getItemDisplayName(ItemStack par1ItemStack)
{
if (par1ItemStack.hasTagCompound())
{
NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound();
NBTTagString nbttagstring = (NBTTagString)nbttagcompound.getTag("title");
if (nbttagstring != null)
{
return nbttagstring.toString();
}
}
return super.getItemDisplayName(par1ItemStack);
}
示例4: func_74158_i
import net.minecraft.nbt.NBTTagString; //导入方法依赖的package包/类
private String func_74158_i()
{
if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount())
{
NBTTagString nbttagstring = (NBTTagString)this.bookPages.tagAt(this.currPage);
return nbttagstring.toString();
}
else
{
return "";
}
}
示例5: func_73863_a
import net.minecraft.nbt.NBTTagString; //导入方法依赖的package包/类
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_73882_e.func_110434_K().func_110577_a(field_110405_a);
int var4 = (this.field_73880_f - this.field_74171_o) / 2;
byte var5 = 2;
this.func_73729_b(var4, var5, 0, 0, this.field_74171_o, this.field_74180_p);
String var6;
String var7;
int var8;
if(this.field_74172_m) {
var6 = this.field_74176_t;
if(this.field_74168_c) {
if(this.field_74170_n / 6 % 2 == 0) {
var6 = var6 + "" + EnumChatFormatting.BLACK + "_";
} else {
var6 = var6 + "" + EnumChatFormatting.GRAY + "_";
}
}
var7 = I18n.func_135053_a("book.editTitle");
var8 = this.field_73886_k.func_78256_a(var7);
this.field_73886_k.func_78276_b(var7, var4 + 36 + (116 - var8) / 2, var5 + 16 + 16, 0);
int var9 = this.field_73886_k.func_78256_a(var6);
this.field_73886_k.func_78276_b(var6, var4 + 36 + (116 - var9) / 2, var5 + 48, 0);
String var10 = String.format(I18n.func_135053_a("book.byAuthor"), new Object[]{this.field_74169_a.func_70005_c_()});
int var11 = this.field_73886_k.func_78256_a(var10);
this.field_73886_k.func_78276_b(EnumChatFormatting.DARK_GRAY + var10, var4 + 36 + (116 - var11) / 2, var5 + 48 + 10, 0);
String var12 = I18n.func_135053_a("book.finalizeWarning");
this.field_73886_k.func_78279_b(var12, var4 + 36, var5 + 80, 116, 0);
} else {
var6 = String.format(I18n.func_135053_a("book.pageIndicator"), new Object[]{Integer.valueOf(this.field_74178_r + 1), Integer.valueOf(this.field_74179_q)});
var7 = "";
if(this.field_74177_s != null && this.field_74178_r >= 0 && this.field_74178_r < this.field_74177_s.func_74745_c()) {
NBTTagString var13 = (NBTTagString)this.field_74177_s.func_74743_b(this.field_74178_r);
var7 = var13.toString();
}
if(this.field_74168_c) {
if(this.field_73886_k.func_78260_a()) {
var7 = var7 + "_";
} else if(this.field_74170_n / 6 % 2 == 0) {
var7 = var7 + "" + EnumChatFormatting.BLACK + "_";
} else {
var7 = var7 + "" + EnumChatFormatting.GRAY + "_";
}
}
var8 = this.field_73886_k.func_78256_a(var6);
this.field_73886_k.func_78276_b(var6, var4 - var8 + this.field_74171_o - 44, var5 + 16, 0);
this.field_73886_k.func_78279_b(var7, var4 + 36, var5 + 16 + 16, 116, 0);
}
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
}
示例6: drawScreen
import net.minecraft.nbt.NBTTagString; //导入方法依赖的package包/类
/**
* Draws the screen and all the components in it.
*/
public void drawScreen(int par1, int par2, float par3)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(bookGuiTextures);
int k = (this.width - this.bookImageWidth) / 2;
byte b0 = 2;
this.drawTexturedModalRect(k, b0, 0, 0, this.bookImageWidth, this.bookImageHeight);
String s;
String s1;
int l;
if (this.editingTitle)
{
s = this.bookTitle;
if (this.bookIsUnsigned)
{
if (this.updateCount / 6 % 2 == 0)
{
s = s + "" + EnumChatFormatting.BLACK + "_";
}
else
{
s = s + "" + EnumChatFormatting.GRAY + "_";
}
}
s1 = I18n.getString("book.editTitle");
l = this.fontRenderer.getStringWidth(s1);
this.fontRenderer.drawString(s1, k + 36 + (116 - l) / 2, b0 + 16 + 16, 0);
int i1 = this.fontRenderer.getStringWidth(s);
this.fontRenderer.drawString(s, k + 36 + (116 - i1) / 2, b0 + 48, 0);
String s2 = String.format(I18n.getString("book.byAuthor"), new Object[] {this.editingPlayer.getCommandSenderName()});
int j1 = this.fontRenderer.getStringWidth(s2);
this.fontRenderer.drawString(EnumChatFormatting.DARK_GRAY + s2, k + 36 + (116 - j1) / 2, b0 + 48 + 10, 0);
String s3 = I18n.getString("book.finalizeWarning");
this.fontRenderer.drawSplitString(s3, k + 36, b0 + 80, 116, 0);
}
else
{
s = String.format(I18n.getString("book.pageIndicator"), new Object[] {Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages)});
s1 = "";
if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount())
{
NBTTagString nbttagstring = (NBTTagString)this.bookPages.tagAt(this.currPage);
s1 = nbttagstring.toString();
}
if (this.bookIsUnsigned)
{
if (this.fontRenderer.getBidiFlag())
{
s1 = s1 + "_";
}
else if (this.updateCount / 6 % 2 == 0)
{
s1 = s1 + "" + EnumChatFormatting.BLACK + "_";
}
else
{
s1 = s1 + "" + EnumChatFormatting.GRAY + "_";
}
}
l = this.fontRenderer.getStringWidth(s);
this.fontRenderer.drawString(s, k - l + this.bookImageWidth - 44, b0 + 16, 0);
this.fontRenderer.drawSplitString(s1, k + 36, b0 + 16 + 16, 116, 0);
}
super.drawScreen(par1, par2, par3);
}