use of com.enderio.core.api.client.gui.IAdvancedTooltipProvider in project EnderIO by SleepyTrousers.
the class DarkSteelRecipeManager method addAdvancedTooltipEntries.
public static void addAdvancedTooltipEntries(@Nonnull ItemStack itemstack, EntityPlayer entityplayer, @Nonnull List<String> list, boolean flag) {
if (itemstack.getItem() instanceof IDarkSteelItem) {
List<IDarkSteelUpgrade> applyableUpgrades = new ArrayList<IDarkSteelUpgrade>();
for (IDarkSteelUpgrade upgrade : UpgradeRegistry.getUpgrades()) {
if (upgrade instanceof IAdvancedTooltipProvider && upgrade.hasUpgrade(itemstack, (IDarkSteelItem) itemstack.getItem())) {
((IAdvancedTooltipProvider) upgrade).addDetailedEntries(itemstack, entityplayer, list, flag);
} else if (upgrade.canAddToItem(itemstack, (IDarkSteelItem) itemstack.getItem())) {
applyableUpgrades.add(upgrade);
}
}
if (!applyableUpgrades.isEmpty()) {
list.add(TextFormatting.YELLOW + EnderIO.lang.localize("tooltip.anvilupgrades") + " ");
for (IDarkSteelUpgrade up : applyableUpgrades) {
list.add(Lang.DARK_STEEL_LEVELS1.get(TextFormatting.DARK_AQUA, EnderIO.lang.localizeExact(up.getUnlocalizedName() + ".name")));
list.add(Lang.DARK_STEEL_LEVELS2.get(TextFormatting.DARK_AQUA, TextFormatting.ITALIC, up.getUpgradeItemName(), up.getLevelCost()));
}
}
}
}
Aggregations