use of mods.railcraft.client.render.models.programmatic.ModelTextured in project Railcraft by Railcraft.
the class CartContentRenderer method render.
public void render(RenderCart renderer, T cart, float light, float partialTicks) {
int blockOffset = cart.getDisplayTileOffset();
IBlockState blockState = cart.getDisplayTile();
if (blockState.getRenderType() != EnumBlockRenderType.INVISIBLE) {
GlStateManager.pushMatrix();
renderer.bindTex(TextureMap.LOCATION_BLOCKS_TEXTURE);
OpenGL.glTranslatef(-0.5F, (float) (blockOffset - 8) / 16.0F, 0.5F);
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(blockState, cart.getBrightness(light));
GlStateManager.popMatrix();
renderer.bindTex(cart);
return;
}
ModelTextured contents = CartModelManager.getContentModel(cart.getClass());
if (contents == CartModelManager.emptyModel)
return;
ResourceLocation texture = contents.getTexture();
if (texture == null)
return;
renderer.bindTex(texture);
OpenGL.glPushAttrib(GL11.GL_ENABLE_BIT);
if (!contents.cullBackFaces())
OpenGL.glDisable(GL11.GL_CULL_FACE);
OpenGL.glPushMatrix();
OpenGL.glTranslatef(-0.5F, blockOffset / 16.0F - 0.5F, -0.5F);
contents.render(cart, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
OpenGL.glEnable(GL11.GL_CULL_FACE);
OpenGL.glPopMatrix();
OpenGL.glPopAttrib();
}
use of mods.railcraft.client.render.models.programmatic.ModelTextured in project Railcraft by Railcraft.
the class CartModelManager method getContentModel.
public static ModelTextured getContentModel(Class eClass) {
ModelTextured render = modelsContents.get(eClass);
if (render == null && eClass != EntityMinecart.class) {
render = getContentModel(eClass.getSuperclass());
modelsContents.put(eClass, render);
}
return render != null ? render : emptyModel;
}
Aggregations