Ejemplo n.º 1
0
  @PreInit
  public void initialize(FMLPreInitializationEvent evt) {
    allowMining =
        BuildCraftCore.mainConfiguration
            .get(Configuration.CATEGORY_GENERAL, "mining.enabled", true)
            .getBoolean(true);

    pumpDimensionList =
        new PumpDimensionList(
            BuildCraftCore.mainConfiguration
                .get(
                    Configuration.CATEGORY_GENERAL,
                    "pumping.controlList",
                    DefaultProps.PUMP_DIMENSION_LIST)
                .getString());

    Property miningWellId =
        BuildCraftCore.mainConfiguration.getBlock("miningWell.id", DefaultProps.MINING_WELL_ID);
    Property plainPipeId =
        BuildCraftCore.mainConfiguration.getBlock("drill.id", DefaultProps.DRILL_ID);
    Property autoWorkbenchId =
        BuildCraftCore.mainConfiguration.getBlock(
            "autoWorkbench.id", DefaultProps.AUTO_WORKBENCH_ID);
    Property frameId = BuildCraftCore.mainConfiguration.getBlock("frame.id", DefaultProps.FRAME_ID);
    Property quarryId =
        BuildCraftCore.mainConfiguration.getBlock("quarry.id", DefaultProps.QUARRY_ID);
    Property pumpId = BuildCraftCore.mainConfiguration.getBlock("pump.id", DefaultProps.PUMP_ID);
    Property tankId = BuildCraftCore.mainConfiguration.getBlock("tank.id", DefaultProps.TANK_ID);
    Property refineryId =
        BuildCraftCore.mainConfiguration.getBlock("refinery.id", DefaultProps.REFINERY_ID);
    Property hopperId =
        BuildCraftCore.mainConfiguration.getBlock("hopper.id", DefaultProps.HOPPER_ID);
    Property hopperDisable =
        BuildCraftCore.mainConfiguration.get("Block Savers", "hopper.disabled", false);

    if (BuildCraftCore.mainConfiguration.hasChanged()) {
      BuildCraftCore.mainConfiguration.save();
    }

    miningWellBlock = new BlockMiningWell(miningWellId.getInt());
    CoreProxy.proxy.registerBlock(miningWellBlock.setUnlocalizedName("miningWellBlock"));
    CoreProxy.proxy.addName(miningWellBlock, "Mining Well");

    plainPipeBlock = new BlockPlainPipe(plainPipeId.getInt());
    CoreProxy.proxy.registerBlock(plainPipeBlock.setUnlocalizedName("plainPipeBlock"));
    CoreProxy.proxy.addName(plainPipeBlock, "Mining Pipe");

    autoWorkbenchBlock = new BlockAutoWorkbench(autoWorkbenchId.getInt());
    CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setUnlocalizedName("autoWorkbenchBlock"));
    CoreProxy.proxy.addName(autoWorkbenchBlock, "Automatic Crafting Table");

    frameBlock = new BlockFrame(frameId.getInt());
    CoreProxy.proxy.registerBlock(frameBlock.setUnlocalizedName("frameBlock"));
    CoreProxy.proxy.addName(frameBlock, "Frame");

    quarryBlock = new BlockQuarry(quarryId.getInt());
    CoreProxy.proxy.registerBlock(quarryBlock.setUnlocalizedName("machineBlock"));
    CoreProxy.proxy.addName(quarryBlock, "Quarry");

    tankBlock = new BlockTank(tankId.getInt());
    CoreProxy.proxy.registerBlock(tankBlock.setUnlocalizedName("tankBlock"));
    CoreProxy.proxy.addName(tankBlock, "Tank");

    pumpBlock = new BlockPump(pumpId.getInt());
    CoreProxy.proxy.registerBlock(pumpBlock.setUnlocalizedName("pumpBlock"));
    CoreProxy.proxy.addName(pumpBlock, "Pump");

    refineryBlock = new BlockRefinery(refineryId.getInt());
    CoreProxy.proxy.registerBlock(refineryBlock.setUnlocalizedName("refineryBlock"));
    CoreProxy.proxy.addName(refineryBlock, "Refinery");

    hopperDisabled = hopperDisable.getBoolean(false);
    if (!hopperDisabled) {
      hopperBlock = new BlockHopper(hopperId.getInt());
      CoreProxy.proxy.registerBlock(hopperBlock.setUnlocalizedName("blockHopper"));
      CoreProxy.proxy.addName(hopperBlock, "Hopper");
    }

    FactoryProxy.proxy.initializeEntityRenders();
    if (BuildCraftCore.mainConfiguration.hasChanged()) {
      BuildCraftCore.mainConfiguration.save();
    }

    MinecraftForge.EVENT_BUS.register(this);
  }