本文整理匯總了Java中net.minecraft.nbt.NBTUtil.func_152459_a方法的典型用法代碼示例。如果您正苦於以下問題:Java NBTUtil.func_152459_a方法的具體用法?Java NBTUtil.func_152459_a怎麽用?Java NBTUtil.func_152459_a使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.nbt.NBTUtil
的用法示例。
在下文中一共展示了NBTUtil.func_152459_a方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: readFromNBT
import net.minecraft.nbt.NBTUtil; //導入方法依賴的package包/類
public void readFromNBT(NBTTagCompound p_145839_1_)
{
super.readFromNBT(p_145839_1_);
this.field_145908_a = p_145839_1_.getByte("SkullType");
this.field_145910_i = p_145839_1_.getByte("Rot");
if (this.field_145908_a == 3)
{
if (p_145839_1_.hasKey("Owner", 10))
{
this.field_152110_j = NBTUtil.func_152459_a(p_145839_1_.getCompoundTag("Owner"));
}
else if (p_145839_1_.hasKey("ExtraType", 8) && !StringUtils.isNullOrEmpty(p_145839_1_.getString("ExtraType")))
{
this.field_152110_j = new GameProfile((UUID)null, p_145839_1_.getString("ExtraType"));
this.func_152109_d();
}
}
}
示例2: CraftMetaSkull
import net.minecraft.nbt.NBTUtil; //導入方法依賴的package包/類
CraftMetaSkull(net.minecraft.nbt.NBTTagCompound tag) {
super(tag);
if (tag.hasKey(SKULL_OWNER.NBT, 10)) {
profile = NBTUtil.func_152459_a(tag.getCompoundTag(SKULL_OWNER.NBT));
} else if (tag.hasKey(SKULL_OWNER.NBT, 8)) {
profile = new GameProfile(null, tag.getString(SKULL_OWNER.NBT));
}
}
示例3: getGameProfile
import net.minecraft.nbt.NBTUtil; //導入方法依賴的package包/類
private GameProfile getGameProfile(ItemStack stack) {
GameProfile profile = null;
if (stack.hasTagCompound()) {
NBTTagCompound nbt = stack.getTagCompound();
if (nbt.hasKey("SkullOwner", Constants.NBT.TAG_COMPOUND))
profile = NBTUtil.func_152459_a(nbt.getCompoundTag("SkullOwner"));
else if (nbt.hasKey("SkullOwner", Constants.NBT.TAG_STRING))
profile = new GameProfile(null, nbt.getString("SkullOwner"));
}
return profile;
}
示例4: getItemStackDisplayName
import net.minecraft.nbt.NBTUtil; //導入方法依賴的package包/類
@Override
public String getItemStackDisplayName(ItemStack stack)
{
GameProfile username = NBTUtil.func_152459_a(NBTHelper.getCompoundTag(stack, "profile"));
return StatCollector.translateToLocal("item.peripheralsplusplus:permissionsCard.name") + (NBTHelper.getTag(stack, "profile") == null ? "" : " - " + username.getName());
}
示例5: readFromNBT
import net.minecraft.nbt.NBTUtil; //導入方法依賴的package包/類
public void readFromNBT(NBTTagCompound nbtTag)
{
super.readFromNBT(nbtTag);
this.owner = NBTUtil.func_152459_a(nbtTag);
}
示例6: renderSpecials
import net.minecraft.nbt.NBTUtil; //導入方法依賴的package包/類
/**
* Method for adding special render rules
*/
protected void renderSpecials(EntityStatuePlayer player, float par2) {
float f1 = 1.0F;
GL11.glColor3f(f1, f1, f1);
super.renderEquippedItems(player, par2);
super.renderArrowsStuckInEntity(player, par2);
ItemStack stack = player.inventory.armorItemInSlot(3);
if (stack != null) {
GL11.glPushMatrix();
modelBipedMain.bipedHead.postRender(0.0625F);
float f2;
if (stack != null && stack.getItem() instanceof ItemBlock) {
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(stack, EQUIPPED);
boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, stack, BLOCK_3D));
if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) {
f2 = 0.625F;
GL11.glTranslatef(0.0F, -0.25F, 0.0F);
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glScalef(f2, -f2, -f2);
}
renderManager.itemRenderer.renderItem(player, stack, 0);
} else if (stack.getItem().equals(Items.skull)) {
f2 = 1.0625F;
GL11.glScalef(f2, -f2, -f2);
GameProfile s = null;
if (stack.hasTagCompound() && stack.getTagCompound().hasKey("Owner")) {
s = NBTUtil.func_152459_a(stack.getTagCompound().getCompoundTag("Owner"));
}
TileEntitySkullRenderer.field_147536_b.func_152674_a(-0.5F, 0.0F, -0.5F, 1, 180.0F, stack.getItemDamage(), s);
}
GL11.glPopMatrix();
}
renderItemInRightArm(player);
renderItemInLeftArm(player);
}