2016-03-07 15:07:52 +01:00
|
|
|
package techreborn.compat.jei.recycler;
|
|
|
|
|
|
|
|
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.RecyclerRecipe;
|
|
|
|
import techreborn.client.gui.GuiRecycler;
|
|
|
|
import techreborn.compat.jei.BaseRecipeWrapper;
|
|
|
|
|
2016-03-13 16:37:55 +01:00
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
|
2016-03-07 15:07:52 +01:00
|
|
|
public class RecyclerRecipeWrapper extends BaseRecipeWrapper<RecyclerRecipe> {
|
|
|
|
private final IDrawableAnimated progress;
|
|
|
|
|
|
|
|
public RecyclerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull RecyclerRecipe baseRecipe) {
|
|
|
|
super(baseRecipe);
|
|
|
|
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
|
|
|
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiRecycler.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);
|
|
|
|
}
|
|
|
|
}
|