use of mods.railcraft.client.render.carts.LocomotiveModelRenderer in project Railcraft by Railcraft.
the class ItemLocomotive method addInformation.
// @Override
// @SideOnly(Side.CLIENT)
// public IIcon getIcon(ItemStack stack, int pass) {
// String rendererTag = getModel(stack);
// LocomotiveModelRenderer renderer = renderType.getRenderer(rendererTag);
// if (renderer == null)
// return RenderTools.getMissingTexture();
// IIcon[] icons = renderer.getItemIcons();
// if (pass >= icons.length || icons[pass] == null)
// return blankIcon;
// return renderer.getItemIcons()[pass];
// }
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, @Nullable World world, List<String> info, ITooltipFlag adv) {
super.addInformation(stack, world, info, adv);
GameProfile owner = getOwner(stack);
if (owner.getName() != null && !RailcraftConstantsAPI.UNKNOWN_PLAYER.equalsIgnoreCase(owner.getName())) {
String format = LocalizationPlugin.translate("gui.railcraft.locomotive.tips.item.owner");
info.add(String.format(format, owner.getName()));
}
String model = getModel(stack);
LocomotiveModelRenderer renderer = renderType.getRenderer(model);
String modelName = renderer.getDisplayName();
String format = LocalizationPlugin.translate("gui.railcraft.locomotive.tips.item.model");
info.add(String.format(format, modelName));
EnumColor primary = getPrimaryColor(stack);
format = LocalizationPlugin.translate("gui.railcraft.locomotive.tips.item.primary");
info.add(String.format(format, primary.getTranslatedName()));
EnumColor secondary = getSecondaryColor(stack);
format = LocalizationPlugin.translate("gui.railcraft.locomotive.tips.item.secondary");
info.add(String.format(format, secondary.getTranslatedName()));
float whistle = getWhistlePitch(stack);
format = LocalizationPlugin.translate("gui.railcraft.locomotive.tips.item.whistle");
info.add(String.format(format, whistle < 0 ? "???" : String.format("%.2f", whistle)));
String emblemIdent = getEmblem(stack);
if (!Strings.isEmpty(emblemIdent) && EmblemToolsClient.packageManager != null) {
Emblem emblem = EmblemToolsClient.packageManager.getEmblem(emblemIdent);
if (emblem != null) {
format = LocalizationPlugin.translate("gui.railcraft.locomotive.tips.item.emblem");
info.add(String.format(format, emblem.displayName));
}
}
}
Aggregations