Search in sources :

Example 1 with EnumTubeMaterial

use of binnie.botany.items.EnumTubeMaterial in project Binnie by ForestryMC.

the class ModuleFarming method doInit.

@Override
public void doInit() {
    ItemStack yellow = new ItemStack(Blocks.YELLOW_FLOWER, 1);
    ItemStack red = new ItemStack(Blocks.RED_FLOWER, 1);
    ItemStack blue = new ItemStack(Blocks.RED_FLOWER, 1, 7);
    for (boolean manual : new boolean[] { true, false }) {
        for (boolean fertilised : new boolean[] { true, false }) {
            for (EnumMoisture moist : EnumMoisture.values()) {
                ItemStack icon;
                if (moist == EnumMoisture.DRY) {
                    icon = yellow;
                } else if (moist == EnumMoisture.NORMAL) {
                    icon = red;
                } else {
                    icon = blue;
                }
                int insulate = 2 - moist.ordinal();
                if (fertilised) {
                    insulate += 3;
                }
                new CircuitGarden(moist, null, manual, fertilised, new ItemStack(insulatedTube, 1, 128 * insulate), icon);
                new CircuitGarden(moist, EnumAcidity.ACID, manual, fertilised, new ItemStack(insulatedTube, 1, 1 + 128 * insulate), icon);
                new CircuitGarden(moist, EnumAcidity.NEUTRAL, manual, fertilised, new ItemStack(insulatedTube, 1, 2 + 128 * insulate), icon);
                new CircuitGarden(moist, EnumAcidity.ALKALINE, manual, fertilised, new ItemStack(insulatedTube, 1, 3 + 128 * insulate), icon);
            }
        }
    }
    for (EnumTubeMaterial mat : EnumTubeMaterial.VALUES) {
        RecipeUtil recipeUtil = new RecipeUtil(Constants.BOTANY_MOD_ID);
        for (EnumTubeInsulate insulate : EnumTubeInsulate.VALUES) {
            ItemStack tubes = new ItemStack(insulatedTube, 2, mat.ordinal() + 128 * insulate.ordinal());
            ItemStack insulateStack = ItemInsulatedTube.getInsulateStack(tubes);
            ItemStack forestryTube = new ItemStack(Mods.Forestry.item("thermionic_tubes"), 1, mat.ordinal());
            String recipeName = "thermionic_tubes_" + insulate.getUid() + '_' + mat.getUid();
            recipeUtil.addShapelessRecipe(recipeName, tubes, forestryTube, forestryTube, insulateStack);
        }
    }
}
Also used : EnumMoisture(binnie.botany.api.gardening.EnumMoisture) CircuitGarden(binnie.botany.farming.CircuitGarden) EnumTubeInsulate(binnie.botany.items.EnumTubeInsulate) EnumTubeMaterial(binnie.botany.items.EnumTubeMaterial) ItemStack(net.minecraft.item.ItemStack) RecipeUtil(binnie.core.util.RecipeUtil)

Aggregations

EnumMoisture (binnie.botany.api.gardening.EnumMoisture)1 CircuitGarden (binnie.botany.farming.CircuitGarden)1 EnumTubeInsulate (binnie.botany.items.EnumTubeInsulate)1 EnumTubeMaterial (binnie.botany.items.EnumTubeMaterial)1 RecipeUtil (binnie.core.util.RecipeUtil)1 ItemStack (net.minecraft.item.ItemStack)1