Example usage for net.minecraftforge.common.brewing IBrewingRecipe isInput

List of usage examples for net.minecraftforge.common.brewing IBrewingRecipe isInput

Introduction

In this page you can find the example usage for net.minecraftforge.common.brewing IBrewingRecipe isInput.

Prototype

boolean isInput(ItemStack input);

Source Link

Document

Returns true is the passed ItemStack is an input for this recipe.

Usage

From source file:therogue.storehouse.tile.machine.TilePotionBrewer.java

License:Open Source License

public TilePotionBrewer() {
    super(ModBlocks.potion_brewer);
    this.setInventory(
            new InventoryManager(this, 18, BOTTLE_SLOTS.toArray(new Integer[0]), new Integer[] { 0, 1, 2 }));
    theCrafter = MachineCraftingHandler.getHandler(TilePotionBrewer.class).newCrafter(this, "", "",
            energyStorage);//w w  w  .j  av  a 2  s .c  o m
    modules.add(theCrafter);
    energyStorage.setRFPerTick(80);
    inventory.setItemValidForSlotChecks((index, stack) -> {
        if (BOTTLE_SLOTS.contains(index)) {
            for (IBrewingRecipe recipe : BrewingRecipeRegistry.getRecipes()) {
                if (recipe.isInput(stack))
                    return true;
            }
            return false;
        }
        if (BREWING_SLOTS.contains(index) || OUTPUT_SLOTS.contains(index))
            return true;
        return false;
    });
    containerFactory = (player) -> new ContainerBase(player.inventory, this)
            .addTESlotBlock(inventory.guiAccess, 28, 19, 3, 4, 6)
            .addTESlotBlock(inventory.guiAccess, 118, 19, 3, 1, 3)
            .addTESlotBlock(inventory.guiAccess, 154, 19, 3, 1, 0);
    guiFactory = (player) -> {
        GuiBase gui = new GuiBase(GuiBase.NORMAL_TEXTURE, containerFactory.apply(player), this).setXSize(198)
                .setYSize(186);
        ElementFactory.makeElements(gui, gui.elements, this, "ENERGYBAR 8 8");
        return gui;
    };
}