Search in sources :

Example 1 with IAlyzerPlugin

use of forestry.api.genetics.IAlyzerPlugin in project ForestryMC by ForestryMC.

the class GuiElementFactory method createMutationResultant.

public IGuiElementLayout createMutationResultant(int x, int y, int width, int height, IMutation mutation, IBreedingTracker breedingTracker) {
    if (breedingTracker.isDiscovered(mutation)) {
        IGuiElementLayout element = new GuiElementPanel(x, y, width, height);
        IAlyzerPlugin plugin = mutation.getRoot().getAlyzerPlugin();
        Map<String, ItemStack> iconStacks = plugin.getIconStacks();
        ItemStack firstPartner = iconStacks.get(mutation.getAllele0().getUID());
        ItemStack secondPartner = iconStacks.get(mutation.getAllele1().getUID());
        element.addElements(new GuiElementItemStack(0, 0, firstPartner), createProbabilityAdd(mutation, 21, 4), new GuiElementItemStack(33, 0, secondPartner));
        return element;
    }
    // Do not display secret undiscovered mutations.
    if (mutation.isSecret()) {
        return null;
    }
    return createUnknownMutationGroup(x, y, width, height, mutation);
}
Also used : IAlyzerPlugin(forestry.api.genetics.IAlyzerPlugin) ItemStack(net.minecraft.item.ItemStack) IGuiElementLayout(forestry.api.core.IGuiElementLayout)

Aggregations

IGuiElementLayout (forestry.api.core.IGuiElementLayout)1 IAlyzerPlugin (forestry.api.genetics.IAlyzerPlugin)1 ItemStack (net.minecraft.item.ItemStack)1