Search in sources :

Example 1 with IDrawableStatic

use of mezz.jei.api.gui.drawable.IDrawableStatic in project Electrodynamics by aurilisdev.

the class ModFurnaceRecipeCategory method draw.

/*
	 * @Override public void setIngredients(AbstractCookingRecipe recipe, IIngredients ingredients) { ingredients.setInputLists(VanillaTypes.ITEM, getItemInputs(recipe)); ingredients.setOutputs(VanillaTypes.ITEM, getItemOutputs(recipe)); }
	 * 
	 * @Override public void setRecipe(IRecipeLayout recipeLayout, AbstractCookingRecipe recipe, IIngredients ingredients) {
	 * 
	 * IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
	 * 
	 * GenericItemSlotWrapper wrapper; for (int i = 0; i < inSlots.length; i++) { wrapper = inSlots[i]; guiItemStacks.init(i, true, wrapper.itemXStart(), wrapper.itemYStart()); }
	 * 
	 * int offset = inSlots.length;
	 * 
	 * for (int i = 0; i < outSlots.length; i++) { wrapper = outSlots[i]; guiItemStacks.init(i + offset, false, wrapper.itemXStart(), wrapper.itemYStart()); }
	 * 
	 * guiItemStacks.set(ingredients); }
	 */
@Override
public void draw(AbstractCookingRecipe recipe, PoseStack matrixStack, double mouseX, double mouseY) {
    List<IDrawableStatic> inputSlots = INPUT_SLOTS.getUnchecked(ANIMATION_LENGTH);
    IDrawableStatic image;
    ScreenObjectWrapper wrapper;
    for (int i = 0; i < inputSlots.size(); i++) {
        image = inputSlots.get(i);
        wrapper = inSlots[i];
        image.draw(matrixStack, wrapper.getXPos(), wrapper.getYPos());
    }
    List<IDrawableStatic> outputSlots = OUTPUT_SLOTS.getUnchecked(ANIMATION_LENGTH);
    for (int i = 0; i < outputSlots.size(); i++) {
        image = outputSlots.get(i);
        wrapper = outSlots[i];
        image.draw(matrixStack, wrapper.getXPos(), wrapper.getYPos());
    }
    List<IDrawableStatic> staticArrows = STATIC_ARROWS.getUnchecked(ANIMATION_LENGTH);
    for (int i = 0; i < staticArrows.size(); i++) {
        image = staticArrows.get(i);
        wrapper = this.staticArrows[i];
        image.draw(matrixStack, wrapper.getXPos(), wrapper.getYPos());
    }
    List<IDrawableAnimated> arrows = ANIMATED_ARROWS.getUnchecked(ANIMATION_LENGTH);
    IDrawableAnimated arrow;
    for (int i = 0; i < arrows.size(); i++) {
        arrow = arrows.get(i);
        wrapper = animArrows[i];
        arrow.draw(matrixStack, wrapper.getXPos(), wrapper.getYPos());
    }
    addDescriptions(matrixStack);
}
Also used : IDrawableAnimated(mezz.jei.api.gui.drawable.IDrawableAnimated) IDrawableStatic(mezz.jei.api.gui.drawable.IDrawableStatic) ScreenObjectWrapper(electrodynamics.compatibility.jei.utils.gui.ScreenObjectWrapper)

Example 2 with IDrawableStatic

use of mezz.jei.api.gui.drawable.IDrawableStatic in project Electrodynamics by aurilisdev.

the class ModFurnaceRecipeCategory method setOutputSlots.

public void setOutputSlots(IGuiHelper guiHelper, GenericItemSlotWrapper... outputSlots) {
    outSlots = outputSlots;
    OUTPUT_SLOTS = CacheBuilder.newBuilder().maximumSize(outputSlots.length).build(new CacheLoader<Integer, List<IDrawableStatic>>() {

        @Override
        public List<IDrawableStatic> load(Integer time) {
            List<IDrawableStatic> slots = new ArrayList<>();
            for (ScreenObjectWrapper slot : outputSlots) {
                slots.add(guiHelper.drawableBuilder(new ResourceLocation(MOD_ID, slot.getTexture()), slot.getTextX(), slot.getTextY(), slot.getLength(), slot.getWidth()).build());
            }
            return slots;
        }
    });
}
Also used : ResourceLocation(net.minecraft.resources.ResourceLocation) ArrayList(java.util.ArrayList) CacheLoader(com.google.common.cache.CacheLoader) IDrawableStatic(mezz.jei.api.gui.drawable.IDrawableStatic) ScreenObjectWrapper(electrodynamics.compatibility.jei.utils.gui.ScreenObjectWrapper)

