Additional information for Altar JEI handler
Hover over the altar image to view Consumption and Drain rates.
This commit is contained in:
parent
01fcec9a8c
commit
780dcdf7be
|
@ -6,7 +6,9 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -19,13 +21,17 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
|
|||
private final ItemStack output;
|
||||
|
||||
private final String[] infoString;
|
||||
private final int consumptionRate;
|
||||
private final int drainRate;
|
||||
|
||||
public AltarRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output, int tier, int requiredLP)
|
||||
public AltarRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output, int tier, int requiredLP, int consumptionRate, int drainRate)
|
||||
{
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
|
||||
this.infoString = new String[] { TextHelper.localize("jei.BloodMagic.recipe.requiredTier", tier), TextHelper.localize("jei.BloodMagic.recipe.requiredLP", requiredLP) };
|
||||
this.consumptionRate = consumptionRate;
|
||||
this.drainRate = drainRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,6 +46,20 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
|
|||
return Collections.singletonList(output);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
if (mouseX >= 13 && mouseX <= 64 && mouseY >= 27 && mouseY <= 58)
|
||||
{
|
||||
ret.add(TextHelper.localize("jei.BloodMagic.recipe.consumptionRate", consumptionRate));
|
||||
ret.add(TextHelper.localize("jei.BloodMagic.recipe.drainRate", drainRate));
|
||||
return ret;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
|
|
@ -27,8 +27,10 @@ public class AltarRecipeMaker
|
|||
ItemStack output = itemStackAltarRecipeEntry.getValue().getOutput();
|
||||
int requiredTier = itemStackAltarRecipeEntry.getValue().getMinTier().toInt();
|
||||
int requiredLP = itemStackAltarRecipeEntry.getValue().getSyphon();
|
||||
int consumptionRate = itemStackAltarRecipeEntry.getValue().getConsumeRate();
|
||||
int drainRate = itemStackAltarRecipeEntry.getValue().getDrainRate();
|
||||
|
||||
AltarRecipeJEI recipe = new AltarRecipeJEI(input, output, requiredTier, requiredLP);
|
||||
AltarRecipeJEI recipe = new AltarRecipeJEI(input, output, requiredTier, requiredLP, consumptionRate, drainRate);
|
||||
recipes.add(recipe);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -307,6 +307,8 @@ jei.BloodMagic.recipe.alchemyArrayCrafting=Alchemy Array
|
|||
jei.BloodMagic.recipe.soulForge=Hellfire Forge
|
||||
jei.BloodMagic.recipe.requiredLP=LP: %d
|
||||
jei.BloodMagic.recipe.requiredTier=Tier: %d
|
||||
jei.BloodMagic.recipe.consumptionRate=Consumption: %d LP/t
|
||||
jei.BloodMagic.recipe.drainRate=Drain: %d LP/t
|
||||
jei.BloodMagic.recipe.minimumSouls=Minimum: %d Will
|
||||
jei.BloodMagic.recipe.soulsDrained=Drained: %d Will
|
||||
|
||||
|
|
Loading…
Reference in a new issue