TechReborn/1.11/jei/alloySmelter/AlloySmelterRecipeWrapper.java

45 lines
1.5 KiB
Java
Raw Normal View History

2016-03-13 17:08:30 +01:00
package techreborn.compat.jei.alloySmelter;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import net.minecraft.client.Minecraft;
import techreborn.api.recipe.machines.AlloySmelterRecipe;
import techreborn.client.gui.GuiAlloySmelter;
import techreborn.compat.jei.BaseRecipeWrapper;
2016-10-08 21:46:16 +02:00
import javax.annotation.Nonnull;
2016-10-08 21:46:16 +02:00
public class AlloySmelterRecipeWrapper extends BaseRecipeWrapper<AlloySmelterRecipe> {
2016-03-13 17:08:30 +01:00
private final IDrawableAnimated arrow;
2016-10-08 21:46:16 +02:00
public AlloySmelterRecipeWrapper(
@Nonnull
IJeiHelpers jeiHelpers,
@Nonnull
AlloySmelterRecipe baseRecipe) {
2016-03-13 17:08:30 +01:00
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic arrowStatic = guiHelper.createDrawable(GuiAlloySmelter.texture, 176, 14, 24, 17);
2016-03-25 10:47:34 +01:00
this.arrow = guiHelper.createAnimatedDrawable(arrowStatic, baseRecipe.tickTime(),
2016-10-08 21:46:16 +02:00
IDrawableAnimated.StartDirection.LEFT, false);
2016-03-13 17:08:30 +01:00
}
@Override
2016-10-08 21:46:16 +02:00
public void drawAnimations(
@Nonnull
Minecraft minecraft, int recipeWidth, int recipeHeight) {
2016-03-13 17:08:30 +01:00
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
arrow.draw(minecraft, 33, 19);
int x = recipeWidth / 2;
int y = recipeHeight - recipeHeight / 4;
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
2016-10-08 21:46:16 +02:00
minecraft.fontRendererObj.drawString("Time: " + (baseRecipe.tickTime / 20) + " secs", x, y, 0x444444);
minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", x, y += lineHeight, 0x444444);
2016-03-13 17:08:30 +01:00
}
}