Search in sources :

Example 1 with ItemBuildCraft

use of buildcraft.core.lib.items.ItemBuildCraft 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)

Example 2 with ItemBuildCraft

use of buildcraft.core.lib.items.ItemBuildCraft in project BuildCraft by BuildCraft.

the class BuildCraftCore method loadConfiguration.

@Mod.EventHandler
public void loadConfiguration(FMLPreInitializationEvent evt) {
    BCLog.logger.info("Starting BuildCraft " + DefaultProps.VERSION);
    BCLog.logger.info("Copyright (c) the BuildCraft team, 2011-2016");
    BCLog.logger.info("http://www.mod-buildcraft.com");
    new BCCreativeTab("main");
    commandBuildcraft.addAlias("bc");
    commandBuildcraft.addChildCommand(new SubCommandDeop());
    commandBuildcraft.addChildCommand(new SubCommandOp());
    BuildcraftRecipeRegistry.assemblyTable = AssemblyRecipeManager.INSTANCE;
    BuildcraftRecipeRegistry.integrationTable = IntegrationRecipeManager.INSTANCE;
    BuildcraftRecipeRegistry.refinery = RefineryRecipeManager.INSTANCE;
    BuildcraftRecipeRegistry.programmingTable = ProgrammingRecipeManager.INSTANCE;
    BuilderAPI.schematicHelper = SchematicHelper.INSTANCE;
    BuilderAPI.schematicRegistry = SchematicRegistry.INSTANCE;
    File cfgBase = new File(evt.getModConfigurationDirectory(), "buildcraft");
    BCRegistry.INSTANCE.setRegistryConfig(new File(cfgBase, "objects.cfg"));
    mainConfiguration = new Configuration(new File(cfgBase, "main.cfg"));
    detailedConfigManager = new FileConfigManager(" The buildcraft detailed configuration file. This contains a lot of miscelaneous options that have no " + "affect on gameplay.\n You should refer to the BC source code for a detailed description of what these do. " + "(https://github.com/BuildCraft/BuildCraft)\n" + " This file will be overwritten every time that buildcraft starts, so there is no point in adding comments");
    detailedConfigManager.setConfigFile(new File(cfgBase, "detailed.properties"));
    ConficGuiFactoryBC.setConfig(mainConfiguration);
    mainConfiguration.load();
    ConficGuiFactoryBC.getCat("debug").setShowInGui(false);
    ConficGuiFactoryBC.getCat("vars").setShowInGui(false);
    ConficGuiFactoryBC.register("general.useServerDataOnClient", BuildCraftCore.useServerDataOnClient, "Allows BuildCraft to use the integrated server's data on the client on singleplayer worlds. Disable if you're getting the odd crash caused by it.", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("general.builderMaxIterationsPerItemFactor", BuildCraftCore.builderMaxPerItemFactor, "Lower this number if BuildCraft builders/fillers are causing TPS lag. Raise it if you think they are being too slow.", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("general.miningBreaksPlayerProtectedBlocks", false, "Should BuildCraft miners be allowed to break blocks using player-specific protection?", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("general.updateCheck", true, "Should I check the BuildCraft version on startup?", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("display.hidePowerValues", false, "Should all power values (RF, RF/t) be hidden?", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("display.hideFluidValues", false, "Should all fluid values (mB, mB/t) be hidden?", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("general.itemLifespan", 60, "How long, in seconds, should items stay on the ground? (Vanilla = 300, default = 60)", RestartRequirement.NONE).setMinValue(5);
    ConficGuiFactoryBC.register("network.updateFactor", 10, "How often, in ticks, should network update packets be sent? Increasing this might help network performance.", RestartRequirement.GAME).setMinValue(1);
    ConficGuiFactoryBC.register("network.longUpdateFactor", 40, "How often, in ticks, should full network sync packets be sent? Increasing this might help network performance.", RestartRequirement.GAME).setMinValue(1);
    ConficGuiFactoryBC.register("general.canEnginesExplode", false, "Should engines explode upon overheat?", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("worldgen.enable", true, "Should BuildCraft generate anything in the world?", RestartRequirement.GAME);
    ConficGuiFactoryBC.register("general.pumpsConsumeWater", false, "Should pumps consume water? Enabling this might cause performance issues!", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("power.miningUsageMultiplier", 1.0D, "What should the multiplier of all mining-related power usage be?", RestartRequirement.NONE);
    ConficGuiFactoryBC.register("display.colorBlindMode", false, "Should I enable colorblind mode?", RestartRequirement.GAME);
    ConficGuiFactoryBC.register("worldgen.generateWaterSprings", true, "Should BuildCraft generate water springs?", RestartRequirement.GAME);
    ConficGuiFactoryBC.register("debug.network.stats", false, "Should all network packets be tracked for statistical purposes?", RestartRequirement.NONE);
    reloadConfig(RestartRequirement.GAME);
    wrenchItem = (new ItemWrench()).setTextureLocation("buildcraftcore:wrench").setUnlocalizedName("wrenchItem");
    BCRegistry.INSTANCE.registerItem(wrenchItem, false);
    mapLocationItem = (new ItemMapLocation()).setUnlocalizedName("mapLocation");
    BCRegistry.INSTANCE.registerItem(mapLocationItem, false);
    listItem = (ItemList) (new ItemList()).setUnlocalizedName("list");
    BCRegistry.INSTANCE.registerItem(listItem, false);
    debuggerItem = (new ItemDebugger()).setUnlocalizedName("debugger");
    BCRegistry.INSTANCE.registerItem(debuggerItem, false);
    if (BuildCraftCore.modifyWorld) {
        EnumSpring.WATER.canGen = ConficGuiFactoryBC.get("worldgen.generateWaterSprings").getBoolean();
        springBlock = new BlockSpring();
        springBlock.setUnlocalizedName("eternalSpring");
        BCRegistry.INSTANCE.registerBlock(springBlock, ItemSpring.class, false);
    }
    woodenGearItem = (new ItemBuildCraft()).setTextureLocation("buildcraftcore:gear/wood").setUnlocalizedName("woodenGearItem");
    if (BCRegistry.INSTANCE.registerItem(woodenGearItem, false)) {
        OreDictionary.registerOre("gearWood", new ItemStack(woodenGearItem));
    }
    stoneGearItem = (new ItemBuildCraft()).setTextureLocation("buildcraftcore:gear/stone").setUnlocalizedName("stoneGearItem");
    if (BCRegistry.INSTANCE.registerItem(stoneGearItem, false)) {
        OreDictionary.registerOre("gearStone", new ItemStack(stoneGearItem));
    }
    ironGearItem = (new ItemBuildCraft()).setTextureLocation("buildcraftcore:gear/iron").setUnlocalizedName("ironGearItem");
    if (BCRegistry.INSTANCE.registerItem(ironGearItem, false)) {
        OreDictionary.registerOre("gearIron", new ItemStack(ironGearItem));
    }
    goldGearItem = (new ItemBuildCraft()).setTextureLocation("buildcraftcore:gear/gold").setUnlocalizedName("goldGearItem");
    if (BCRegistry.INSTANCE.registerItem(goldGearItem, false)) {
        OreDictionary.registerOre("gearGold", new ItemStack(goldGearItem));
    }
    diamondGearItem = (new ItemBuildCraft()).setTextureLocation("buildcraftcore:gear/diamond").setUnlocalizedName("diamondGearItem");
    if (BCRegistry.INSTANCE.registerItem(diamondGearItem, false)) {
        OreDictionary.registerOre("gearDiamond", new ItemStack(diamondGearItem));
    }
    paintbrushItem = new ItemPaintbrush();
    paintbrushItem.setUnlocalizedName("paintbrush");
    BCRegistry.INSTANCE.registerItem(paintbrushItem, false);
    if (DEVELOPER_MODE) {
        tabletItem = new ItemTablet();
        tabletItem.setUnlocalizedName("tablet");
        BCRegistry.INSTANCE.registerItem(tabletItem, false);
    }
    decoratedBlock = new BlockDecoration();
    decoratedBlock.setUnlocalizedName("decoratedBlock");
    BCRegistry.INSTANCE.registerBlock(decoratedBlock, true);
    engineBlock = (BlockEngine) CompatHooks.INSTANCE.getBlock(BlockEngine.class);
    BCRegistry.INSTANCE.registerBlock(engineBlock, ItemEngine.class, true);
    engineBlock.registerTile((Class<? extends TileEngineBase>) CompatHooks.INSTANCE.getTile(TileEngineWood.class), 0, "tile.engineWood");
    BCRegistry.INSTANCE.registerTileEntity(TileEngineWood.class, "buildcraft.core.engine.wood", "net.minecraft.src.buildcraft.energy.TileEngineWood");
    markerBlock = (BlockMarker) CompatHooks.INSTANCE.getBlock(BlockMarker.class);
    BCRegistry.INSTANCE.registerBlock(markerBlock.setUnlocalizedName("markerBlock"), false);
    pathMarkerBlock = (BlockPathMarker) CompatHooks.INSTANCE.getBlock(BlockPathMarker.class);
    BCRegistry.INSTANCE.registerBlock(pathMarkerBlock.setUnlocalizedName("pathMarkerBlock"), false);
    MinecraftForge.EVENT_BUS.register(this);
    MinecraftForge.EVENT_BUS.register(new BlockHighlightHandler());
    MinecraftForge.EVENT_BUS.register(new ListTooltipHandler());
    MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
    OreDictionary.registerOre("craftingTableWood", Blocks.crafting_table);
}
Also used : BlockHighlightHandler(buildcraft.core.render.BlockHighlightHandler) ItemMapLocation(buildcraft.core.item.ItemMapLocation) ListTooltipHandler(buildcraft.core.list.ListTooltipHandler) Configuration(net.minecraftforge.common.config.Configuration) BlockDecoration(buildcraft.core.block.BlockDecoration) FileConfigManager(buildcraft.lib.config.FileConfigManager) BlockSpring(buildcraft.core.block.BlockSpring) ItemTablet(buildcraft.core.tablet.ItemTablet) SubCommandOp(buildcraft.core.command.SubCommandOp) ItemBuildCraft(buildcraft.core.lib.items.ItemBuildCraft) SubCommandDeop(buildcraft.core.command.SubCommandDeop) ItemStack(net.minecraft.item.ItemStack) File(java.io.File)

Example 3 with ItemBuildCraft

use of buildcraft.core.lib.items.ItemBuildCraft in project BuildCraft by BuildCraft.

the class BuildCraftFactory method fmlPreInit.

@Mod.EventHandler
public void fmlPreInit(FMLPreInitializationEvent evt) {
    channels = NetworkRegistry.INSTANCE.newChannel(DefaultProps.NET_CHANNEL_NAME + "-FACTORY", new ChannelHandler(), new PacketHandler());
    BuildcraftRecipeRegistry.complexRefinery = ComplexRefineryRecipeManager.INSTANCE;
    String plc = "Allows admins to whitelist or blacklist pumping of specific fluids in specific dimensions.\n" + "Eg. \"-/-1/Lava\" will disable lava in the nether. \"-/*/Lava\" will disable lava in any dimension. \"+/0/*\" will enable any fluid in the overworld.\n" + "Entries are comma seperated, banned fluids have precedence over allowed ones." + "Default is \"+/*/*,+/-1/Lava\" - the second redundant entry (\"+/-1/lava\") is there to show the format.";
    BuildCraftCore.mainConfigManager.register("general.miningDepth", 256, "Should the mining well only be usable once after placing?", RestartRequirement.NONE);
    BuildCraftCore.mainConfigManager.get("general.miningDepth").setMinValue(2).setMaxValue(256);
    BuildCraftCore.mainConfigManager.register("general.pumpDimensionControl", DefaultProps.PUMP_DIMENSION_LIST, plc, RestartRequirement.NONE);
    BuildCraftCore.mainConfigManager.register("general.pumpsNeedRealPower", false, "Do pumps need real (non-redstone) power?", RestartRequirement.WORLD);
    reloadConfig(RestartRequirement.GAME);
    miningWellBlock = (BlockMiningWell) CompatHooks.INSTANCE.getBlock(BlockMiningWell.class);
    if (BCRegistry.INSTANCE.registerBlock(miningWellBlock.setUnlocalizedName("miningWellBlock"), false)) {
        plainPipeBlock = new BlockPlainPipe();
        BCRegistry.INSTANCE.registerBlock(plainPipeBlock.setUnlocalizedName("plainPipeBlock"), true);
    }
    autoWorkbenchBlock = (BlockAutoWorkbench) CompatHooks.INSTANCE.getBlock(BlockAutoWorkbench.class);
    BCRegistry.INSTANCE.registerBlock(autoWorkbenchBlock.setUnlocalizedName("autoWorkbenchBlock"), false);
    tankBlock = (BlockTank) CompatHooks.INSTANCE.getBlock(BlockTank.class);
    BCRegistry.INSTANCE.registerBlock(tankBlock.setUnlocalizedName("tankBlock"), false);
    pumpBlock = (BlockPump) CompatHooks.INSTANCE.getBlock(BlockPump.class);
    BCRegistry.INSTANCE.registerBlock(pumpBlock.setUnlocalizedName("pumpBlock"), false);
    floodGateBlock = (BlockFloodGate) CompatHooks.INSTANCE.getBlock(BlockFloodGate.class);
    BCRegistry.INSTANCE.registerBlock(floodGateBlock.setUnlocalizedName("floodGateBlock"), false);
    refineryBlock = (BlockRefinery) CompatHooks.INSTANCE.getBlock(BlockRefinery.class);
    BCRegistry.INSTANCE.registerBlock(refineryBlock.setUnlocalizedName("refineryBlock"), false);
    chuteBlock = (BlockChute) CompatHooks.INSTANCE.getBlock(BlockChute.class);
    BCRegistry.INSTANCE.registerBlock(chuteBlock.setUnlocalizedName("blockChute"), false);
    if (Loader.isModLoaded("BuildCraft|Energy")) {
        energyHeaterBlock = (BlockEnergyHeater) CompatHooks.INSTANCE.getBlock(BlockEnergyHeater.class);
        BCRegistry.INSTANCE.registerBlock(energyHeaterBlock.setUnlocalizedName("blockEnergyHeater"), false);
        heatExchangeBlock = (BlockHeatExchange) CompatHooks.INSTANCE.getBlock(BlockHeatExchange.class);
        BCRegistry.INSTANCE.registerBlock(heatExchangeBlock.setUnlocalizedName("blockHeatExchange"), false);
        distillerBlock = (BlockDistiller) CompatHooks.INSTANCE.getBlock(BlockDistiller.class);
        BCRegistry.INSTANCE.registerBlock(distillerBlock.setUnlocalizedName("blockDistiller"), false);
        plasticSheetItem = new ItemBuildCraft();
        plasticSheetItem.setUnlocalizedName("plasticSheet");
        plasticSheetItem.setLocalizationRuleArray("item.plasticSheet.singular", "item.plasticSheet.plural");
        plasticSheetItem.setLocalizationRule((stack) -> stack == null ? 0 : stack.stackSize > 1 ? 1 : 0);
        BCRegistry.INSTANCE.registerItem(plasticSheetItem, false);
        ComplexRefiningManager.preInit();
    }
    FactoryProxy.proxy.preInit();
    MinecraftForge.EVENT_BUS.register(this);
}
Also used : PacketHandler(buildcraft.core.lib.network.base.PacketHandler) ItemBuildCraft(buildcraft.core.lib.items.ItemBuildCraft) BlockPlainPipe(buildcraft.factory.BlockPlainPipe) ChannelHandler(buildcraft.core.lib.network.base.ChannelHandler)

Example 4 with ItemBuildCraft

use of buildcraft.core.lib.items.ItemBuildCraft in project BuildCraft by BuildCraft.

the class BuildCraftSilicon method preInit.

@Mod.EventHandler
public void preInit(FMLPreInitializationEvent evt) {
    BuildCraftCore.mainConfigManager.register("power.chipsetCostMultiplier", 1.0D, "The cost multiplier for Chipsets", RestartRequirement.GAME);
    BuildCraftCore.mainConfiguration.save();
    chipsetCostMultiplier = (float) BuildCraftCore.mainConfigManager.get("power.chipsetCostMultiplier").getDouble();
    if (BuildCraftCore.mainConfiguration.hasChanged()) {
        BuildCraftCore.mainConfiguration.save();
    }
    laserBlock = (BlockLaser) CompatHooks.INSTANCE.getBlock(BlockLaser.class);
    laserBlock.setUnlocalizedName("laserBlock");
    BCRegistry.INSTANCE.registerBlock(laserBlock, false);
    assemblyTableBlock = (BlockLaserTable) CompatHooks.INSTANCE.getBlock(BlockLaserTable.class);
    assemblyTableBlock.setUnlocalizedName("laserTableBlock");
    BCRegistry.INSTANCE.registerBlock(assemblyTableBlock, ItemLaserTable.class, false);
    redstoneChipset = new ItemRedstoneChipset();
    redstoneChipset.setUnlocalizedName("redstoneChipset");
    BCRegistry.INSTANCE.registerItem(redstoneChipset, false);
    redstoneChipset.registerItemStacks();
    redstoneCrystal = (new ItemBuildCraft()).setUnlocalizedName("redstoneCrystal");
    if (BCRegistry.INSTANCE.registerItem(redstoneCrystal, false)) {
        // Deprecated
        OreDictionary.registerOre("redstoneCrystal", new ItemStack(redstoneCrystal));
        OreDictionary.registerOre("crystalRedstone", new ItemStack(redstoneCrystal));
    }
    SiliconProxy.proxy.preInit();
}
Also used : ItemBuildCraft(buildcraft.core.lib.items.ItemBuildCraft) ItemStack(net.minecraft.item.ItemStack) ItemRedstoneChipset(buildcraft.silicon.ItemRedstoneChipset)

Aggregations

ItemBuildCraft (buildcraft.core.lib.items.ItemBuildCraft)4 ItemStack (net.minecraft.item.ItemStack)2 PipeWire (buildcraft.api.transport.PipeWire)1 BlockDecoration (buildcraft.core.block.BlockDecoration)1 BlockSpring (buildcraft.core.block.BlockSpring)1 SubCommandDeop (buildcraft.core.command.SubCommandDeop)1 SubCommandOp (buildcraft.core.command.SubCommandOp)1 ItemMapLocation (buildcraft.core.item.ItemMapLocation)1 ChannelHandler (buildcraft.core.lib.network.base.ChannelHandler)1 PacketHandler (buildcraft.core.lib.network.base.PacketHandler)1 ListTooltipHandler (buildcraft.core.list.ListTooltipHandler)1 BlockHighlightHandler (buildcraft.core.render.BlockHighlightHandler)1 ItemTablet (buildcraft.core.tablet.ItemTablet)1 BlockPlainPipe (buildcraft.factory.BlockPlainPipe)1 FileConfigManager (buildcraft.lib.config.FileConfigManager)1 ItemRedstoneChipset (buildcraft.silicon.ItemRedstoneChipset)1 BlockPipe (buildcraft.transport.block.BlockPipe)1 Time (buildcraft.transport.statements.TriggerClockTimer.Time)1 PipeContents (buildcraft.transport.statements.TriggerPipeContents.PipeContents)1 File (java.io.File)1