TechReborn/ToAddBack/1.9/jei/extractor/ExtractorRecipeWrapper.java
2016-03-13 16:08:30 +00:00

31 lines
1.2 KiB
Java

package techreborn.compat.jei.extractor;
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.ExtractorRecipe;
import techreborn.client.gui.GuiExtractor;
import techreborn.compat.jei.BaseRecipeWrapper;
import javax.annotation.Nonnull;
public class ExtractorRecipeWrapper extends BaseRecipeWrapper<ExtractorRecipe> {
private final IDrawableAnimated progress;
public ExtractorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ExtractorRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiExtractor.texture, 176, 17, 22, 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);
}
}