Search in sources :

Example 1 with ICurioItem

use of top.theillusivec4.curios.api.type.capability.ICurioItem in project relics by SSKirillSS.

the class TooltipDescriptionHandler method getSlotTooltip.

private static List<ITextComponent> getSlotTooltip(ItemStack stack) {
    List<String> tags = new ArrayList<>(CuriosApi.getCuriosHelper().getCurioTags(stack.getItem()));
    List<ITextComponent> tooltip = new ArrayList<>();
    if (!(stack.getItem() instanceof ICurioItem) || tags.isEmpty())
        return tooltip;
    StringTextComponent component = new StringTextComponent("");
    component.append((new StringTextComponent("   ◆ ").withStyle(TextFormatting.GREEN)).append((new TranslationTextComponent("tooltip.relics.shift.stats.slot")).withStyle(TextFormatting.YELLOW)).append(" "));
    for (int i = 0; i < tags.size(); i++) {
        String tag = tags.get(i);
        component.append((new TranslationTextComponent("curios.identifier." + tag).withStyle(TextFormatting.WHITE)).append((new StringTextComponent(i + 1 < tags.size() ? ", " : "").withStyle(TextFormatting.GRAY))));
    }
    tooltip.add(component);
    return tooltip;
}
Also used : ICurioItem(top.theillusivec4.curios.api.type.capability.ICurioItem) ArrayList(java.util.ArrayList) ITextComponent(net.minecraft.util.text.ITextComponent) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) StringTextComponent(net.minecraft.util.text.StringTextComponent)

Aggregations

ArrayList (java.util.ArrayList)1 ITextComponent (net.minecraft.util.text.ITextComponent)1 StringTextComponent (net.minecraft.util.text.StringTextComponent)1 TranslationTextComponent (net.minecraft.util.text.TranslationTextComponent)1 ICurioItem (top.theillusivec4.curios.api.type.capability.ICurioItem)1