TechReborn/1.11/jei/scrapbox/ScrapboxRecipeWrapper.java

39 lines
1.2 KiB
Java
Raw Normal View History

package techreborn.compat.jei.scrapbox;
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.ScrapboxRecipe;
import techreborn.client.gui.GuiCompressor;
import techreborn.compat.jei.BaseRecipeWrapper;
2016-10-08 21:46:16 +02:00
import javax.annotation.Nonnull;
public class ScrapboxRecipeWrapper extends BaseRecipeWrapper<ScrapboxRecipe> {
private final IDrawableAnimated progress;
2016-10-08 21:46:16 +02:00
public ScrapboxRecipeWrapper(
@Nonnull
IJeiHelpers jeiHelpers,
@Nonnull
ScrapboxRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiCompressor.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);
}
@Override
2016-10-08 21:46:16 +02:00
public void drawAnimations(
@Nonnull
Minecraft minecraft, int recipeWidth, int recipeHeight) {
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
progress.draw(minecraft, 25, 7);
}
}