Search in sources :

Example 6 with IDrawable

use of mezz.jei.api.gui.IDrawable in project Binnie by ForestryMC.

the class IncubatorRecipeCategory method setRecipe.

@Override
public void setRecipe(IRecipeLayout recipeLayout, IncubatorRecipeWrapper recipeWrapper, IIngredients ingredients) {
    IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
    IDrawable tankOverlay = GeneticsJeiPlugin.drawables.getTankOverlay();
    IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
    fluidStacks.init(Incubator.TANK_INPUT, true, 1, 1, 16, 58, 50, false, tankOverlay);
    fluidStacks.setBackground(Incubator.TANK_INPUT, tank);
    fluidStacks.init(Incubator.TANK_OUTPUT, false, 95, 1, 16, 58, 50, false, tankOverlay);
    fluidStacks.setBackground(Incubator.TANK_OUTPUT, tank);
    fluidStacks.set(ingredients);
    IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
    itemStacks.init(0, true, 22, 22);
    itemStacks.init(1, false, 72, 22);
    itemStacks.set(ingredients);
    IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
    itemStacks.setBackground(0, slot);
    itemStacks.setBackground(1, slot);
}
Also used : IGuiFluidStackGroup(mezz.jei.api.gui.IGuiFluidStackGroup) IGuiItemStackGroup(mezz.jei.api.gui.IGuiItemStackGroup) IDrawable(mezz.jei.api.gui.IDrawable)

Example 7 with IDrawable

use of mezz.jei.api.gui.IDrawable in project Binnie by ForestryMC.

the class InoculatorRecipeCategory method drawExtras.

@Override
public void drawExtras(Minecraft minecraft) {
    IDrawable arrow = GeneticsJeiPlugin.drawables.getArrow();
    arrow.draw(minecraft, 69, 25);
    arrowAnimated.draw(minecraft, 69, 25);
}
Also used : IDrawable(mezz.jei.api.gui.IDrawable)

Example 8 with IDrawable

use of mezz.jei.api.gui.IDrawable in project Binnie by ForestryMC.

the class InoculatorRecipeCategory method setRecipe.

@Override
public void setRecipe(IRecipeLayout recipeLayout, InoculatorRecipeWrapper recipeWrapper, IIngredients ingredients) {
    if (!splicer) {
        IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
        IDrawable tankOverlay = GeneticsJeiPlugin.drawables.getTankOverlay();
        IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
        fluidStacks.init(Inoculator.TANK_VEKTOR, true, 1, 1, 16, 58, 100, false, tankOverlay);
        fluidStacks.setBackground(Inoculator.TANK_VEKTOR, tank);
        fluidStacks.set(ingredients);
    }
    IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
    itemStacks.init(0, true, 22, 0);
    itemStacks.init(1, true, 42, 21);
    itemStacks.init(2, false, 92, 21);
    IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
    for (int i = 0; i <= 2; i++) {
        itemStacks.setBackground(i, slot);
    }
    recipeWrapper.setCurrentIngredients(itemStacks.getGuiIngredients());
    IFocus<?> focus = recipeLayout.getFocus();
    if (focus != null) {
        Object focusValue = focus.getValue();
        if (focusValue instanceof ItemStack) {
            ItemStack focusStack = (ItemStack) focusValue;
            if (AlleleManager.alleleRegistry.isIndividual(focusStack)) {
                if (focus.getMode() == IFocus.Mode.INPUT) {
                    ItemStack serum = recipeWrapper.getInputSerum();
                    ItemStack output = InoculatorLogic.applySerum(focusStack, serum);
                    itemStacks.set(0, serum);
                    itemStacks.set(1, focusStack);
                    itemStacks.set(2, output);
                    return;
                } else if (focus.getMode() == IFocus.Mode.OUTPUT) {
                    IIndividual individual = AlleleManager.alleleRegistry.getIndividual(focusStack);
                    if (individual != null) {
                        ISpeciesRoot speciesRoot = individual.getGenome().getSpeciesRoot();
                        IAlleleSpecies species = individual.getGenome().getPrimary();
                        ItemStack serum = ItemSerum.create(new Gene(species, speciesRoot.getSpeciesChromosomeType(), speciesRoot));
                        // set fully charged
                        serum.setItemDamage(0);
                        itemStacks.set(0, serum);
                        itemStacks.set(1, recipeWrapper.getWildcardTarget());
                        itemStacks.set(2, focusStack);
                        return;
                    }
                }
            } else if (focusStack.getItem() instanceof ItemSerum) {
                ItemStack input = recipeWrapper.getWildcardTarget();
                ItemStack output = InoculatorLogic.applySerum(input, focusStack);
                itemStacks.set(0, focusStack);
                itemStacks.set(1, input);
                itemStacks.set(2, output);
                return;
            }
        }
    }
    itemStacks.set(ingredients);
}
Also used : ISpeciesRoot(forestry.api.genetics.ISpeciesRoot) IIndividual(forestry.api.genetics.IIndividual) Gene(binnie.core.genetics.Gene) IGuiFluidStackGroup(mezz.jei.api.gui.IGuiFluidStackGroup) IAlleleSpecies(forestry.api.genetics.IAlleleSpecies) ItemSerum(binnie.genetics.item.ItemSerum) IGuiItemStackGroup(mezz.jei.api.gui.IGuiItemStackGroup) ItemStack(net.minecraft.item.ItemStack) IDrawable(mezz.jei.api.gui.IDrawable)

