public void addQuad( EnumFacing face, float x1, float y1, float z1, float x2, float y2, float z2 ) { // If brightness is forced to specific values, extend the vertex format to contain the multi-texturing lightmap // offset VertexFormat savedFormat = null; if( this.renderFullBright ) { savedFormat = this.format; this.format = new VertexFormat( savedFormat ); if( !this.format.getElements().contains( DefaultVertexFormats.TEX_2S ) ) { this.format.addElement( DefaultVertexFormats.TEX_2S ); } } this.putFace( face, x1, y1, z1, x2, y2, z2 ); // Restore old format if( savedFormat != null ) { this.format = savedFormat; } }
public static VertexFormat getFormatWithLightMap( VertexFormat format ) { // Do not use this when Optifine is present or if the vanilla lighting pipeline is used if( FMLClientHandler.instance().hasOptifine() || !ForgeModContainer.forgeLightPipelineEnabled ) { return format; } VertexFormat result; if( format == DefaultVertexFormats.BLOCK ) { result = DefaultVertexFormats.BLOCK; } else if( format == DefaultVertexFormats.ITEM ) { result = itemFormatWithLightMap; } else if( !format.hasUvOffset( 1 ) ) { result = new VertexFormat( format ); result.addElement( DefaultVertexFormats.TEX_2S ); } else { result = format; // Already has the needed UV, so keep it } return result; } }
public static VertexFormat getFormatWithLightMap(VertexFormat format) { if (isLightMapDisabled()) { return format; } if (format == DefaultVertexFormats.BLOCK) { return DefaultVertexFormats.BLOCK; } else if (format == DefaultVertexFormats.ITEM) { return ITEM_FORMAT_WITH_LIGHTMAP; } else if (!format.hasUvOffset(1)) { VertexFormat result = new VertexFormat(format); result.addElement(DefaultVertexFormats.TEX_2S); return result; } return format; }