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


Java DefaultVertexFormats.ITEM属性代码示例

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


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

示例1: ModelHandle

private ModelHandle(ResourceLocation model)
{
    this.model = model;
    this.vertexFormat = DefaultVertexFormats.ITEM;
    this.state = null;
    this.uvLock = false;
    this.key = computeKey();
}
 
开发者ID:BenjaminSutter,项目名称:genera,代码行数:8,代码来源:ModelHandle.java

示例2: rebake

private static BakedModelKnowledgeBook rebake(ModelKnowledgeBook model, String name) {	
    Matrix4f m = new Matrix4f();
       m.m20 = 1f / 128f;
       m.m01 = m.m12 = -m.m20;
       m.m33 = 1;
       Matrix3f rotation = new Matrix3f();
       m.getRotationScale(rotation);
       Matrix3f angleZ = new Matrix3f();
       angleZ.rotZ(-1.5708F);
       rotation.mul(rotation, angleZ);
       m.setRotationScale(rotation);
       m.setScale(0.66666666667F * m.getScale());
       m.setTranslation(new Vector3f(0.1875F, 0.2505F, 0.125F));
    SimpleModelFontRenderer fontRenderer = new SimpleModelFontRenderer(Minecraft.getMinecraft().gameSettings, font, Minecraft.getMinecraft().getTextureManager(), false, m, DefaultVertexFormats.ITEM) {
        @Override
        protected float renderUnicodeChar(char c, boolean italic) {
            return super.renderDefaultChar(126, italic);
        }
    };
    int maxLineWidth = 96;
    TextureAtlasSprite fontSprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(font2.toString());
    List<BakedQuad> textQuads = new ArrayList<BakedQuad>();
    
    fontRenderer.setSprite(fontSprite);
       fontRenderer.setFillBlanks(false);
       
       int yOffset = 2;
       String title = I18n.translateToLocal(name);
       List<String> lines = fontRenderer.listFormattedStringToWidth(title, maxLineWidth);
       for (int line = 0; line < lines.size(); line++) {
       	int offset = ((maxLineWidth - fontRenderer.getStringWidth(lines.get(line))) / 2);
       	fontRenderer.drawString(lines.get(line), offset, yOffset, 0x00000000);
       	yOffset += (fontRenderer.FONT_HEIGHT - 1 + 4);
       }
    
       textQuads.addAll(fontRenderer.build());
       return new BakedModelKnowledgeBook(model, textQuads);
}
 
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:38,代码来源:ModelKnowledgeBook.java

示例3: makeBakedQuad