Example 9 with IDrawable

use of mezz.jei.api.gui.IDrawable in project Binnie by ForestryMC.

the class IsolatorRecipeCategory method drawExtras.

@Override
@SideOnly(Side.CLIENT)
public void drawExtras(Minecraft minecraft) {
    IDrawable arrow = GeneticsJeiPlugin.drawables.getArrow();
    arrow.draw(minecraft, 69, 25);
    arrowAnimated.draw(minecraft, 69, 25);
    String randomText = "(Random)";
    int textWidth = minecraft.fontRenderer.getStringWidth(randomText);
    minecraft.fontRenderer.drawString(randomText, 102 - (textWidth / 2), 45, Color.gray.getRGB());
}
Also used : IDrawable(mezz.jei.api.gui.IDrawable) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 10 with IDrawable

use of mezz.jei.api.gui.IDrawable in project Binnie by ForestryMC.

the class BreweryRecipeCategory method setRecipe.

@Override
public void setRecipe(IRecipeLayout recipeLayout, BreweryRecipeWrapper recipeWrapper, IIngredients ingredients) {
    IDrawable tank = ExtraTreesJeiPlugin.drawables.getTank();
    IDrawable tankOverlay = ExtraTreesJeiPlugin.drawables.getTankOverlay();
    IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
    fluidStacks.init(BreweryMachine.TANK_INPUT, true, 1, 1, 16, 58, Fluid.BUCKET_VOLUME, false, tankOverlay);
    fluidStacks.setBackground(BreweryMachine.TANK_INPUT, tank);
    fluidStacks.init(BreweryMachine.TANK_OUTPUT, false, 113, 1, 16, 58, Fluid.BUCKET_VOLUME, false, tankOverlay);
    fluidStacks.setBackground(BreweryMachine.TANK_OUTPUT, tank);
    fluidStacks.set(ingredients);
    IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
    // ingredients (hops)
    itemStacks.init(0, true, 21, 42);
    // grain
    itemStacks.init(1, true, 42, 0);
    itemStacks.init(2, true, 42, 21);
    itemStacks.init(3, true, 42, 42);
    // yeast
    itemStacks.init(4, true, 63, 42);
    List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
    itemStacks.set(0, inputs.get(0));
    itemStacks.set(1, inputs.get(1));
    itemStacks.set(2, inputs.get(1));
    itemStacks.set(3, inputs.get(1));
    itemStacks.set(4, inputs.get(2));
    IDrawable slot = ExtraTreesJeiPlugin.guiHelper.getSlotDrawable();
    for (int i = 0; i <= 4; i++) {
        itemStacks.setBackground(i, slot);
    }
}
Also used : IGuiFluidStackGroup(mezz.jei.api.gui.IGuiFluidStackGroup) IGuiItemStackGroup(mezz.jei.api.gui.IGuiItemStackGroup) List(java.util.List) IDrawable(mezz.jei.api.gui.IDrawable)

Aggregations

IDrawable (mezz.jei.api.gui.IDrawable)21 IGuiItemStackGroup (mezz.jei.api.gui.IGuiItemStackGroup)10 IGuiFluidStackGroup (mezz.jei.api.gui.IGuiFluidStackGroup)9 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)2 Gene (binnie.core.genetics.Gene)1 ItemSerum (binnie.genetics.item.ItemSerum)1 IAlleleSpecies (forestry.api.genetics.IAlleleSpecies)1 IIndividual (forestry.api.genetics.IIndividual)1 ISpeciesRoot (forestry.api.genetics.ISpeciesRoot)1 List (java.util.List)1 IDrawableAnimated (mezz.jei.api.gui.IDrawableAnimated)1 ItemStack (net.minecraft.item.ItemStack)1