Search in sources :

Example 6 with ChaosBuff

use of net.silentchaos512.gems.lib.ChaosBuff in project SilentGems by SilentChaos512.

the class ItemChaosRune method clAddInformation.

@Override
public void clAddInformation(ItemStack stack, World world, List list, boolean advanced) {
    ChaosBuff buff = getBuff(stack);
    if (buff != null) {
        LocalizationHelper loc = SilentGems.localizationHelper;
        // Name
        TextFormatting nameColor = buff.getPotion() != null && buff.getPotion().isBadEffect() ? TextFormatting.RED : TextFormatting.GOLD;
        list.add(nameColor + buff.getLocalizedName(1));
        // Description (may not have one)
        String desc = "  " + buff.getDescription();
        if (!desc.isEmpty())
            list.add(TextFormatting.DARK_GRAY + desc);
        list.add("  " + loc.getItemSubText(itemName, "maxLevel", buff.getMaxLevel()));
        list.add("  " + loc.getItemSubText(itemName, "slotsUsed", buff.getSlotsUsed(1)));
        String varCost = buff.hasVariableCost() ? loc.getItemSubText(itemName, "variableCost") : "";
        list.add("  " + loc.getItemSubText(itemName, "chaosCost", buff.getChaosCost(1, null), varCost));
        // Debug
        if (KeyTracker.isAltDown()) {
            list.add(TextFormatting.DARK_GRAY + String.format("Key: %s", buff.getKey()));
            list.add(TextFormatting.DARK_GRAY + String.format("Potion: %s", buff.getPotion()));
            list.add(TextFormatting.DARK_GRAY + String.format("Color: %X", buff.getColor()));
        }
    }
}
Also used : TextFormatting(net.minecraft.util.text.TextFormatting) ChaosBuff(net.silentchaos512.gems.lib.ChaosBuff) LocalizationHelper(net.silentchaos512.lib.util.LocalizationHelper)

Aggregations

ChaosBuff (net.silentchaos512.gems.lib.ChaosBuff)5 ItemStack (net.minecraft.item.ItemStack)2 NBTTagList (net.minecraft.nbt.NBTTagList)2 LocalizationHelper (net.silentchaos512.lib.util.LocalizationHelper)2 ISubtypeInterpreter (mezz.jei.api.ISubtypeRegistry.ISubtypeInterpreter)1 IBlockState (net.minecraft.block.state.IBlockState)1 IItemColor (net.minecraft.client.renderer.color.IItemColor)1 ItemColors (net.minecraft.client.renderer.color.ItemColors)1 Enchantment (net.minecraft.enchantment.Enchantment)1 Item (net.minecraft.item.Item)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 TextFormatting (net.minecraft.util.text.TextFormatting)1 Soul (net.silentchaos512.gems.item.ItemSoulGem.Soul)1 ToolSoul (net.silentchaos512.gems.lib.soul.ToolSoul)1