當前位置: 首頁>>代碼示例>>Java>>正文


Java Blocks.ENDER_CHEST屬性代碼示例

本文整理匯總了Java中net.minecraft.init.Blocks.ENDER_CHEST屬性的典型用法代碼示例。如果您正苦於以下問題:Java Blocks.ENDER_CHEST屬性的具體用法?Java Blocks.ENDER_CHEST怎麽用?Java Blocks.ENDER_CHEST使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在net.minecraft.init.Blocks的用法示例。


在下文中一共展示了Blocks.ENDER_CHEST屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isVanillaChest

public static boolean isVanillaChest(Block block, boolean includeEnderChest) {
	return block == Blocks.CHEST || block == Blocks.TRAPPED_CHEST || (includeEnderChest ? block == Blocks.ENDER_CHEST : false);
}
 
開發者ID:p455w0rd,項目名稱:EndermanEvolution,代碼行數:3,代碼來源:ChestUtils.java

示例2: getTexture

public TextureAtlasSprite getTexture(IBlockState state)
{
    Block block = state.getBlock();
    IBakedModel ibakedmodel = this.getModelForState(state);

    if (ibakedmodel == null || ibakedmodel == this.modelManager.getMissingModel())
    {
        if (block == Blocks.WALL_SIGN || block == Blocks.STANDING_SIGN || block == Blocks.CHEST || block == Blocks.TRAPPED_CHEST || block == Blocks.STANDING_BANNER || block == Blocks.WALL_BANNER)
        {
            return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/planks_oak");
        }

        if (block == Blocks.ENDER_CHEST)
        {
            return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/obsidian");
        }

        if (block == Blocks.FLOWING_LAVA || block == Blocks.LAVA)
        {
            return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/lava_still");
        }

        if (block == Blocks.FLOWING_WATER || block == Blocks.WATER)
        {
            return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/water_still");
        }

        if (block == Blocks.SKULL)
        {
            return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/soul_sand");
        }

        if (block == Blocks.BARRIER)
        {
            return this.modelManager.getTextureMap().getAtlasSprite("minecraft:items/barrier");
        }
    }

    if (ibakedmodel == null)
    {
        ibakedmodel = this.modelManager.getMissingModel();
    }

    return ibakedmodel.getParticleTexture();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:45,代碼來源:BlockModelShapes.java

示例3: 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.Blocks.ENDER_CHEST屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。