Search in sources :

Example 6 with CustomWoodType

use of com.infinityraider.agricraft.utility.CustomWoodType in project AgriCraft by AgriCraft.

the class CustomWoodShapedRecipe method inferMaterial.

public Optional<CustomWoodType> inferMaterial(InventoryCrafting ic) {
    for (int r = 0; r < ic.getWidth(); r++) {
        for (int c = 0; c < ic.getHeight(); c++) {
            final ItemStack stack = ic.getStackInRowAndColumn(r, c);
            final Optional<CustomWoodType> material = CustomWoodTypeRegistry.getFromStack(stack);
            if (material.isPresent()) {
                return material;
            }
        }
    }
    return Optional.empty();
}
Also used : ItemStack(net.minecraft.item.ItemStack) CustomWoodType(com.infinityraider.agricraft.utility.CustomWoodType)

Aggregations

CustomWoodType (com.infinityraider.agricraft.utility.CustomWoodType)6 ItemStack (net.minecraft.item.ItemStack)4 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 IExtendedBlockState (net.minecraftforge.common.property.IExtendedBlockState)2 FuzzyStack (com.infinityraider.agricraft.api.v1.util.FuzzyStack)1