Example 3 with IDrawableStatic

use of mezz.jei.api.gui.drawable.IDrawableStatic in project Electrodynamics by aurilisdev.

the class ElectrodynamicsRecipeCategory method setFluidInputs.

public void setFluidInputs(IGuiHelper guiHelper, GenericFluidGaugeWrapper... gauges) {
    fluidInputs = gauges;
    FLUID_INPUTS = CacheBuilder.newBuilder().maximumSize(fluidInputs.length).build(new CacheLoader<Integer, List<IDrawableStatic>>() {

        @Override
        public List<IDrawableStatic> load(Integer time) {
            List<IDrawableStatic> gauges = new ArrayList<>();
            for (ScreenObjectWrapper gauge : fluidInputs) {
                gauges.add(guiHelper.drawableBuilder(new ResourceLocation(MOD_ID, gauge.getTexture()), gauge.getTextX(), gauge.getTextY(), gauge.getLength(), gauge.getWidth()).build());
            }
            return gauges;
        }
    });
}
Also used : ResourceLocation(net.minecraft.resources.ResourceLocation) ArrayList(java.util.ArrayList) CacheLoader(com.google.common.cache.CacheLoader) IDrawableStatic(mezz.jei.api.gui.drawable.IDrawableStatic) ScreenObjectWrapper(electrodynamics.compatibility.jei.utils.gui.ScreenObjectWrapper)

Example 4 with IDrawableStatic

use of mezz.jei.api.gui.drawable.IDrawableStatic in project Electrodynamics by aurilisdev.

the class ElectrodynamicsRecipeCategory method setFluidOutputs.

public void setFluidOutputs(IGuiHelper guiHelper, GenericFluidGaugeWrapper... gauges) {
    fluidOutputs = gauges;
    FLUID_OUTPUTS = CacheBuilder.newBuilder().maximumSize(fluidOutputs.length).build(new CacheLoader<Integer, List<IDrawableStatic>>() {

        @Override
        public List<IDrawableStatic> load(Integer time) {
            List<IDrawableStatic> gauges = new ArrayList<>();
            for (ScreenObjectWrapper gauge : fluidOutputs) {
                gauges.add(guiHelper.drawableBuilder(new ResourceLocation(MOD_ID, gauge.getTexture()), gauge.getTextX(), gauge.getTextY(), gauge.getLength(), gauge.getWidth()).build());
            }
            return gauges;
        }
    });
}
Also used : ResourceLocation(net.minecraft.resources.ResourceLocation) ArrayList(java.util.ArrayList) CacheLoader(com.google.common.cache.CacheLoader) IDrawableStatic(mezz.jei.api.gui.drawable.IDrawableStatic) ScreenObjectWrapper(electrodynamics.compatibility.jei.utils.gui.ScreenObjectWrapper)

Example 5 with IDrawableStatic

use of mezz.jei.api.gui.drawable.IDrawableStatic in project Electrodynamics by aurilisdev.

the class ElectrodynamicsRecipeCategory method setInputSlots.

public void setInputSlots(IGuiHelper guiHelper, GenericItemSlotWrapper... inputSlots) {
    inSlots = inputSlots;
    INPUT_SLOTS = CacheBuilder.newBuilder().maximumSize(inputSlots.length).build(new CacheLoader<Integer, List<IDrawableStatic>>() {

        @Override
        public List<IDrawableStatic> load(Integer time) {
            List<IDrawableStatic> slots = new ArrayList<>();
            for (ScreenObjectWrapper slot : inputSlots) {
                slots.add(guiHelper.drawableBuilder(new ResourceLocation(MOD_ID, slot.getTexture()), slot.getTextX(), slot.getTextY(), slot.getLength(), slot.getWidth()).build());
            }
            return slots;
        }
    });
}
Also used : ResourceLocation(net.minecraft.resources.ResourceLocation) ArrayList(java.util.ArrayList) CacheLoader(com.google.common.cache.CacheLoader) IDrawableStatic(mezz.jei.api.gui.drawable.IDrawableStatic) ScreenObjectWrapper(electrodynamics.compatibility.jei.utils.gui.ScreenObjectWrapper)

Aggregations

ScreenObjectWrapper (electrodynamics.compatibility.jei.utils.gui.ScreenObjectWrapper)12 IDrawableStatic (mezz.jei.api.gui.drawable.IDrawableStatic)12 CacheLoader (com.google.common.cache.CacheLoader)6 ArrayList (java.util.ArrayList)6 ResourceLocation (net.minecraft.resources.ResourceLocation)6 IDrawableAnimated (mezz.jei.api.gui.drawable.IDrawableAnimated)1