Search in sources :

Example 1 with CircuitLayout

use of forestry.core.circuits.CircuitLayout in project ForestryMC by ForestryMC.

the class PluginIC2 method preInit.

@Override
@Optional.Method(modid = PluginIC2.MOD_ID)
public void preInit() {
    // rubber chain
    rubberWood = IC2Items.getItem("rubber_wood");
    resin = IC2Items.getItem("misc_resource", "resin");
    rubberSapling = IC2Items.getItem("sapling");
    rubber = IC2Items.getItem("crafting", "rubber");
    fertilizer = IC2Items.getItem("crop_res", "fertilizer");
    IFarmProperties rubberFarm = FarmRegistry.getInstance().registerLogic("farmRubber", FarmLogicRubber::new);
    Circuits.farmRubberManual = new CircuitFarmLogic("manualRubber", rubberFarm, true);
    ICircuitLayout layoutEngineTin = new CircuitLayout("engine.tin", CircuitSocketType.ELECTRIC_ENGINE);
    ChipsetManager.circuitRegistry.registerLayout(layoutEngineTin);
    if (fertilizer != null) {
        FarmRegistry.getInstance().registerFertilizer(fertilizer, 250);
    }
}
Also used : FarmLogicRubber(forestry.farming.logic.FarmLogicRubber) ICircuitLayout(forestry.api.circuits.ICircuitLayout) IFarmProperties(forestry.api.farming.IFarmProperties) ICircuitLayout(forestry.api.circuits.ICircuitLayout) CircuitLayout(forestry.core.circuits.CircuitLayout) CircuitFarmLogic(forestry.farming.circuits.CircuitFarmLogic)

Example 2 with CircuitLayout

use of forestry.core.circuits.CircuitLayout in project ForestryMC by ForestryMC.

the class ModuleGreenhouse method preInit.

@Override
public void preInit() {
    proxy.preInti();
    MinecraftForge.EVENT_BUS.register(new ChunkEvents());
    CamouflageManager.camouflageAccess.registerItemHandler(new CamouflageHandlerBlock());
    proxy.initializeModels();
    ICircuitLayout layoutManaged = new CircuitLayout("greenhouse.climatiser", CircuitSocketType.GREENHOUSE_CLIMATISER);
    ChipsetManager.circuitRegistry.registerLayout(layoutManaged);
}
Also used : ICircuitLayout(forestry.api.circuits.ICircuitLayout) ChunkEvents(forestry.greenhouse.multiblock.blocks.ChunkEvents) ICircuitLayout(forestry.api.circuits.ICircuitLayout) CircuitLayout(forestry.core.circuits.CircuitLayout) CamouflageHandlerBlock(forestry.greenhouse.camouflage.CamouflageHandlerBlock)

Example 3 with CircuitLayout

use of forestry.core.circuits.CircuitLayout in project ForestryMC by ForestryMC.

the class ModuleFarming method preInit.

