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


Java BakedQuad.getVertexData方法代碼示例

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


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

示例1: makeQuad

import net.minecraft.client.renderer.block.model.BakedQuad; //導入方法依賴的package包/類
private BakedQuad makeQuad(BakedQuad p_makeQuad_1_, int p_makeQuad_2_, boolean p_makeQuad_3_)
{
    int[] aint = p_makeQuad_1_.getVertexData();
    int i = p_makeQuad_1_.getTintIndex();
    EnumFacing enumfacing = p_makeQuad_1_.getFace();
    TextureAtlasSprite textureatlassprite = p_makeQuad_1_.getSprite();

    if (!this.isFullSprite(p_makeQuad_1_))
    {
        return p_makeQuad_1_;
    }
    else
    {
        aint = this.transformVertexData(aint, p_makeQuad_2_, p_makeQuad_3_);
        BakedQuad bakedquad = new BakedQuad(aint, i, enumfacing, textureatlassprite);
        return bakedquad;
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:19,代碼來源:NaturalProperties.java

示例2: forgeHooksClient_putQuadColor

import net.minecraft.client.renderer.block.model.BakedQuad; //導入方法依賴的package包/類
public static void forgeHooksClient_putQuadColor(WorldRenderer p_forgeHooksClient_putQuadColor_0_, BakedQuad p_forgeHooksClient_putQuadColor_1_, int p_forgeHooksClient_putQuadColor_2_)
{
    float f = (float)(p_forgeHooksClient_putQuadColor_2_ & 255);
    float f1 = (float)(p_forgeHooksClient_putQuadColor_2_ >>> 8 & 255);
    float f2 = (float)(p_forgeHooksClient_putQuadColor_2_ >>> 16 & 255);
    float f3 = (float)(p_forgeHooksClient_putQuadColor_2_ >>> 24 & 255);
    int[] aint = p_forgeHooksClient_putQuadColor_1_.getVertexData();
    int i = aint.length / 4;

    for (int j = 0; j < 4; ++j)
    {
        int k = aint[3 + i * j];
        float f4 = (float)(k & 255);
        float f5 = (float)(k >>> 8 & 255);
        float f6 = (float)(k >>> 16 & 255);
        float f7 = (float)(k >>> 24 & 255);
        int l = Math.min(255, (int)(f * f4 / 255.0F));
        int i1 = Math.min(255, (int)(f1 * f5 / 255.0F));
        int j1 = Math.min(255, (int)(f2 * f6 / 255.0F));
        int k1 = Math.min(255, (int)(f3 * f7 / 255.0F));
        p_forgeHooksClient_putQuadColor_0_.putColorRGBA(p_forgeHooksClient_putQuadColor_0_.getColorIndex(4 - j), l, i1, j1, k1);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:24,代碼來源:RenderItem.java

示例3: makeQuad

import net.minecraft.client.renderer.block.model.BakedQuad; //導入方法依賴的package包/類
private BakedQuad makeQuad(BakedQuad p_makeQuad_1_, int p_makeQuad_2_, boolean p_makeQuad_3_)
{
    int[] aint = p_makeQuad_1_.getVertexData();
    int i = p_makeQuad_1_.getTintIndex();
    EnumFacing enumfacing = p_makeQuad_1_.getFace();
    TextureAtlasSprite textureatlassprite = p_makeQuad_1_.getSprite();

    if (!this.isFullSprite(p_makeQuad_1_))
    {
        p_makeQuad_2_ = 0;
    }

    aint = this.transformVertexData(aint, p_makeQuad_2_, p_makeQuad_3_);
    BakedQuad bakedquad = new BakedQuad(aint, i, enumfacing, textureatlassprite);
    return bakedquad;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:17,代碼來源:NaturalProperties.java

示例4: putQuadColor

import net.minecraft.client.renderer.block.model.BakedQuad; //導入方法依賴的package包/類
public static void putQuadColor(VertexBuffer renderer, BakedQuad quad, int color)
{
    float cb = color & 0xFF;
    float cg = (color >>> 8) & 0xFF;
    float cr = (color >>> 16) & 0xFF;
    float ca = (color >>> 24) & 0xFF;
    VertexFormat format = quad.getFormat();
    int size = format.getIntegerSize();
    int offset = format.getColorOffset() / 4; // assumes that color is aligned
    for(int i = 0; i < 4; i++)
    {
        int vc = quad.getVertexData()[offset + size * i];
        float vcr = vc & 0xFF;
        float vcg = (vc >>> 8) & 0xFF;
        float vcb = (vc >>> 16) & 0xFF;
        float vca = (vc >>> 24) & 0xFF;
        int ncr = Math.min(0xFF, (int)(cr * vcr / 0xFF));
        int ncg = Math.min(0xFF, (int)(cg * vcg / 0xFF));
        int ncb = Math.min(0xFF, (int)(cb * vcb / 0xFF));
        int nca = Math.min(0xFF, (int)(ca * vca / 0xFF));
        renderer.putColorRGBA(renderer.getColorIndex(4 - i), ncr, ncg, ncb, nca);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:24,代碼來源:ForgeHooksClient.java

示例5: isFullSprite

import net.minecraft.client.renderer.block.model.BakedQuad; //導入方法依賴的package包/類
private boolean isFullSprite(BakedQuad p_isFullSprite_1_)
{
    TextureAtlasSprite textureatlassprite = p_isFullSprite_1_.getSprite();
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMaxU();
    float f2 = f1 - f;
    float f3 = f2 / 256.0F;
    float f4 = textureatlassprite.getMinV();
    float f5 = textureatlassprite.getMaxV();
    float f6 = f5 - f4;
    float f7 = f6 / 256.0F;
    int[] aint = p_isFullSprite_1_.getVertexData();
    int i = aint.length / 4;

    for (int j = 0; j < 4; ++j)
    {
        int k = j * i;
        float f8 = Float.intBitsToFloat(aint[k + 4]);
        float f9 = Float.intBitsToFloat(aint[k + 4 + 1]);

        if (!this.equalsDelta(f8, f, f3) && !this.equalsDelta(f8, f1, f3))
        {
            return false;
        }

        if (!this.equalsDelta(f9, f4, f7) && !this.equalsDelta(f9, f5, f7))
        {
            return false;
        }
    }

    return true;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:34,代碼來源:NaturalProperties.java

示例6: makeQuad

import net.minecraft.client.renderer.block.model.BakedQuad; //導入方法依賴的package包/類
private BakedQuad makeQuad(BakedQuad p_makeQuad_1_, int p_makeQuad_2_, boolean p_makeQuad_3_)
{
    int[] aint = p_makeQuad_1_.getVertexData();
    int i = p_makeQuad_1_.getTintIndex();
    EnumFacing enumfacing = p_makeQuad_1_.getFace();
    TextureAtlasSprite textureatlassprite = p_makeQuad_1_.getSprite();
    aint = this.fixVertexData(aint, p_makeQuad_2_, p_makeQuad_3_);
    BakedQuad bakedquad = new BakedQuad(aint, i, enumfacing, textureatlassprite);
    return bakedquad;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:11,代碼來源:NaturalProperties.java

示例7: getModelDoubleFace

import net.minecraft.client.renderer.block.model.BakedQuad; //導入方法依賴的package包/類
private static IBakedModel getModelDoubleFace(IBakedModel p_getModelDoubleFace_0_)
{
    if (p_getModelDoubleFace_0_ == null)
    {
        return null;
    }
    else if (p_getModelDoubleFace_0_.getGeneralQuads().size() > 0)
    {
        Config.warn("SmartLeaves: Model is not cube, general quads: " + p_getModelDoubleFace_0_.getGeneralQuads().size() + ", model: " + p_getModelDoubleFace_0_);
        return p_getModelDoubleFace_0_;
    }
    else
    {
        EnumFacing[] aenumfacing = EnumFacing.VALUES;

        for (int i = 0; i < aenumfacing.length; ++i)
        {
            EnumFacing enumfacing = aenumfacing[i];
            List<BakedQuad> list = p_getModelDoubleFace_0_.getFaceQuads(enumfacing);

            if (list.size() != 1)
            {
                Config.warn("SmartLeaves: Model is not cube, side: " + enumfacing + ", quads: " + list.size() + ", model: " + p_getModelDoubleFace_0_);
                return p_getModelDoubleFace_0_;
            }
        }

        IBakedModel ibakedmodel = ModelUtils.duplicateModel(p_getModelDoubleFace_0_);
        List[] alist = new List[aenumfacing.length];

        for (int k = 0; k < aenumfacing.length; ++k)
        {
            EnumFacing enumfacing1 = aenumfacing[k];
            List<BakedQuad> list1 = ibakedmodel.getFaceQuads(enumfacing1);
            BakedQuad bakedquad = (BakedQuad)list1.get(0);
            BakedQuad bakedquad1 = new BakedQuad((int[])bakedquad.getVertexData().clone(), bakedquad.getTintIndex(), bakedquad.getFace(), bakedquad.getSprite());
            int[] aint = bakedquad1.getVertexData();
            int[] aint1 = (int[])aint.clone();
            int j = aint.length / 4;
            System.arraycopy(aint, 0 * j, aint1, 3 * j, j);
            System.arraycopy(aint, 1 * j, aint1, 2 * j, j);
            System.arraycopy(aint, 2 * j, aint1, 1 * j, j);
            System.arraycopy(aint, 3 * j, aint1, 0 * j, j);
            System.arraycopy(aint1, 0, aint, 0, aint1.length);
            list1.add(bakedquad1);
        }

        return ibakedmodel;
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:51,代碼來源:SmartLeaves.java

示例8: getModelDoubleFace

import net.minecraft.client.renderer.block.model.BakedQuad; //導入方法依賴的package包/類
private static IBakedModel getModelDoubleFace(IBakedModel p_getModelDoubleFace_0_)
{
    if (p_getModelDoubleFace_0_ == null)
    {
        return null;
    }
    else if (p_getModelDoubleFace_0_.getQuads((IBlockState)null, (EnumFacing)null, 0L).size() > 0)
    {
        Config.warn("SmartLeaves: Model is not cube, general quads: " + p_getModelDoubleFace_0_.getQuads((IBlockState)null, (EnumFacing)null, 0L).size() + ", model: " + p_getModelDoubleFace_0_);
        return p_getModelDoubleFace_0_;
    }
    else
    {
        EnumFacing[] aenumfacing = EnumFacing.VALUES;

        for (int i = 0; i < aenumfacing.length; ++i)
        {
            EnumFacing enumfacing = aenumfacing[i];
            List<BakedQuad> list = p_getModelDoubleFace_0_.getQuads((IBlockState)null, enumfacing, 0L);

            if (list.size() != 1)
            {
                Config.warn("SmartLeaves: Model is not cube, side: " + enumfacing + ", quads: " + list.size() + ", model: " + p_getModelDoubleFace_0_);
                return p_getModelDoubleFace_0_;
            }
        }

        IBakedModel ibakedmodel = ModelUtils.duplicateModel(p_getModelDoubleFace_0_);
        List[] alist = new List[aenumfacing.length];

        for (int k = 0; k < aenumfacing.length; ++k)
        {
            EnumFacing enumfacing1 = aenumfacing[k];
            List<BakedQuad> list1 = ibakedmodel.getQuads((IBlockState)null, enumfacing1, 0L);
            BakedQuad bakedquad = (BakedQuad)list1.get(0);
            BakedQuad bakedquad1 = new BakedQuad((int[])bakedquad.getVertexData().clone(), bakedquad.getTintIndex(), bakedquad.getFace(), bakedquad.getSprite());
            int[] aint = bakedquad1.getVertexData();
            int[] aint1 = (int[])aint.clone();
            int j = aint.length / 4;
            System.arraycopy(aint, 0 * j, aint1, 3 * j, j);
            System.arraycopy(aint, 1 * j, aint1, 2 * j, j);
            System.arraycopy(aint, 2 * j, aint1, 1 * j, j);
            System.arraycopy(aint, 3 * j, aint1, 0 * j, j);
            System.arraycopy(aint1, 0, aint, 0, aint1.length);
            list1.add(bakedquad1);
        }

        return ibakedmodel;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:51,代碼來源:SmartLeaves.java


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