TechReborn/ToAddBack/1.9/jei/scrapbox/ScrapboxRecipeWrapper.java

32 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;
import javax.annotation.Nonnull;
public class ScrapboxRecipeWrapper extends BaseRecipeWrapper<ScrapboxRecipe> {
private final IDrawableAnimated progress;
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();
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
progress.draw(minecraft, 25, 7);
}
}