@Override
public void preInit() {
    ItemRegistryCore coreItems = ModuleCore.getItems();
    BlockRegistryFarming blocks = getBlocks();
    MinecraftForge.EVENT_BUS.register(this);
    IFarmRegistry registry = ForestryAPI.farmRegistry;
    registry.registerFarmables("farmArboreal", new FarmableVanillaSapling());
    if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.ARBORICULTURE))) {
        registry.registerFarmables("farmArboreal", new FarmableGE());
    }
    registry.registerFarmables("farmCrops", new FarmableAgingCrop(new ItemStack(Items.WHEAT_SEEDS), Blocks.WHEAT, BlockCrops.AGE, 7, 0), new FarmableAgingCrop(new ItemStack(Items.POTATO), Blocks.POTATOES, BlockCrops.AGE, 7, 0), new FarmableAgingCrop(new ItemStack(Items.CARROT), Blocks.CARROTS, BlockCrops.AGE, 7, 0), new FarmableAgingCrop(new ItemStack(Items.BEETROOT_SEEDS), Blocks.BEETROOTS, BlockBeetroot.BEETROOT_AGE, 3, 0));
    IBlockState plantedBrownMushroom = blocks.mushroom.getDefaultState().withProperty(BlockMushroom.VARIANT, BlockMushroom.MushroomType.BROWN);
    registry.registerFarmables("farmShroom", new FarmableVanillaMushroom(new ItemStack(Blocks.BROWN_MUSHROOM), plantedBrownMushroom, Blocks.BROWN_MUSHROOM_BLOCK));
    IBlockState plantedRedMushroom = blocks.mushroom.getDefaultState().withProperty(BlockMushroom.VARIANT, BlockMushroom.MushroomType.RED);
    registry.registerFarmables("farmShroom", new FarmableVanillaMushroom(new ItemStack(Blocks.RED_MUSHROOM), plantedRedMushroom, Blocks.RED_MUSHROOM_BLOCK));
    registry.registerFarmables("farmGourd", new FarmableGourd(new ItemStack(Items.PUMPKIN_SEEDS), Blocks.PUMPKIN_STEM, Blocks.PUMPKIN));
    registry.registerFarmables("farmGourd", new FarmableGourd(new ItemStack(Items.MELON_SEEDS), Blocks.MELON_STEM, Blocks.MELON_BLOCK));
    registry.registerFarmables("farmInfernal", new FarmableAgingCrop(new ItemStack(Items.NETHER_WART), Blocks.NETHER_WART, BlockNetherWart.AGE, 3));
    registry.registerFarmables("farmPoales", new FarmableStacked(new ItemStack(Items.REEDS), Blocks.REEDS, 3));
    registry.registerFarmables("farmSucculentes", new FarmableStacked(new ItemStack(Blocks.CACTUS), Blocks.CACTUS, 3));
    registry.registerFarmables("farmEnder", FarmableChorus.INSTANCE);
    // Forestry fertilizer
    registry.registerFertilizer(new ItemStack(coreItems.fertilizerCompound, 1, OreDictionary.WILDCARD_VALUE), 500);
    proxy.initializeModels();
    // Layouts
    ICircuitLayout layoutManaged = new CircuitLayout("farms.managed", CircuitSocketType.FARM);
    ChipsetManager.circuitRegistry.registerLayout(layoutManaged);
    ICircuitLayout layoutManual = new CircuitLayout("farms.manual", CircuitSocketType.FARM);
    ChipsetManager.circuitRegistry.registerLayout(layoutManual);
}
Also used : BlockRegistryFarming(forestry.farming.blocks.BlockRegistryFarming) FarmableGE(forestry.farming.logic.farmables.FarmableGE) IBlockState(net.minecraft.block.state.IBlockState) FarmableVanillaSapling(forestry.farming.logic.farmables.FarmableVanillaSapling) ICircuitLayout(forestry.api.circuits.ICircuitLayout) CircuitLayout(forestry.core.circuits.CircuitLayout) FarmableStacked(forestry.farming.logic.farmables.FarmableStacked) FarmableVanillaMushroom(forestry.farming.logic.farmables.FarmableVanillaMushroom) ICircuitLayout(forestry.api.circuits.ICircuitLayout) ItemRegistryCore(forestry.core.items.ItemRegistryCore) ResourceLocation(net.minecraft.util.ResourceLocation) FarmableGourd(forestry.farming.logic.farmables.FarmableGourd) IFarmRegistry(forestry.api.farming.IFarmRegistry) FarmableAgingCrop(forestry.farming.logic.farmables.FarmableAgingCrop) ItemStack(net.minecraft.item.ItemStack)

Example 4 with CircuitLayout

use of forestry.core.circuits.CircuitLayout in project ForestryMC by ForestryMC.

the class ModuleFactory method preInit.

