Search in sources :

Example 1 with Time

use of buildcraft.transport.statements.TriggerClockTimer.Time in project BuildCraft by BuildCraft.

the class BuildCraftTransport method preInit.

@Mod.EventHandler
public void preInit(FMLPreInitializationEvent evt) {
    // TODO Fluid shader rendering
    // FluidShaderManager.INSTANCE.getRenderer(null);
    new BCCreativeTab("pipes");
    if (NEPTUNE_TESTING)
        new BCCreativeTab("neptune");
    if (Loader.isModLoaded("BuildCraft|Silicon")) {
        new BCCreativeTab("gates");
    }
    try {
        BuildCraftCore.mainConfigManager.register("experimental.kinesisLossMode", "lossless", "Allowed values: lossless, absolute, percentage. Defaults to lossless.", RestartRequirement.WORLD);
        BuildCraftCore.mainConfigManager.register("experimental.kinesisCanExplode", false, "Can kinesis pipes explode when over their RF/t rating?", RestartRequirement.NONE);
        BuildCraftCore.mainConfigManager.register("general.pipes.hardness", DefaultProps.PIPES_DURABILITY, "How hard to break should a pipe be?", RestartRequirement.NONE);
        BuildCraftCore.mainConfigManager.register("general.pipes.baseFluidRate", DefaultProps.PIPES_FLUIDS_BASE_FLOW_RATE, "What should the base flow rate of a fluid pipe be?", RestartRequirement.GAME).setMinValue(1).setMaxValue(40);
        BuildCraftCore.mainConfigManager.register("debug.printFacadeList", false, "Print a list of all registered facades.", RestartRequirement.GAME);
        BuildCraftCore.mainConfigManager.register("general.pipes.facadeShowAllInCreative", true, "Should all BC facades be shown in Creative/NEI, or just a few carefully chosen ones?", RestartRequirement.GAME);
        BuildCraftCore.mainConfigManager.register("general.pipes.slimeballWaterproofRecipe", false, "Should I enable an alternate Waterproof recipe, based on slimeballs?", RestartRequirement.GAME);
        BuildCraftCore.mainConfigManager.register("power.gateCostMultiplier", 1.0D, "What should be the multiplier of all gate power costs?", RestartRequirement.GAME);
        BuildCraftCore.mainConfigManager.register("general.pipes.facadeBlacklist", new String[] { // @formatter:off
        Block.blockRegistry.getNameForObject(Blocks.end_portal_frame).toString(), Block.blockRegistry.getNameForObject(Blocks.grass).toString(), Block.blockRegistry.getNameForObject(Blocks.leaves).toString(), Block.blockRegistry.getNameForObject(Blocks.leaves2).toString(), Block.blockRegistry.getNameForObject(Blocks.lit_pumpkin).toString(), Block.blockRegistry.getNameForObject(Blocks.lit_redstone_lamp).toString(), Block.blockRegistry.getNameForObject(Blocks.mob_spawner).toString(), Block.blockRegistry.getNameForObject(Blocks.monster_egg).toString(), Block.blockRegistry.getNameForObject(Blocks.redstone_lamp).toString(), Block.blockRegistry.getNameForObject(Blocks.double_stone_slab).toString(), Block.blockRegistry.getNameForObject(Blocks.double_wooden_slab).toString(), Block.blockRegistry.getNameForObject(Blocks.sponge).toString() // @formatter:on
        }, "What block types should be blacklisted from being a facade?", RestartRequirement.GAME);
        BuildCraftCore.mainConfigManager.register("general.pipes.facadeNoLaserRecipe", false, "Should non-laser (crafting table) facade recipes be forced?", RestartRequirement.GAME);
        reloadConfig(RestartRequirement.GAME);
        if (showAllFacadesCreative) {
            new BCCreativeTab("facades");
        }
        filteredBufferBlock = new BlockFilteredBuffer();
        BCRegistry.INSTANCE.registerBlock(filteredBufferBlock.setUnlocalizedName("filteredBufferBlock"), false);
        pipeWaterproof = new ItemBuildCraft();
        pipeWaterproof.setUnlocalizedName("pipeWaterproof");
        BCRegistry.INSTANCE.registerItem(pipeWaterproof, false);
        genericPipeBlock = (BlockGenericPipe) CompatHooks.INSTANCE.getBlock(BlockGenericPipe.class);
        BCRegistry.INSTANCE.registerBlock(genericPipeBlock.setUnlocalizedName("pipeBlock"), ItemBlock.class, true);
        ItemStack andesite = new ItemStack(Blocks.stone, 1, 5);
        ItemStack diorite = new ItemStack(Blocks.stone, 1, 3);
        ItemStack granite = new ItemStack(Blocks.stone, 1, 1);
        pipeItemsWood = buildPipe(PipeItemsWood.class, "plankWood", "blockGlassColorless", "plankWood");
        pipeItemsEmerald = buildPipe(PipeItemsEmerald.class, "gemEmerald", "blockGlassColorless", "gemEmerald");
        // pipeItemsCobblestone = buildPipe(PipeItemsCobblestone.class, "cobblestone", "blockGlassColorless", "cobblestone");
        pipeItemsStone = buildPipe(PipeItemsStone.class, "stone", "blockGlassColorless", "stone");
        pipeItemsGranite = buildPipe(PipeItemsGranite.class, granite, "blockGlassColorless", granite);
        pipeItemsDiorite = buildPipe(PipeItemsDiorite.class, diorite, "blockGlassColorless", diorite);
        pipeItemsAndesite = buildPipe(PipeItemsAndesite.class, andesite, "blockGlassColorless", andesite);
        // pipeItemsQuartz = buildPipe(PipeItemsQuartz.class, "blockQuartz", "blockGlassColorless", "blockQuartz");
        pipeItemsIron = buildPipe(PipeItemsIron.class, "ingotIron", "blockGlassColorless", "ingotIron");
        pipeItemsGold = buildPipe(PipeItemsGold.class, "ingotGold", "blockGlassColorless", "ingotGold");
        pipeItemsDiamond = buildPipe(PipeItemsDiamond.class, "gemDiamond", "blockGlassColorless", "gemDiamond");
        pipeItemsObsidian = buildPipe(PipeItemsObsidian.class, Blocks.obsidian, "blockGlassColorless", Blocks.obsidian);
        // pipeItemsLapis = buildPipe(PipeItemsLapis.class, "blockLapis", "blockGlassColorless", "blockLapis");
        // pipeItemsDaizuli = buildPipe(PipeItemsDaizuli.class, "blockLapis", "blockGlassColorless", "gemDiamond");
        pipeItemsSandstone = buildPipe(PipeItemsSandstone.class, Blocks.sandstone, "blockGlassColorless", Blocks.sandstone);
        // pipeItemsVoid = buildPipe(PipeItemsVoid.class, "dyeBlack", "blockGlassColorless", "dustRedstone");
        // pipeItemsEmzuli = buildPipe(PipeItemsEmzuli.class, "blockLapis", "blockGlassColorless", "gemEmerald");
        // pipeItemsStripes = buildPipe(PipeItemsStripes.class, "gearGold", "blockGlassColorless", "gearGold");
        pipeItemsClay = buildPipe(PipeItemsClay.class, Blocks.clay, "blockGlassColorless", Blocks.clay);
        pipeFluidsWood = buildPipe(PipeFluidsWood.class, pipeWaterproof, pipeItemsWood);
        // pipeFluidsCobblestone = buildPipe(PipeFluidsCobblestone.class, pipeWaterproof, pipeItemsCobblestone);
        pipeFluidsStone = buildPipe(PipeFluidsStone.class, pipeWaterproof, pipeItemsStone);
        pipeFluidsAndesite = buildPipe(PipeFluidsAndesite.class, pipeWaterproof, pipeItemsAndesite);
        pipeFluidsDiorite = buildPipe(PipeFluidsDiorite.class, pipeWaterproof, pipeItemsDiorite);
        pipeFluidsGranite = buildPipe(PipeFluidsGranite.class, pipeWaterproof, pipeItemsGranite);
        // pipeFluidsQuartz = buildPipe(PipeFluidsQuartz.class, pipeWaterproof, pipeItemsQuartz);
        pipeFluidsIron = buildPipe(PipeFluidsIron.class, pipeWaterproof, pipeItemsIron);
        pipeFluidsGold = buildPipe(PipeFluidsGold.class, pipeWaterproof, pipeItemsGold);
        pipeFluidsEmerald = buildPipe(PipeFluidsEmerald.class, pipeWaterproof, pipeItemsEmerald);
        pipeFluidsDiamond = buildPipe(PipeFluidsDiamond.class, pipeWaterproof, pipeItemsDiamond);
        pipeFluidsSandstone = buildPipe(PipeFluidsSandstone.class, pipeWaterproof, pipeItemsSandstone);
        // pipeFluidsVoid = buildPipe(PipeFluidsVoid.class, pipeWaterproof, pipeItemsVoid);
        pipeFluidsClay = buildPipe(PipeFluidsClay.class, pipeWaterproof, pipeItemsClay);
        pipePowerWood = buildPipe(PipePowerWood.class, "dustRedstone", pipeItemsWood);
        // pipePowerCobblestone = buildPipe(PipePowerCobblestone.class, "dustRedstone", pipeItemsCobblestone);
        pipePowerStone = buildPipe(PipePowerStone.class, "dustRedstone", pipeItemsStone);
        // PIPE_QUARTZ_POWER = buildPipe(PipePowerQuartz.class, "dustRedstone", pipeItemsQuartz);
        pipePowerIron = buildPipe(PipePowerIron.class, "dustRedstone", pipeItemsIron);
        pipePowerGold = buildPipe(PipePowerGold.class, "dustRedstone", pipeItemsGold);
        pipePowerDiamond = buildPipe(PipePowerDiamond.class, "dustRedstone", pipeItemsDiamond);
        // pipePowerEmerald = buildPipe(PipePowerEmerald.class, "dustRedstone", pipeItemsEmerald);
        // PIPE_SANDSTONE_POWER = buildPipe(PipePowerSandstone.class, "dustRedstone", pipeItemsSandstone);
        pipeStructureCobblestone = buildPipe(PipeStructureCobblestone.class, Blocks.cobblestone, Blocks.gravel, Blocks.cobblestone);
        pipeWire = new ItemPipeWire();
        BCRegistry.INSTANCE.registerItem(pipeWire, false);
        PipeWire.item = pipeWire;
        pipeGate = new ItemGate();
        pipeGate.setUnlocalizedName("pipeGate");
        BCRegistry.INSTANCE.registerItem(pipeGate, false);
        facadeItem = new ItemFacade();
        facadeItem.setUnlocalizedName("pipeFacade");
        BCRegistry.INSTANCE.registerItem(facadeItem, false);
        FacadeAPI.facadeItem = facadeItem;
        plugItem = new ItemPlug();
        plugItem.setUnlocalizedName("pipePlug");
        BCRegistry.INSTANCE.registerItem(plugItem, false);
        lensItem = new ItemLens();
        lensItem.setUnlocalizedName("pipeLens");
        BCRegistry.INSTANCE.registerItem(lensItem, false);
        powerAdapterItem = new ItemPowerAdapter();
        powerAdapterItem.setUnlocalizedName("pipePowerAdapter");
        BCRegistry.INSTANCE.registerItem(powerAdapterItem, false);
        gateCopier = new ItemGateCopier();
        BCRegistry.INSTANCE.registerItem(gateCopier, false);
        for (PipeContents kind : PipeContents.values()) {
            triggerPipe[kind.ordinal()] = new TriggerPipeContents(kind);
        }
        for (PipeWire wire : PipeWire.values()) {
            triggerPipeWireActive[wire.ordinal()] = new TriggerPipeSignal(true, wire);
            triggerPipeWireInactive[wire.ordinal()] = new TriggerPipeSignal(false, wire);
            actionPipeWire[wire.ordinal()] = new ActionPipeSignal(wire);
        }
        for (Time time : TriggerClockTimer.Time.VALUES) {
            triggerTimer[time.ordinal()] = new TriggerClockTimer(time);
        }
        triggerRedstoneFader[0] = new TriggerRedstoneFaderInput(TriggerRedstoneFaderInput.Mode.LESS);
        triggerRedstoneFader[1] = new TriggerRedstoneFaderInput(TriggerRedstoneFaderInput.Mode.EQUAL);
        triggerRedstoneFader[2] = new TriggerRedstoneFaderInput(TriggerRedstoneFaderInput.Mode.GREATER);
        actionRedstoneFader = new ActionRedstoneFaderOutput();
        for (EnumDyeColor color : EnumDyeColor.values()) {
            actionPipeColor[color.ordinal()] = new ActionPipeColor(color);
        }
        for (EnumFacing direction : EnumFacing.VALUES) {
            actionPipeDirection[direction.ordinal()] = new ActionPipeDirection(direction);
        }
        for (PowerMode limit : PowerMode.VALUES) {
            actionPowerLimiter[limit.ordinal()] = new ActionPowerLimiter(limit);
        }
        triggerLightSensorBright = new TriggerLightSensor(true);
        triggerLightSensorDark = new TriggerLightSensor(false);
    } finally {
        BuildCraftCore.mainConfiguration.save();
    }
    InterModComms.registerHandler(new IMCHandlerTransport());
    if (NEPTUNE_TESTING) {
        pipeBlock = new BlockPipe();
        /* Ideally we would use "pipeBlock" but its taken by the generic pipe. Using pipeBlockNeptune will probably
             * be fine for us though */
        pipeBlock.setUnlocalizedName("pipeBlockNeptune");
        BCRegistry.INSTANCE.registerBlock(pipeBlock, /* Register the block without registering an item - each pipe creates an item for itself. */
        null, /* Force register the pipe block- its probably a mistake for it to be disabled in the config, as you
                     * can already disable pipes indervidually. We don't mind too much about using an additional block
                     * id. */
        true);
        // Let a seperate class handle all of the pipe initialisation- there is a large amount of it to do and we
        // don't need to make this even bigger than what it already is
        TransportPipes_BC8.preInit();
    }
}
Also used : ItemBuildCraft(buildcraft.core.lib.items.ItemBuildCraft) EnumFacing(net.minecraft.util.EnumFacing) Time(buildcraft.transport.statements.TriggerClockTimer.Time) BlockPipe(buildcraft.transport.block.BlockPipe) PipeWire(buildcraft.api.transport.PipeWire) PipeContents(buildcraft.transport.statements.TriggerPipeContents.PipeContents)

Aggregations

PipeWire (buildcraft.api.transport.PipeWire)1 ItemBuildCraft (buildcraft.core.lib.items.ItemBuildCraft)1 BlockPipe (buildcraft.transport.block.BlockPipe)1 Time (buildcraft.transport.statements.TriggerClockTimer.Time)1 PipeContents (buildcraft.transport.statements.TriggerPipeContents.PipeContents)1 EnumFacing (net.minecraft.util.EnumFacing)1