当前位置: 首页>>代码示例>>Java>>正文


Java Items.SKULL属性代码示例

本文整理汇总了Java中net.minecraft.init.Items.SKULL属性的典型用法代码示例。如果您正苦于以下问题:Java Items.SKULL属性的具体用法?Java Items.SKULL怎么用?Java Items.SKULL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraft.init.Items的用法示例。


在下文中一共展示了Items.SKULL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: skull

protected static ItemStack skull(String name, String owner, String texture)
{
	ItemStack stack = new ItemStack(Items.SKULL, 1, 3);

	NBTTagCompound display = new NBTTagCompound();
	display.setString("LocName", name);
	stack.setTagInfo("display", display);

	NBTTagCompound skullOwner = new NBTTagCompound();
	skullOwner.setString("Id", owner);
	NBTTagCompound properties = new NBTTagCompound();
	NBTTagList textures = new NBTTagList();
	NBTTagCompound tex = new NBTTagCompound();
	tex.setString("Value", texture);
	textures.appendTag(tex);
	properties.setTag("textures", textures);
	skullOwner.setTag("Properties", properties);
	stack.setTagInfo("SkullOwner", skullOwner);

	return stack;
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:21,代码来源:EvenMoreMobHeads.java

示例2: storeTEInStack

private ItemStack storeTEInStack(ItemStack stack, TileEntity te)
{
    NBTTagCompound nbttagcompound = te.writeToNBT(new NBTTagCompound());

    if (stack.getItem() == Items.SKULL && nbttagcompound.hasKey("Owner"))
    {
        NBTTagCompound nbttagcompound2 = nbttagcompound.getCompoundTag("Owner");
        NBTTagCompound nbttagcompound3 = new NBTTagCompound();
        nbttagcompound3.setTag("SkullOwner", nbttagcompound2);
        stack.setTagCompound(nbttagcompound3);
        return stack;
    }
    else
    {
        stack.setTagInfo("BlockEntityTag", nbttagcompound);
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        NBTTagList nbttaglist = new NBTTagList();
        nbttaglist.appendTag(new NBTTagString("(+NBT)"));
        nbttagcompound1.setTag("Lore", nbttaglist);
        stack.setTagInfo("display", nbttagcompound1);
        return stack;
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:23,代码来源:Minecraft.java

示例3: getDyeCraftingResult

private static ItemStack getDyeCraftingResult(int meta) {
	
	switch (meta) {
		default: return new ItemStack(Items.GHAST_TEAR);
		case 1: return new ItemStack(Items.FIRE_CHARGE, 8, 0);
		case 2: return new ItemStack(Items.DRAGON_BREATH);
		case 3: return new ItemStack(Items.DIAMOND);
		case 4: return new ItemStack(Items.GOLD_INGOT);
		case 5: return new ItemStack(Items.SLIME_BALL, 4, 0);
		case 6: return new ItemStack(Items.SADDLE);
		case 7: return new ItemStack(Blocks.CLAY, 8, 0);
		case 8: return new ItemStack(Items.IRON_INGOT, 2, 0);
		case 9: return new ItemStack(Blocks.STAINED_HARDENED_CLAY, 16, EnumDyeColor.CYAN.getMetadata());
		case 10: return new ItemStack(Items.CHORUS_FRUIT);
		case 11: return new ItemStack(Blocks.PRISMARINE, 8, 0);
		case 12: return new ItemStack(Blocks.DIRT, 3, 0);
		case 13: return new ItemStack(Items.EMERALD);
		case 14: return new ItemStack(Items.NETHER_WART);
		case 15: return new ItemStack(Items.SKULL, 1, 1);
	}
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:21,代码来源:UCRecipes.java

示例4: storeTEInStack

public ItemStack storeTEInStack(ItemStack stack, TileEntity te)
{
    NBTTagCompound nbttagcompound = te.writeToNBT(new NBTTagCompound());

    if (stack.getItem() == Items.SKULL && nbttagcompound.hasKey("Owner"))
    {
        NBTTagCompound nbttagcompound2 = nbttagcompound.getCompoundTag("Owner");
        NBTTagCompound nbttagcompound3 = new NBTTagCompound();
        nbttagcompound3.setTag("SkullOwner", nbttagcompound2);
        stack.setTagCompound(nbttagcompound3);
        return stack;
    }
    else
    {
        stack.setTagInfo("BlockEntityTag", nbttagcompound);
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        NBTTagList nbttaglist = new NBTTagList();
        nbttaglist.appendTag(new NBTTagString("(+NBT)"));
        nbttagcompound1.setTag("Lore", nbttaglist);
        stack.setTagInfo("display", nbttagcompound1);
        return stack;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:23,代码来源:Minecraft.java

示例5: getSkullDrop

public static ItemStack getSkullDrop(EntityLivingBase entity) {
	if (entity instanceof EntitySkeleton) {
		return new ItemStack(Items.SKULL, 1, 0);
	}
	if (entity instanceof EntityWitherSkeleton) {
		return new ItemStack(Items.SKULL, 1, 1);
	}
	if (entity instanceof EntityZombie) {
		return new ItemStack(Items.SKULL, 1, 2);
	}
	if (entity instanceof EntityCreeper) {
		return new ItemStack(Items.SKULL, 1, 4);
	}
	if (entity instanceof EntityPlayer) {
		ItemStack head = new ItemStack(Items.SKULL, 1, 3);
		NBTTagCompound nametag = new NBTTagCompound();
		nametag.setString("SkullOwner", entity.getDisplayName().getFormattedText());
		head.setTagCompound(nametag);
		return head;
	}
	if (entity instanceof EntityDragon) {
		return new ItemStack(Items.SKULL, 1, 5);
	}
	if (entity instanceof EntityEnderman) {
		if (entity instanceof EntityEvolvedEnderman) {
			return new ItemStack(ModItems.SKULL_EVOLVED_ENDERMAN);
		}
		return new ItemStack(ModItems.SKULL_ENDERMAN);
	}
	if (entity instanceof EntityFrienderman) {
		return new ItemStack(ModItems.SKULL_FRIENDERMAN);
	}
	return null;
}
 
开发者ID:p455w0rd,项目名称:EndermanEvolution,代码行数:34,代码来源:EntityUtils.java

示例6: getItem

public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
{
    int i = 0;
    TileEntity tileentity = worldIn.getTileEntity(pos);

    if (tileentity instanceof TileEntitySkull)
    {
        i = ((TileEntitySkull)tileentity).getSkullType();
    }

    return new ItemStack(Items.SKULL, 1, i);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:12,代码来源:BlockSkull.java

示例7: getDrops

public java.util.List<ItemStack> getDrops(IBlockAccess worldIn, BlockPos pos, IBlockState state, int fortune)
{
    java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
    {
        if (!((Boolean)state.getValue(NODROP)).booleanValue())
        {
            TileEntity tileentity = worldIn.getTileEntity(pos);

            if (tileentity instanceof TileEntitySkull)
            {
                TileEntitySkull tileentityskull = (TileEntitySkull)tileentity;
                ItemStack itemstack = new ItemStack(Items.SKULL, 1, tileentityskull.getSkullType());

                if (tileentityskull.getSkullType() == 3 && tileentityskull.getPlayerProfile() != null)
                {
                    itemstack.setTagCompound(new NBTTagCompound());
                    NBTTagCompound nbttagcompound = new NBTTagCompound();
                    NBTUtil.writeGameProfile(nbttagcompound, tileentityskull.getPlayerProfile());
                    itemstack.getTagCompound().setTag("SkullOwner", nbttagcompound);
                }

                ret.add(itemstack);
            }
        }
    }
    return ret;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:27,代码来源:BlockSkull.java

示例8: getSlotForItemStack

public static EntityEquipmentSlot getSlotForItemStack(ItemStack stack)
{
    return stack.getItem() != Item.getItemFromBlock(Blocks.PUMPKIN) && stack.getItem() != Items.SKULL ? (stack.getItem() instanceof ItemArmor ? ((ItemArmor)stack.getItem()).armorType : (stack.getItem() == Items.ELYTRA ? EntityEquipmentSlot.CHEST : (stack.getItem() == Items.SHIELD ? EntityEquipmentSlot.OFFHAND : EntityEquipmentSlot.MAINHAND))) : EntityEquipmentSlot.HEAD;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:4,代码来源:EntityLiving.java

示例9: func_190732_dj

protected ItemStack func_190732_dj()
{
    return new ItemStack(Items.SKULL, 1, 2);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:4,代码来源:EntityZombie.java

示例10: getItemDropped

/**
 * Get the Item that this Block should drop when harvested.
 */
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
    return Items.SKULL;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:BlockSkull.java

示例11: doRenderLayer

public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    ItemStack itemstack = entitylivingbaseIn.getItemStackFromSlot(EntityEquipmentSlot.HEAD);

    if (!itemstack.func_190926_b())
    {
        Item item = itemstack.getItem();
        Minecraft minecraft = Minecraft.getMinecraft();
        GlStateManager.pushMatrix();

        if (entitylivingbaseIn.isSneaking())
        {
            GlStateManager.translate(0.0F, 0.2F, 0.0F);
        }

        boolean flag = entitylivingbaseIn instanceof EntityVillager || entitylivingbaseIn instanceof EntityZombieVillager;

        if (entitylivingbaseIn.isChild() && !(entitylivingbaseIn instanceof EntityVillager))
        {
            float f = 2.0F;
            float f1 = 1.4F;
            GlStateManager.translate(0.0F, 0.5F * scale, 0.0F);
            GlStateManager.scale(0.7F, 0.7F, 0.7F);
            GlStateManager.translate(0.0F, 16.0F * scale, 0.0F);
        }

        this.modelRenderer.postRender(0.0625F);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

        if (item == Items.SKULL)
        {
            float f2 = 1.1875F;
            GlStateManager.scale(1.1875F, -1.1875F, -1.1875F);

            if (flag)
            {
                GlStateManager.translate(0.0F, 0.0625F, 0.0F);
            }

            GameProfile gameprofile = null;

            if (itemstack.hasTagCompound())
            {
                NBTTagCompound nbttagcompound = itemstack.getTagCompound();

                if (nbttagcompound.hasKey("SkullOwner", 10))
                {
                    gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner"));
                }
                else if (nbttagcompound.hasKey("SkullOwner", 8))
                {
                    String s = nbttagcompound.getString("SkullOwner");

                    if (!StringUtils.isBlank(s))
                    {
                        gameprofile = TileEntitySkull.updateGameprofile(new GameProfile((UUID)null, s));
                        nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile));
                    }
                }
            }

            TileEntitySkullRenderer.instance.renderSkull(-0.5F, 0.0F, -0.5F, EnumFacing.UP, 180.0F, itemstack.getMetadata(), gameprofile, -1, limbSwing);
        }
        else if (!(item instanceof ItemArmor) || ((ItemArmor)item).getEquipmentSlot() != EntityEquipmentSlot.HEAD)
        {
            float f3 = 0.625F;
            GlStateManager.translate(0.0F, -0.25F, 0.0F);
            GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.scale(0.625F, -0.625F, -0.625F);

            if (flag)
            {
                GlStateManager.translate(0.0F, 0.1875F, 0.0F);
            }

            minecraft.getItemRenderer().renderItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.HEAD);
        }

        GlStateManager.popMatrix();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:81,代码来源:LayerCustomHead.java

示例12: renderByItem

public void renderByItem(ItemStack itemStackIn)
{
    Item item = itemStackIn.getItem();

    if (item == Items.BANNER)
    {
        this.banner.setItemValues(itemStackIn, false);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(this.banner, 0.0D, 0.0D, 0.0D, 0.0F);
    }
    else if (item == Items.SHIELD)
    {
        if (itemStackIn.getSubCompound("BlockEntityTag") != null)
        {
            this.banner.setItemValues(itemStackIn, true);
            Minecraft.getMinecraft().getTextureManager().bindTexture(BannerTextures.SHIELD_DESIGNS.getResourceLocation(this.banner.getPatternResourceLocation(), this.banner.getPatternList(), this.banner.getColorList()));
        }
        else
        {
            Minecraft.getMinecraft().getTextureManager().bindTexture(BannerTextures.SHIELD_BASE_TEXTURE);
        }

        GlStateManager.pushMatrix();
        GlStateManager.scale(1.0F, -1.0F, -1.0F);
        this.modelShield.render();
        GlStateManager.popMatrix();
    }
    else if (item == Items.SKULL)
    {
        GameProfile gameprofile = null;

        if (itemStackIn.hasTagCompound())
        {
            NBTTagCompound nbttagcompound = itemStackIn.getTagCompound();

            if (nbttagcompound.hasKey("SkullOwner", 10))
            {
                gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner"));
            }
            else if (nbttagcompound.hasKey("SkullOwner", 8) && !StringUtils.isBlank(nbttagcompound.getString("SkullOwner")))
            {
                GameProfile gameprofile1 = new GameProfile((UUID)null, nbttagcompound.getString("SkullOwner"));
                gameprofile = TileEntitySkull.updateGameprofile(gameprofile1);
                nbttagcompound.removeTag("SkullOwner");
                nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile));
            }
        }

        if (TileEntitySkullRenderer.instance != null)
        {
            GlStateManager.pushMatrix();
            GlStateManager.disableCull();
            TileEntitySkullRenderer.instance.renderSkull(0.0F, 0.0F, 0.0F, EnumFacing.UP, 180.0F, itemStackIn.getMetadata(), gameprofile, -1, 0.0F);
            GlStateManager.enableCull();
            GlStateManager.popMatrix();
        }
    }
    else if (item == Item.getItemFromBlock(Blocks.ENDER_CHEST))
    {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(this.enderChest, 0.0D, 0.0D, 0.0D, 0.0F);
    }
    else if (item == Item.getItemFromBlock(Blocks.TRAPPED_CHEST))
    {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chestTrap, 0.0D, 0.0D, 0.0D, 0.0F);
    }
    else if (Block.getBlockFromItem(item) instanceof BlockShulkerBox)
    {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(field_191274_b[BlockShulkerBox.func_190955_b(item).getMetadata()], 0.0D, 0.0D, 0.0D, 0.0F);
    }
    else
    {
        TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chestBasic, 0.0D, 0.0D, 0.0D, 0.0F);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:73,代码来源:TileEntityItemStackRenderer.java

示例13: getItemDropped

/**
 * Get the Item that this Block should drop when harvested.
 */
@Nullable
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
    return Items.SKULL;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:BlockSkull.java

示例14: doRenderLayer

public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    ItemStack itemstack = entitylivingbaseIn.getItemStackFromSlot(EntityEquipmentSlot.HEAD);

    if (itemstack != null && itemstack.getItem() != null)
    {
        Item item = itemstack.getItem();
        Minecraft minecraft = Minecraft.getMinecraft();
        GlStateManager.pushMatrix();

        if (entitylivingbaseIn.isSneaking())
        {
            GlStateManager.translate(0.0F, 0.2F, 0.0F);
        }

        boolean flag = entitylivingbaseIn instanceof EntityVillager || entitylivingbaseIn instanceof EntityZombie && ((EntityZombie)entitylivingbaseIn).isVillager();

        if (entitylivingbaseIn.isChild() && !(entitylivingbaseIn instanceof EntityVillager))
        {
            float f = 2.0F;
            float f1 = 1.4F;
            GlStateManager.translate(0.0F, 0.5F * scale, 0.0F);
            GlStateManager.scale(0.7F, 0.7F, 0.7F);
            GlStateManager.translate(0.0F, 16.0F * scale, 0.0F);
        }

        this.modelRenderer.postRender(0.0625F);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

        if (item == Items.SKULL)
        {
            float f2 = 1.1875F;
            GlStateManager.scale(1.1875F, -1.1875F, -1.1875F);

            if (flag)
            {
                GlStateManager.translate(0.0F, 0.0625F, 0.0F);
            }

            GameProfile gameprofile = null;

            if (itemstack.hasTagCompound())
            {
                NBTTagCompound nbttagcompound = itemstack.getTagCompound();

                if (nbttagcompound.hasKey("SkullOwner", 10))
                {
                    gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner"));
                }
                else if (nbttagcompound.hasKey("SkullOwner", 8))
                {
                    String s = nbttagcompound.getString("SkullOwner");

                    if (!StringUtils.isNullOrEmpty(s))
                    {
                        gameprofile = TileEntitySkull.updateGameprofile(new GameProfile((UUID)null, s));
                        nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile));
                    }
                }
            }

            TileEntitySkullRenderer.instance.renderSkull(-0.5F, 0.0F, -0.5F, EnumFacing.UP, 180.0F, itemstack.getMetadata(), gameprofile, -1, limbSwing);
        }
        else if (!(item instanceof ItemArmor) || ((ItemArmor)item).getEquipmentSlot() != EntityEquipmentSlot.HEAD)
        {
            float f3 = 0.625F;
            GlStateManager.translate(0.0F, -0.25F, 0.0F);
            GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.scale(0.625F, -0.625F, -0.625F);

            if (flag)
            {
                GlStateManager.translate(0.0F, 0.1875F, 0.0F);
            }

            minecraft.getItemRenderer().renderItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.HEAD);
        }

        GlStateManager.popMatrix();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:81,代码来源:LayerCustomHead.java

示例15: renderByItem

public void renderByItem(ItemStack itemStackIn)
{
    if (itemStackIn.getItem() == Items.BANNER)
    {
        this.banner.setItemValues(itemStackIn);
        TileEntityRendererDispatcher.instance.renderTileEntityAt(this.banner, 0.0D, 0.0D, 0.0D, 0.0F);
    }
    else if (itemStackIn.getItem() == Items.SHIELD)
    {
        if (itemStackIn.getSubCompound("BlockEntityTag", false) != null)
        {
            this.banner.setItemValues(itemStackIn);
            Minecraft.getMinecraft().getTextureManager().bindTexture(BannerTextures.SHIELD_DESIGNS.getResourceLocation(this.banner.getPatternResourceLocation(), this.banner.getPatternList(), this.banner.getColorList()));
        }
        else
        {
            Minecraft.getMinecraft().getTextureManager().bindTexture(BannerTextures.SHIELD_BASE_TEXTURE);
        }

        GlStateManager.pushMatrix();
        GlStateManager.scale(1.0F, -1.0F, -1.0F);
        this.modelShield.render();
        GlStateManager.popMatrix();
    }
    else if (itemStackIn.getItem() == Items.SKULL)
    {
        GameProfile gameprofile = null;

        if (itemStackIn.hasTagCompound())
        {
            NBTTagCompound nbttagcompound = itemStackIn.getTagCompound();

            if (nbttagcompound.hasKey("SkullOwner", 10))
            {
                gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner"));
            }
            else if (nbttagcompound.hasKey("SkullOwner", 8) && !nbttagcompound.getString("SkullOwner").isEmpty())
            {
                GameProfile lvt_2_2_ = new GameProfile((UUID)null, nbttagcompound.getString("SkullOwner"));
                gameprofile = TileEntitySkull.updateGameprofile(lvt_2_2_);
                nbttagcompound.removeTag("SkullOwner");
                nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile));
            }
        }

        if (TileEntitySkullRenderer.instance != null)
        {
            GlStateManager.pushMatrix();
            GlStateManager.disableCull();
            TileEntitySkullRenderer.instance.renderSkull(0.0F, 0.0F, 0.0F, EnumFacing.UP, 0.0F, itemStackIn.getMetadata(), gameprofile, -1, 0.0F);
            GlStateManager.enableCull();
            GlStateManager.popMatrix();
        }
    }
    else
    {
        Block block = Block.getBlockFromItem(itemStackIn.getItem());

        if (block == Blocks.ENDER_CHEST)
        {
            TileEntityRendererDispatcher.instance.renderTileEntityAt(this.enderChest, 0.0D, 0.0D, 0.0D, 0.0F);
        }
        else if (block == Blocks.TRAPPED_CHEST)
        {
            TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chestTrap, 0.0D, 0.0D, 0.0D, 0.0F);
        }
        else if (block != Blocks.CHEST) net.minecraftforge.client.ForgeHooksClient.renderTileItem(itemStackIn.getItem(), itemStackIn.getMetadata());
        else
        {
            TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chestBasic, 0.0D, 0.0D, 0.0D, 0.0F);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:73,代码来源:TileEntityItemStackRenderer.java


注:本文中的net.minecraft.init.Items.SKULL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。