use of mods.railcraft.api.carts.locomotive.LocomotiveRenderType in project Railcraft by Railcraft.
the class LocomotiveRenderer method render.
@Override
public boolean render(ICartRenderer renderer, EntityMinecart cart, float light, float time) {
EntityLocomotive loco = (EntityLocomotive) cart;
EnumColor pColor = SeasonPlugin.isGhostTrain(cart) ? EnumColor.SILVER : EnumColor.fromDye(loco.getPrimaryColor());
EnumColor sColor = SeasonPlugin.isGhostTrain(cart) ? EnumColor.SILVER : EnumColor.fromDye(loco.getSecondaryColor());
int primaryColor = pColor.getHexColor();
int secondaryColor = sColor.getHexColor();
String emblem = loco.getEmblem();
ResourceLocation emblemTexture = null;
if (!StringUtils.isNullOrEmpty(emblem) && EmblemToolsClient.packageManager != null)
emblemTexture = EmblemToolsClient.packageManager.getEmblemTextureLocation(emblem);
LocomotiveRenderType renderType = loco.getRenderType();
mods.railcraft.api.carts.locomotive.LocomotiveModelRenderer locoRenderer = renderType.getRenderer(loco.getModel());
locoRenderer.renderLocomotive(renderer, loco, primaryColor, secondaryColor, emblemTexture, light, time);
return false;
}
Aggregations