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