当前位置: 首页>>代码示例>>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;未经允许,请勿转载。