use of it.hurts.sskirillss.relics.api.leveling.ILeveledItem in project relics by SSKirillSS.
the class TooltipDescriptionHandler method getLevelingTooltip.
private static List<ITextComponent> getLevelingTooltip(ItemStack stack) {
List<ITextComponent> tooltip = new ArrayList<>();
if (!(stack.getItem() instanceof ILeveledItem))
return tooltip;
ILeveledItem item = (ILeveledItem) stack.getItem();
int level = item.getLevel(stack);
int currExp = item.getExperience(stack);
int prevExp = item.getTotalExperienceForLevel(Math.max(level, level - 1));
int nextExp = item.getTotalExperienceForLevel(item.getLevel(stack) + 1);
tooltip.add((new StringTextComponent(" ◆ ").withStyle(TextFormatting.GREEN)).append((new TranslationTextComponent("tooltip.relics.shift.stats.level")).withStyle(TextFormatting.YELLOW)).append((new StringTextComponent(String.format("%d [%d/%d]", level, (currExp - prevExp), (nextExp - prevExp))).withStyle(TextFormatting.WHITE))));
return tooltip;
}
Aggregations