@Override
public void preInit() {
    ItemRegistryCore coreItems = ModuleCore.getItems();
    // Set fuels and resources for the fermenter
    ItemStack fertilizerCompound = coreItems.fertilizerCompound.getItemStack();
    FuelManager.fermenterFuel.put(fertilizerCompound, new FermenterFuel(fertilizerCompound, ForestryAPI.activeMode.getIntegerSetting("fermenter.value.fertilizer"), ForestryAPI.activeMode.getIntegerSetting("fermenter.cycles.fertilizer")));
    int cyclesCompost = ForestryAPI.activeMode.getIntegerSetting("fermenter.cycles.compost");
    int valueCompost = ForestryAPI.activeMode.getIntegerSetting("fermenter.value.compost");
    ItemStack fertilizerBio = coreItems.compost.getItemStack();
    ItemStack mulch = coreItems.mulch.getItemStack();
    FuelManager.fermenterFuel.put(fertilizerBio, new FermenterFuel(fertilizerBio, valueCompost, cyclesCompost));
    FuelManager.fermenterFuel.put(mulch, new FermenterFuel(mulch, valueCompost, cyclesCompost));
    // Add moistener resources
    ItemStack wheat = new ItemStack(Items.WHEAT);
    ItemStack mouldyWheat = coreItems.mouldyWheat.getItemStack();
    ItemStack decayingWheat = coreItems.decayingWheat.getItemStack();
    FuelManager.moistenerResource.put(wheat, new MoistenerFuel(wheat, mouldyWheat, 0, 300));
    FuelManager.moistenerResource.put(mouldyWheat, new MoistenerFuel(mouldyWheat, decayingWheat, 1, 600));
    FuelManager.moistenerResource.put(decayingWheat, new MoistenerFuel(decayingWheat, mulch, 2, 900));
    // Set fuels for our own engines
    ItemStack peat = coreItems.peat.getItemStack();
    FuelManager.copperEngineFuel.put(peat, new EngineCopperFuel(peat, Constants.ENGINE_COPPER_FUEL_VALUE_PEAT, Constants.ENGINE_COPPER_CYCLE_DURATION_PEAT));
    ItemStack bituminousPeat = coreItems.bituminousPeat.getItemStack();
    FuelManager.copperEngineFuel.put(bituminousPeat, new EngineCopperFuel(bituminousPeat, Constants.ENGINE_COPPER_FUEL_VALUE_BITUMINOUS_PEAT, Constants.ENGINE_COPPER_CYCLE_DURATION_BITUMINOUS_PEAT));
    Fluid biomass = Fluids.BIOMASS.getFluid();
    if (biomass != null) {
        FuelManager.bronzeEngineFuel.put(biomass, new EngineBronzeFuel(biomass, Constants.ENGINE_FUEL_VALUE_BIOMASS, (int) (Constants.ENGINE_CYCLE_DURATION_BIOMASS * ForestryAPI.activeMode.getFloatSetting("fuel.biomass.biogas")), 1));
    }
    FuelManager.bronzeEngineFuel.put(FluidRegistry.WATER, new EngineBronzeFuel(FluidRegistry.WATER, Constants.ENGINE_FUEL_VALUE_WATER, Constants.ENGINE_CYCLE_DURATION_WATER, 3));
    Fluid milk = Fluids.MILK.getFluid();
    if (milk != null) {
        FuelManager.bronzeEngineFuel.put(milk, new EngineBronzeFuel(milk, Constants.ENGINE_FUEL_VALUE_MILK, Constants.ENGINE_CYCLE_DURATION_MILK, 3));
    }
    Fluid seedOil = Fluids.SEED_OIL.getFluid();
    if (seedOil != null) {
        FuelManager.bronzeEngineFuel.put(seedOil, new EngineBronzeFuel(seedOil, Constants.ENGINE_FUEL_VALUE_SEED_OIL, Constants.ENGINE_CYCLE_DURATION_SEED_OIL, 1));
    }
    Fluid honey = Fluids.FOR_HONEY.getFluid();
    if (honey != null) {
        FuelManager.bronzeEngineFuel.put(honey, new EngineBronzeFuel(honey, Constants.ENGINE_FUEL_VALUE_HONEY, Constants.ENGINE_CYCLE_DURATION_HONEY, 1));
    }
    Fluid juice = Fluids.JUICE.getFluid();
    if (juice != null) {
        FuelManager.bronzeEngineFuel.put(juice, new EngineBronzeFuel(juice, Constants.ENGINE_FUEL_VALUE_JUICE, Constants.ENGINE_CYCLE_DURATION_JUICE, 1));
    }
    // Set rain substrates
    ItemStack iodineCharge = coreItems.iodineCharge.getItemStack();
    ItemStack dissipationCharge = coreItems.craftingMaterial.getDissipationCharge();
    FuelManager.rainSubstrate.put(iodineCharge, new RainSubstrate(iodineCharge, Constants.RAINMAKER_RAIN_DURATION_IODINE, 0.01f));
    FuelManager.rainSubstrate.put(dissipationCharge, new RainSubstrate(dissipationCharge, 0.075f));
    ICircuitLayout layoutMachineUpgrade = new CircuitLayout("machine.upgrade", CircuitSocketType.MACHINE);
    ChipsetManager.circuitRegistry.registerLayout(layoutMachineUpgrade);
}
Also used : ICircuitLayout(forestry.api.circuits.ICircuitLayout) EngineCopperFuel(forestry.api.fuels.EngineCopperFuel) ItemRegistryCore(forestry.core.items.ItemRegistryCore) MoistenerFuel(forestry.api.fuels.MoistenerFuel) Fluid(net.minecraftforge.fluids.Fluid) FermenterFuel(forestry.api.fuels.FermenterFuel) EngineBronzeFuel(forestry.api.fuels.EngineBronzeFuel) RainSubstrate(forestry.api.fuels.RainSubstrate) ICircuitLayout(forestry.api.circuits.ICircuitLayout) CircuitLayout(forestry.core.circuits.CircuitLayout) ItemStack(net.minecraft.item.ItemStack)

Aggregations

ICircuitLayout (forestry.api.circuits.ICircuitLayout)4 CircuitLayout (forestry.core.circuits.CircuitLayout)4 ItemRegistryCore (forestry.core.items.ItemRegistryCore)2 ItemStack (net.minecraft.item.ItemStack)2 IFarmProperties (forestry.api.farming.IFarmProperties)1 IFarmRegistry (forestry.api.farming.IFarmRegistry)1 EngineBronzeFuel (forestry.api.fuels.EngineBronzeFuel)1 EngineCopperFuel (forestry.api.fuels.EngineCopperFuel)1 FermenterFuel (forestry.api.fuels.FermenterFuel)1 MoistenerFuel (forestry.api.fuels.MoistenerFuel)1 RainSubstrate (forestry.api.fuels.RainSubstrate)1 BlockRegistryFarming (forestry.farming.blocks.BlockRegistryFarming)1 CircuitFarmLogic (forestry.farming.circuits.CircuitFarmLogic)1 FarmLogicRubber (forestry.farming.logic.FarmLogicRubber)1 FarmableAgingCrop (forestry.farming.logic.farmables.FarmableAgingCrop)1 FarmableGE (forestry.farming.logic.farmables.FarmableGE)1 FarmableGourd (forestry.farming.logic.farmables.FarmableGourd)1 FarmableStacked (forestry.farming.logic.farmables.FarmableStacked)1 FarmableVanillaMushroom (forestry.farming.logic.farmables.FarmableVanillaMushroom)1 FarmableVanillaSapling (forestry.farming.logic.farmables.FarmableVanillaSapling)1