Search in sources :

Example 6 with IFilterLogic

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

the class SpeciesWidget method draw.

@Override
public void draw(int startX, int startY) {
    int x = xPos + startX;
    int y = yPos + startY;
    IFilterLogic logic = gui.getLogic();
    IAlleleSpecies allele = (IAlleleSpecies) logic.getGenomeFilter(facing, index, active);
    if (allele != null) {
        GuiUtil.drawItemStack(manager.gui, ITEMS.getOrDefault(allele, ItemStack.EMPTY), x, y);
    }
    TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
    if (this.gui.selection.isSame(this)) {
        textureManager.bindTexture(SelectionWidget.TEXTURE);
        gui.drawTexturedModalRect(x - 1, y - 1, 212, 0, 18, 18);
    }
}
Also used : TextureManager(net.minecraft.client.renderer.texture.TextureManager) IFilterLogic(forestry.api.genetics.IFilterLogic) IAlleleSpecies(forestry.api.genetics.IAlleleSpecies)

Aggregations

IFilterLogic (forestry.api.genetics.IFilterLogic)6 IAlleleSpecies (forestry.api.genetics.IAlleleSpecies)2 IFilterRuleType (forestry.api.genetics.IFilterRuleType)2 ToolTip (forestry.core.gui.tooltips.ToolTip)2 TextureManager (net.minecraft.client.renderer.texture.TextureManager)2 Nullable (javax.annotation.Nullable)1