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


Java IBlockState.getPackedLightmapCoords方法代碼示例

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


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

示例1: renderModelFlat

import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
public boolean renderModelFlat(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
    boolean flag = false;
    RenderEnv renderenv = buffer.getRenderEnv(worldIn, stateIn, posIn);

    for (EnumFacing enumfacing : EnumFacing.VALUES)
    {
        List<BakedQuad> list = modelIn.getQuads(stateIn, enumfacing, rand);

        if (!list.isEmpty() && (!checkSides || stateIn.shouldSideBeRendered(worldIn, posIn, enumfacing)))
        {
            int i = stateIn.getPackedLightmapCoords(worldIn, posIn.offset(enumfacing));
            list = BlockModelCustomizer.getRenderQuads(list, worldIn, stateIn, posIn, enumfacing, rand, renderenv);
            this.renderQuadsFlat(worldIn, stateIn, posIn, i, false, buffer, list, renderenv);
            flag = true;
        }
    }

    List<BakedQuad> list1 = modelIn.getQuads(stateIn, (EnumFacing)null, rand);

    if (!list1.isEmpty())
    {
        list1 = BlockModelCustomizer.getRenderQuads(list1, worldIn, stateIn, posIn, (EnumFacing)null, rand, renderenv);
        this.renderQuadsFlat(worldIn, stateIn, posIn, -1, true, buffer, list1, renderenv);
        flag = true;
    }

    return flag;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:30,代碼來源:BlockModelRenderer.java

示例2: renderModelFlat

import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
public boolean renderModelFlat(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
    boolean flag = false;
    BitSet bitset = new BitSet(3);

    for (EnumFacing enumfacing : EnumFacing.values())
    {
        List<BakedQuad> list = modelIn.getQuads(stateIn, enumfacing, rand);

        if (!list.isEmpty() && (!checkSides || stateIn.shouldSideBeRendered(worldIn, posIn, enumfacing)))
        {
            int i = stateIn.getPackedLightmapCoords(worldIn, posIn.offset(enumfacing));
            this.renderQuadsFlat(worldIn, stateIn, posIn, i, false, buffer, list, bitset);
            flag = true;
        }
    }

    List<BakedQuad> list1 = modelIn.getQuads(stateIn, (EnumFacing)null, rand);

    if (!list1.isEmpty())
    {
        this.renderQuadsFlat(worldIn, stateIn, posIn, -1, true, buffer, list1, bitset);
        flag = true;
    }

    return flag;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:28,代碼來源:BlockModelRenderer.java

示例3: renderQuadsFlat

import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
private void renderQuadsFlat(IBlockAccess p_renderQuadsFlat_1_, IBlockState p_renderQuadsFlat_2_, BlockPos p_renderQuadsFlat_3_, int p_renderQuadsFlat_4_, boolean p_renderQuadsFlat_5_, VertexBuffer p_renderQuadsFlat_6_, List<BakedQuad> p_renderQuadsFlat_7_, RenderEnv p_renderQuadsFlat_8_)
{
    BitSet bitset = p_renderQuadsFlat_8_.getBoundsFlags();
    Vec3d vec3d = p_renderQuadsFlat_2_.func_191059_e(p_renderQuadsFlat_1_, p_renderQuadsFlat_3_);
    double d0 = (double)p_renderQuadsFlat_3_.getX() + vec3d.xCoord;
    double d1 = (double)p_renderQuadsFlat_3_.getY() + vec3d.yCoord;
    double d2 = (double)p_renderQuadsFlat_3_.getZ() + vec3d.zCoord;
    int i = 0;

    for (int j = p_renderQuadsFlat_7_.size(); i < j; ++i)
    {
        BakedQuad bakedquad = (BakedQuad)p_renderQuadsFlat_7_.get(i);

        if (p_renderQuadsFlat_5_)
        {
            this.fillQuadBounds(p_renderQuadsFlat_2_, bakedquad.getVertexData(), bakedquad.getFace(), (float[])null, bitset);
            BlockPos blockpos = bitset.get(0) ? p_renderQuadsFlat_3_.offset(bakedquad.getFace()) : p_renderQuadsFlat_3_;
            p_renderQuadsFlat_4_ = p_renderQuadsFlat_2_.getPackedLightmapCoords(p_renderQuadsFlat_1_, blockpos);
        }

        if (p_renderQuadsFlat_6_.isMultiTexture())
        {
            p_renderQuadsFlat_6_.addVertexData(bakedquad.getVertexDataSingle());
            p_renderQuadsFlat_6_.putSprite(bakedquad.getSprite());
        }
        else
        {
            p_renderQuadsFlat_6_.addVertexData(bakedquad.getVertexData());
        }

        p_renderQuadsFlat_6_.putBrightness4(p_renderQuadsFlat_4_, p_renderQuadsFlat_4_, p_renderQuadsFlat_4_, p_renderQuadsFlat_4_);
        int l = CustomColors.getColorMultiplier(bakedquad, p_renderQuadsFlat_2_, p_renderQuadsFlat_1_, p_renderQuadsFlat_3_, p_renderQuadsFlat_8_);

        if (!bakedquad.hasTintIndex() && l == -1)
        {
            if (bakedquad.shouldApplyDiffuseLighting())
            {
                float f4 = FaceBakery.getFaceBrightness(bakedquad.getFace());
                p_renderQuadsFlat_6_.putColorMultiplier(f4, f4, f4, 4);
                p_renderQuadsFlat_6_.putColorMultiplier(f4, f4, f4, 3);
                p_renderQuadsFlat_6_.putColorMultiplier(f4, f4, f4, 2);
                p_renderQuadsFlat_6_.putColorMultiplier(f4, f4, f4, 1);
            }
        }
        else
        {
            int k = l;

            if (l == -1)
            {
                k = this.blockColors.colorMultiplier(p_renderQuadsFlat_2_, p_renderQuadsFlat_1_, p_renderQuadsFlat_3_, bakedquad.getTintIndex());
            }

            if (EntityRenderer.anaglyphEnable)
            {
                k = TextureUtil.anaglyphColor(k);
            }

            float f = (float)(k >> 16 & 255) / 255.0F;
            float f1 = (float)(k >> 8 & 255) / 255.0F;
            float f2 = (float)(k & 255) / 255.0F;

            if (bakedquad.shouldApplyDiffuseLighting())
            {
                float f3 = FaceBakery.getFaceBrightness(bakedquad.getFace());
                f *= f3;
                f1 *= f3;
                f2 *= f3;
            }

            p_renderQuadsFlat_6_.putColorMultiplier(f, f1, f2, 4);
            p_renderQuadsFlat_6_.putColorMultiplier(f, f1, f2, 3);
            p_renderQuadsFlat_6_.putColorMultiplier(f, f1, f2, 2);
            p_renderQuadsFlat_6_.putColorMultiplier(f, f1, f2, 1);
        }

        p_renderQuadsFlat_6_.putPosition(d0, d1, d2);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:80,代碼來源:BlockModelRenderer.java

示例4: renderOverlayModels

import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
private void renderOverlayModels(IBlockAccess p_renderOverlayModels_1_, IBakedModel p_renderOverlayModels_2_, IBlockState p_renderOverlayModels_3_, BlockPos p_renderOverlayModels_4_, VertexBuffer p_renderOverlayModels_5_, boolean p_renderOverlayModels_6_, long p_renderOverlayModels_7_, RenderEnv p_renderOverlayModels_9_, boolean p_renderOverlayModels_10_)
{
    if (p_renderOverlayModels_9_.isOverlaysRendered())
    {
        for (int i = 0; i < OVERLAY_LAYERS.length; ++i)
        {
            BlockRenderLayer blockrenderlayer = OVERLAY_LAYERS[i];
            ListQuadsOverlay listquadsoverlay = p_renderOverlayModels_9_.getListQuadsOverlay(blockrenderlayer);

            if (listquadsoverlay.size() > 0)
            {
                RegionRenderCacheBuilder regionrendercachebuilder = p_renderOverlayModels_9_.getRegionRenderCacheBuilder();

                if (regionrendercachebuilder != null)
                {
                    VertexBuffer vertexbuffer = regionrendercachebuilder.getWorldRendererByLayer(blockrenderlayer);

                    if (!vertexbuffer.isDrawing())
                    {
                        vertexbuffer.begin(7, DefaultVertexFormats.BLOCK);
                        vertexbuffer.setTranslation(p_renderOverlayModels_5_.getXOffset(), p_renderOverlayModels_5_.getYOffset(), p_renderOverlayModels_5_.getZOffset());
                    }

                    for (int j = 0; j < listquadsoverlay.size(); ++j)
                    {
                        BakedQuad bakedquad = listquadsoverlay.getQuad(j);
                        List<BakedQuad> list = listquadsoverlay.getListQuadsSingle(bakedquad);
                        IBlockState iblockstate = listquadsoverlay.getBlockState(j);
                        p_renderOverlayModels_9_.reset(p_renderOverlayModels_1_, iblockstate, p_renderOverlayModels_4_);

                        if (p_renderOverlayModels_10_)
                        {
                            this.renderQuadsSmooth(p_renderOverlayModels_1_, iblockstate, p_renderOverlayModels_4_, vertexbuffer, list, p_renderOverlayModels_9_);
                        }
                        else
                        {
                            int k = iblockstate.getPackedLightmapCoords(p_renderOverlayModels_1_, p_renderOverlayModels_4_.offset(bakedquad.getFace()));
                            this.renderQuadsFlat(p_renderOverlayModels_1_, iblockstate, p_renderOverlayModels_4_, k, false, vertexbuffer, list, p_renderOverlayModels_9_);
                        }
                    }
                }

                listquadsoverlay.clear();
            }
        }
    }

    if (Config.isBetterSnow() && !p_renderOverlayModels_9_.isBreakingAnimation() && BetterSnow.shouldRender(p_renderOverlayModels_1_, p_renderOverlayModels_3_, p_renderOverlayModels_4_))
    {
        IBakedModel ibakedmodel = BetterSnow.getModelSnowLayer();
        IBlockState iblockstate1 = BetterSnow.getStateSnowLayer();
        this.renderModel(p_renderOverlayModels_1_, ibakedmodel, iblockstate1, p_renderOverlayModels_4_, p_renderOverlayModels_5_, p_renderOverlayModels_6_, p_renderOverlayModels_7_);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:55,代碼來源:BlockModelRenderer.java


注:本文中的net.minecraft.block.state.IBlockState.getPackedLightmapCoords方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。