TechReborn/1.11/jei/vacuumFreezer/VacuumFreezerRecipeWrapper.java

39 lines
1.2 KiB
Java
Raw Normal View History

2016-03-13 17:08:30 +01:00
package techreborn.compat.jei.vacuumFreezer;
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.VacuumFreezerRecipe;
import techreborn.client.gui.GuiVacuumFreezer;
import techreborn.compat.jei.BaseRecipeWrapper;
2016-10-08 21:46:16 +02:00
import javax.annotation.Nonnull;
public class VacuumFreezerRecipeWrapper extends BaseRecipeWrapper<VacuumFreezerRecipe> {
2016-03-13 17:08:30 +01:00
private final IDrawableAnimated progress;
2016-10-08 21:46:16 +02:00
public VacuumFreezerRecipeWrapper(
@Nonnull
IJeiHelpers jeiHelpers,
@Nonnull
VacuumFreezerRecipe baseRecipe) {
2016-03-13 17:08:30 +01:00
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiVacuumFreezer.texture, 176, 14, 20, 11);
int ticksPerCycle = baseRecipe.tickTime();
2016-03-25 10:47:34 +01:00
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
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);
progress.draw(minecraft, 25, 7);
}
}