Search in sources :

Example 1 with AltarUpgradeRecipe

use of hellfirepvp.astralsorcery.common.crafting.recipe.altar.AltarUpgradeRecipe in project AstralSorcery by HellFirePvP.

the class RenderPageRecipeTemplate method addAltarRecipeTooltip.

protected void addAltarRecipeTooltip(SimpleAltarRecipe altarRecipe, List<ITextProperties> toolTip) {
    if (altarRecipe.getStarlightRequirement() > 0) {
        AltarType highestPossible = null;
        ProgressionTier reached = ResearchHelper.getClientProgress().getTierReached();
        for (AltarType type : AltarType.values()) {
            if ((highestPossible == null || !type.isThisLEThan(highestPossible)) && reached.isThisLaterOrEqual(type.getAssociatedTier().getRequiredProgress())) {
                highestPossible = type;
            }
        }
        if (highestPossible != null) {
            long indexSel = (ClientScheduler.getClientTick() / 30) % (highestPossible.ordinal() + 1);
            AltarType typeSelected = AltarType.values()[((int) indexSel)];
            ITextProperties itemName = typeSelected.getAltarItemRepresentation().getDisplayName();
            ITextProperties starlightRequired = getAltarStarlightAmountDescription(itemName, altarRecipe.getStarlightRequirement(), typeSelected.getStarlightCapacity());
            ITextProperties starlightRequirementDescription = new TranslationTextComponent("astralsorcery.journal.recipe.altar.starlight.desc");
            toolTip.add(starlightRequirementDescription);
            toolTip.add(starlightRequired);
        }
    }
    if (altarRecipe instanceof AltarUpgradeRecipe) {
        toolTip.add(new TranslationTextComponent("astralsorcery.journal.recipe.altar.upgrade"));
    }
}
Also used : AltarType(hellfirepvp.astralsorcery.common.block.tile.altar.AltarType) ITextProperties(net.minecraft.util.text.ITextProperties) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) AltarUpgradeRecipe(hellfirepvp.astralsorcery.common.crafting.recipe.altar.AltarUpgradeRecipe) ProgressionTier(hellfirepvp.astralsorcery.common.data.research.ProgressionTier)

Aggregations

AltarType (hellfirepvp.astralsorcery.common.block.tile.altar.AltarType)1 AltarUpgradeRecipe (hellfirepvp.astralsorcery.common.crafting.recipe.altar.AltarUpgradeRecipe)1 ProgressionTier (hellfirepvp.astralsorcery.common.data.research.ProgressionTier)1 ITextProperties (net.minecraft.util.text.ITextProperties)1 TranslationTextComponent (net.minecraft.util.text.TranslationTextComponent)1