當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。