public BakedQuad makeBakedQuad(Vector3f p_makeBakedQuad_1_, Vector3f p_makeBakedQuad_2_, BlockPartFace p_makeBakedQuad_3_, TextureAtlasSprite p_makeBakedQuad_4_, EnumFacing p_makeBakedQuad_5_, ITransformation p_makeBakedQuad_6_, BlockPartRotation p_makeBakedQuad_7_, boolean p_makeBakedQuad_8_, boolean p_makeBakedQuad_9_)
{
    BlockFaceUV blockfaceuv = p_makeBakedQuad_3_.blockFaceUV;

    if (p_makeBakedQuad_8_)
    {
        if (Reflector.ForgeHooksClient_applyUVLock.exists())
        {
            blockfaceuv = (BlockFaceUV)Reflector.call(Reflector.ForgeHooksClient_applyUVLock, new Object[] {p_makeBakedQuad_3_.blockFaceUV, p_makeBakedQuad_5_, p_makeBakedQuad_6_});
        }
        else
        {
            blockfaceuv = this.applyUVLock(p_makeBakedQuad_3_.blockFaceUV, p_makeBakedQuad_5_, (ModelRotation)p_makeBakedQuad_6_);
        }
    }

    boolean flag = p_makeBakedQuad_9_ && !Reflector.ForgeHooksClient_fillNormal.exists();
    int[] aint = this.makeQuadVertexData(blockfaceuv, p_makeBakedQuad_4_, p_makeBakedQuad_5_, this.getPositionsDiv16(p_makeBakedQuad_1_, p_makeBakedQuad_2_), p_makeBakedQuad_6_, p_makeBakedQuad_7_, flag);
    EnumFacing enumfacing = getFacingFromVertexData(aint);

    if (p_makeBakedQuad_7_ == null)
    {
        this.applyFacing(aint, enumfacing);
    }

    if (Reflector.ForgeHooksClient_fillNormal.exists())
    {
        Reflector.call(Reflector.ForgeHooksClient_fillNormal, new Object[] {aint, enumfacing});
        return new BakedQuad(aint, p_makeBakedQuad_3_.tintIndex, enumfacing, p_makeBakedQuad_4_, p_makeBakedQuad_9_, DefaultVertexFormats.ITEM);
    }
    else
    {
        return new BakedQuad(aint, p_makeBakedQuad_3_.tintIndex, enumfacing, p_makeBakedQuad_4_);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:35,代码来源:FaceBakery.java

示例4: rebake

private static BakedModelSpellPage rebake(ModelSpellPage model, Spell spell) {	
    Matrix4f m = new Matrix4f();
       m.m20 = 1f / 128f;
       m.m01 = m.m12 = -m.m20;
       m.m33 = 1;
       Matrix3f rotation = new Matrix3f();
       m.getRotationScale(rotation);
       Matrix3f angle = new Matrix3f();
       angle.rotZ(1.5708F);
       rotation.mul(rotation, angle);
       m.setRotationScale(rotation);
       m.setScale(0.75F * m.getScale());
       m.setTranslation(new Vector3f(0.8625F, 0.095F, 0.8625F));
    SimpleModelFontRenderer fontRenderer = new SimpleModelFontRenderer(Minecraft.getMinecraft().gameSettings, font, Minecraft.getMinecraft().getTextureManager(), false, m, DefaultVertexFormats.ITEM) {
        @Override
        protected float renderUnicodeChar(char c, boolean italic) {
            return super.renderDefaultChar(126, italic);
        }
    };
    TextureAtlasSprite fontSprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(font2.toString());
    List<BakedQuad> textQuads = new ArrayList<BakedQuad>();
    
    fontRenderer.setSprite(fontSprite);
       fontRenderer.setFillBlanks(false);
       String name = TextFormatting.BOLD + I18n.translateToLocal(spell.getUnlocalizedName() + ".name");
       String text = I18n.translateToLocal(spell.getUnlocalizedName() + ".desc");
       String castingType = "--" + I18n.translateToLocal(spell.getCastingType().getName() + ".name") + "--";
       
       int yOffset = 0;
       fontRenderer.drawString(name, (126 - fontRenderer.getStringWidth(name)) / 2, yOffset, 0x007A0000);
       yOffset += (fontRenderer.FONT_HEIGHT + 1);
       List<String> lines = fontRenderer.listFormattedStringToWidth(text, 126);
       for (int line = 0; line < lines.size(); line++) {
       	int offset = ((126 - fontRenderer.getStringWidth(lines.get(line))) / 2);
       	fontRenderer.drawString(lines.get(line), offset, yOffset, 0x004F0000);
       	yOffset += fontRenderer.FONT_HEIGHT;
       }
       yOffset += 5;
       fontRenderer.drawString(castingType, (126 - fontRenderer.getStringWidth(castingType)) / 2, yOffset, 0x00210000);
    
       textQuads.addAll(fontRenderer.build());
       return new BakedModelSpellPage(model, textQuads);
}
 
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:43,代码来源:ModelSpellPage.java

示例5: populateCross

private static void populateCross(List<List<BakedQuad>> dataMap)
{		
    int[] dataCross0 = new int[]{
        Float.floatToRawIntBits(0), Float.floatToRawIntBits(3), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(cattailTexture.getMinU()), Float.floatToRawIntBits(cattailTexture.getMinV()), 0,
        Float.floatToRawIntBits(1), Float.floatToRawIntBits(3), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(cattailTexture.getMaxU()), Float.floatToRawIntBits(cattailTexture.getMinV()), 0,
        Float.floatToRawIntBits(1), Float.floatToRawIntBits(1), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(cattailTexture.getMaxU()), Float.floatToRawIntBits(cattailTexture.getMaxV()), 0,
        Float.floatToRawIntBits(0), Float.floatToRawIntBits(1), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(cattailTexture.getMinU()), Float.floatToRawIntBits(cattailTexture.getMaxV()), 0
    };
    
    int[] dataCross1 = new int[]{
        Float.floatToRawIntBits(1), Float.floatToRawIntBits(3), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(cattailTexture.getMinU()), Float.floatToRawIntBits(cattailTexture.getMinV()), 0,
        Float.floatToRawIntBits(0), Float.floatToRawIntBits(3), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(cattailTexture.getMaxU()), Float.floatToRawIntBits(cattailTexture.getMinV()), 0,
        Float.floatToRawIntBits(0), Float.floatToRawIntBits(1), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(cattailTexture.getMaxU()), Float.floatToRawIntBits(cattailTexture.getMaxV()), 0,
        Float.floatToRawIntBits(1), Float.floatToRawIntBits(1), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(cattailTexture.getMinU()), Float.floatToRawIntBits(cattailTexture.getMaxV()), 0
    };
    
    int[] dataCross2 = new int[]{
        Float.floatToRawIntBits(0), Float.floatToRawIntBits(3), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(cattailTexture.getMinU()), Float.floatToRawIntBits(cattailTexture.getMinV()), 0,
        Float.floatToRawIntBits(1), Float.floatToRawIntBits(3), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(cattailTexture.getMaxU()), Float.floatToRawIntBits(cattailTexture.getMinV()), 0,
        Float.floatToRawIntBits(1), Float.floatToRawIntBits(1), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(cattailTexture.getMaxU()), Float.floatToRawIntBits(cattailTexture.getMaxV()), 0,
        Float.floatToRawIntBits(0), Float.floatToRawIntBits(1), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(cattailTexture.getMinU()), Float.floatToRawIntBits(cattailTexture.getMaxV()), 0
    };
    
    int[] dataCross3 = new int[]{
        Float.floatToRawIntBits(1), Float.floatToRawIntBits(3), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(cattailTexture.getMinU()), Float.floatToRawIntBits(cattailTexture.getMinV()), 0,
        Float.floatToRawIntBits(0), Float.floatToRawIntBits(3), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(cattailTexture.getMaxU()), Float.floatToRawIntBits(cattailTexture.getMinV()), 0,
        Float.floatToRawIntBits(0), Float.floatToRawIntBits(1), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(cattailTexture.getMaxU()), Float.floatToRawIntBits(cattailTexture.getMaxV()), 0,
        Float.floatToRawIntBits(1), Float.floatToRawIntBits(1), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(cattailTexture.getMinU()), Float.floatToRawIntBits(cattailTexture.getMaxV()), 0
    };
    
    ForgeHooksClient.fillNormal(dataCross0, null);
    ForgeHooksClient.fillNormal(dataCross1, null);
    ForgeHooksClient.fillNormal(dataCross2, null);
    ForgeHooksClient.fillNormal(dataCross3, null);
    BakedQuad faceCross0 = new BakedQuad(dataCross0, -1, EnumFacing.UP, cattailTexture, true, DefaultVertexFormats.ITEM);
    BakedQuad faceCross1 = new BakedQuad(dataCross1, -1, EnumFacing.UP, cattailTexture, true, DefaultVertexFormats.ITEM);
    BakedQuad faceCross2 = new BakedQuad(dataCross2, -1, EnumFacing.UP, cattailTexture, true, DefaultVertexFormats.ITEM);
    BakedQuad faceCross3 = new BakedQuad(dataCross3, -1, EnumFacing.UP, cattailTexture, true, DefaultVertexFormats.ITEM);
    List<BakedQuad> quads = Lists.newArrayList();
    quads.add(faceCross0);
    quads.add(faceCross1);
    quads.add(faceCross2);
    quads.add(faceCross3);
    dataMap.get(0).addAll(quads);
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:45,代码来源:ModelCattailBaked.java

示例6: populateCube

private static void populateCube(int i, List<List<BakedQuad>> dataMap)
{
    TextureAtlasSprite textureGround = soilTextures[i];
    int[] dataUp = new int[]{
            Float.floatToRawIntBits(1), Float.floatToRawIntBits(1), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(textureGround.getMinU()), Float.floatToRawIntBits(textureGround.getMinV()),	norm_top,
            Float.floatToRawIntBits(0), Float.floatToRawIntBits(1), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(textureGround.getMaxU()), Float.floatToRawIntBits(textureGround.getMinV()),	norm_top,
            Float.floatToRawIntBits(0), Float.floatToRawIntBits(1), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(textureGround.getMaxU()), Float.floatToRawIntBits(textureGround.getMaxV()),	norm_top,
            Float.floatToRawIntBits(1), Float.floatToRawIntBits(1), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(textureGround.getMinU()), Float.floatToRawIntBits(textureGround.getMaxV()),	norm_top
    };
    
    int[] dataDown = new int[]{
            Float.floatToRawIntBits(0), Float.floatToRawIntBits(0), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(textureGround.getMinU()), Float.floatToRawIntBits(textureGround.getMinV()),	norm_down,
            Float.floatToRawIntBits(1), Float.floatToRawIntBits(0), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(textureGround.getMaxU()), Float.floatToRawIntBits(textureGround.getMinV()),	norm_down,
            Float.floatToRawIntBits(1), Float.floatToRawIntBits(0), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(textureGround.getMaxU()), Float.floatToRawIntBits(textureGround.getMaxV()),	norm_down,
            Float.floatToRawIntBits(0), Float.floatToRawIntBits(0), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(textureGround.getMinU()), Float.floatToRawIntBits(textureGround.getMaxV()),	norm_down
    };
    
    int[] dataNorth = new int[]{
            Float.floatToRawIntBits(0), Float.floatToRawIntBits(1), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(textureGround.getMinU()), Float.floatToRawIntBits(textureGround.getMinV()),	norm_north,
            Float.floatToRawIntBits(1), Float.floatToRawIntBits(1), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(textureGround.getMaxU()), Float.floatToRawIntBits(textureGround.getMinV()),	norm_north,
            Float.floatToRawIntBits(1), Float.floatToRawIntBits(0), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(textureGround.getMaxU()), Float.floatToRawIntBits(textureGround.getMaxV()),	norm_north,
            Float.floatToRawIntBits(0), Float.floatToRawIntBits(0), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(textureGround.getMinU()), Float.floatToRawIntBits(textureGround.getMaxV()),	norm_north
    };
    
    int[] dataSouth = new int[]{
            Float.floatToRawIntBits(1), Float.floatToRawIntBits(1), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(textureGround.getMinU()), Float.floatToRawIntBits(textureGround.getMinV()),	norm_south,
            Float.floatToRawIntBits(0), Float.floatToRawIntBits(1), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(textureGround.getMaxU()), Float.floatToRawIntBits(textureGround.getMinV()),	norm_south,
            Float.floatToRawIntBits(0), Float.floatToRawIntBits(0), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(textureGround.getMaxU()), Float.floatToRawIntBits(textureGround.getMaxV()),	norm_south,
            Float.floatToRawIntBits(1), Float.floatToRawIntBits(0), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(textureGround.getMinU()), Float.floatToRawIntBits(textureGround.getMaxV()),	norm_south
    };
    
    int[] dataWest = new int[]{
            Float.floatToRawIntBits(0), Float.floatToRawIntBits(1), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(textureGround.getMinU()), Float.floatToRawIntBits(textureGround.getMinV()),	norm_west,
            Float.floatToRawIntBits(0), Float.floatToRawIntBits(1), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(textureGround.getMaxU()), Float.floatToRawIntBits(textureGround.getMinV()),	norm_west,
            Float.floatToRawIntBits(0), Float.floatToRawIntBits(0), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(textureGround.getMaxU()), Float.floatToRawIntBits(textureGround.getMaxV()),	norm_west,
            Float.floatToRawIntBits(0), Float.floatToRawIntBits(0), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(textureGround.getMinU()), Float.floatToRawIntBits(textureGround.getMaxV()),	norm_west
    };
    
    int[] dataEast = new int[]{
            Float.floatToRawIntBits(1), Float.floatToRawIntBits(1), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(textureGround.getMinU()), Float.floatToRawIntBits(textureGround.getMinV()),	norm_east,
            Float.floatToRawIntBits(1), Float.floatToRawIntBits(1), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(textureGround.getMaxU()), Float.floatToRawIntBits(textureGround.getMinV()),	norm_east,
            Float.floatToRawIntBits(1), Float.floatToRawIntBits(0), Float.floatToRawIntBits(1),	-1,	Float.floatToRawIntBits(textureGround.getMaxU()), Float.floatToRawIntBits(textureGround.getMaxV()),	norm_east,
            Float.floatToRawIntBits(1), Float.floatToRawIntBits(0), Float.floatToRawIntBits(0),	-1,	Float.floatToRawIntBits(textureGround.getMinU()), Float.floatToRawIntBits(textureGround.getMaxV()),	norm_east
    };
    
    BakedQuad faceUp = new BakedQuad(dataUp, -1, EnumFacing.UP, textureGround, true, DefaultVertexFormats.ITEM);
    BakedQuad faceDown = new BakedQuad(dataDown, -1, EnumFacing.DOWN, textureGround, true, DefaultVertexFormats.ITEM);
    BakedQuad faceNorth = new BakedQuad(dataNorth, -1, EnumFacing.NORTH, textureGround, true, DefaultVertexFormats.ITEM);
    BakedQuad faceSouth = new BakedQuad(dataSouth, -1, EnumFacing.SOUTH, textureGround, true, DefaultVertexFormats.ITEM);
    BakedQuad faceWest = new BakedQuad(dataWest, -1, EnumFacing.WEST, textureGround, true, DefaultVertexFormats.ITEM);
    BakedQuad faceEast = new BakedQuad(dataEast, -1, EnumFacing.EAST, textureGround, true, DefaultVertexFormats.ITEM);
    List<BakedQuad> lstUp = Lists.newArrayList();
    List<BakedQuad> lstDown = Lists.newArrayList();
    List<BakedQuad> lstNorth = Lists.newArrayList();
    List<BakedQuad> lstSouth = Lists.newArrayList();
    List<BakedQuad> lstWest = Lists.newArrayList();
    List<BakedQuad> lstEast = Lists.newArrayList();
    lstUp.add(faceUp);
    lstDown.add(faceDown);
    lstNorth.add(faceNorth);
    lstSouth.add(faceSouth);
    lstWest.add(faceWest);
    lstEast.add(faceEast);
    dataMap.get(EnumFacing.UP.ordinal() + 1).addAll(lstUp);
    dataMap.get(EnumFacing.DOWN.ordinal() + 1).addAll(lstDown);
    dataMap.get(EnumFacing.NORTH.ordinal() + 1).addAll(lstNorth);
    dataMap.get(EnumFacing.SOUTH.ordinal() + 1).addAll(lstSouth);
    dataMap.get(EnumFacing.WEST.ordinal() + 1).addAll(lstWest);
    dataMap.get(EnumFacing.EAST.ordinal() + 1).addAll(lstEast);
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:70,代码来源:ModelCattailBaked.java


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