示例#1
0
  @EventHandler
  public void initialize(FMLInitializationEvent evt) {
    // MinecraftForge.registerConnectionHandler(new ConnectionHandler());
    ActionManager.registerTriggerProvider(new DefaultTriggerProvider());
    ActionManager.registerActionProvider(new DefaultActionProvider());

    if (BuildCraftCore.modifyWorld) {
      MinecraftForge.EVENT_BUS.register(new SpringPopulate());
    }

    if (BuildCraftCore.loadDefaultRecipes) {
      loadRecipes();
    }
    EntityRegistry.registerModEntity(
        EntityRobot.class, "bcRobot", EntityIds.ROBOT, instance, 50, 1, true);
    EntityRegistry.registerModEntity(
        EntityPowerLaser.class, "bcLaser", EntityIds.LASER, instance, 50, 1, true);
    EntityRegistry.registerModEntity(
        EntityEnergyLaser.class, "bcEnergyLaser", EntityIds.ENERGY_LASER, instance, 50, 1, true);
    EntityList.classToStringMapping.remove(EntityRobot.class);
    EntityList.classToStringMapping.remove(EntityPowerLaser.class);
    EntityList.classToStringMapping.remove(EntityEnergyLaser.class);
    EntityList.stringToClassMapping.remove("BuildCraft|Core.bcRobot");
    EntityList.stringToClassMapping.remove("BuildCraft|Core.bcLaser");
    EntityList.stringToClassMapping.remove("BuildCraft|Core.bcEnergyLaser");

    CoreProxy.proxy.initializeRendering();
    CoreProxy.proxy.initializeEntityRendering();

    Localization.addLocalization("/lang/buildcraft/", DefaultProps.DEFAULT_LANGUAGE);
  }
示例#2
0
  @Init
  public void load(FMLInitializationEvent evt) {
    // Register connection handler
    // MinecraftForge.registerConnectionHandler(new ConnectionHandler());

    // Register gui handler
    // MinecraftForge.setGuiHandler(mod_BuildCraftTransport.instance, new GuiHandler());

    TransportProxy.proxy.registerTileEntities();

    // dockingStationBlock = new
    // BlockDockingStation(Integer.parseInt(dockingStationId.value));
    // ModLoader.registerBlock(dockingStationBlock);
    // CoreProxy.addName(dockingStationBlock.setBlockName("dockingStation"),
    // "Docking Station");

    // ModLoader.RegisterTileEntity(TileDockingStation.class,
    // "net.minecraft.src.buildcraft.TileDockingStation");

    for (int j = 0; j < 6; ++j) {
      diamondTextures[j] = 1 * 16 + 6 + j;
    }

    new BptBlockPipe(genericPipeBlock.blockID);

    BuildCraftCore.itemBptProps[pipeItemsWood.itemID] = new BptItemPipeWooden();
    BuildCraftCore.itemBptProps[pipeLiquidsWood.itemID] = new BptItemPipeWooden();
    BuildCraftCore.itemBptProps[pipeItemsIron.itemID] = new BptItemPipeIron();
    BuildCraftCore.itemBptProps[pipeLiquidsIron.itemID] = new BptItemPipeIron();
    BuildCraftCore.itemBptProps[pipeItemsDiamond.itemID] = new BptItemPipeDiamond();
    BuildCraftCore.itemBptProps[pipeItemsEmerald.itemID] = new BptItemPipeEmerald();

    ActionManager.registerTriggerProvider(new PipeTriggerProvider());

    if (BuildCraftCore.loadDefaultRecipes) {
      loadRecipes();
    }

    TransportProxy.proxy.registerRenderers();
    NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler());
  }
  @EventHandler
  public void preInitialize(FMLPreInitializationEvent evt) {

    aboLog.setParent(FMLLog.getLogger());
    aboLog.info(
        "Starting Additional-Buildcraft-Objects #@BUILD_NUMBER@ "
            + VERSION
            + " (Built for Minecraft @MINECRAFT_VERSION@ with Buildcraft @BUILDCRAFT_VERSION@ and Forge @FORGE_VERSION@");
    aboLog.info("Copyright (c) Flow86, 2011-2013");

    aboConfiguration =
        new ABOConfiguration(new File(evt.getModConfigurationDirectory(), "abo/main.conf"));
    try {
      aboConfiguration.load();

      itemGateSettingsDuplicator =
          createItem(
              itemGateSettingsDuplicatorID,
              ItemGateSettingsDuplicator.class,
              "Gate Settings Duplicator",
              BuildCraftCore.wrenchItem,
              BuildCraftTransport.pipeGateAutarchic,
              null);

      pipeFluidsValve =
          createPipe(
              pipeFluidsValveID,
              PipeFluidsValve.class,
              "Valve Pipe",
              1,
              BuildCraftTransport.pipeFluidsWood,
              BuildCraftTransport.pipeGateAutarchic,
              null);

      pipeFluidsGoldenIron =
          createPipe(
              pipeFluidsGoldenIronID,
              PipeFluidsGoldenIron.class,
              "Golden Iron Waterproof Pipe",
              1,
              BuildCraftTransport.pipeFluidsGold,
              BuildCraftTransport.pipeFluidsIron,
              null);

      pipeFluidsBalance =
          createPipe(
              pipeFluidsBalanceID,
              PipeFluidsBalance.class,
              "Balancing Waterproof Pipe",
              1,
              BuildCraftTransport.pipeFluidsWood,
              new ItemStack(BuildCraftEnergy.engineBlock, 1, 0),
              BuildCraftTransport.pipeFluidsWood);

      pipeFluidsDiamond =
          createPipe(
              pipeFluidsDiamondID,
              PipeFluidsDistribution.class,
              "Diamond Waterproof Pipe",
              1,
              BuildCraftTransport.pipeItemsDiamond,
              BuildCraftTransport.pipeWaterproof,
              null);

      if (GameRegistry.findItem("APUnofficial", "item.PipeFluidsWaterPump") == null) {
        pipeFluidsWaterPump =
            createPipe(
                pipeFluidsWaterPumpID,
                PipeFluidsPump.class,
                "Water Pump Pipe",
                1,
                false,
                new Object[] {
                  " L ",
                  "rPr",
                  " W ",
                  'r',
                  Item.redstone,
                  'P',
                  BuildCraftCore.ironGearItem,
                  'L',
                  BuildCraftTransport.pipeFluidsGold,
                  'W',
                  BuildCraftTransport.pipeFluidsWood
                });
      }

      pipeItemsRoundRobin =
          createPipe(
              pipeItemsRoundRobinID,
              PipeItemsRoundRobin.class,
              "RoundRobin Transport Pipe",
              1,
              BuildCraftTransport.pipeItemsStone,
              Block.gravel,
              null);

      pipeItemsCompactor =
          createPipe(
              pipeItemsCompactorID,
              PipeItemsCompactor.class,
              "Compactor Pipe",
              1,
              BuildCraftTransport.pipeItemsStone,
              Block.pistonBase,
              null);

      pipeItemsInsertion =
          createPipe(
              pipeItemsInsertionID,
              PipeItemsInsertion.class,
              "Insertion Pipe",
              1,
              BuildCraftTransport.pipeItemsIron,
              new ItemStack(Item.dyePowder, 1, 2),
              null);

      pipeItemsExtraction =
          createPipe(
              pipeItemsExtractionID,
              PipeItemsExtraction.class,
              "Extraction Transport Pipe",
              1,
              BuildCraftTransport.pipeItemsWood,
              Block.planks,
              null);

      pipeItemsBounce =
          createPipe(
              pipeItemsBounceID,
              PipeItemsBounce.class,
              "Bounce Transport Pipe",
              1,
              BuildCraftTransport.pipeItemsStone,
              Block.cobblestone,
              null);

      pipeItemsCrossover =
          createPipe(
              pipeItemsCrossoverID,
              PipeItemsCrossover.class,
              "Crossover Transport Pipe",
              1,
              BuildCraftTransport.pipeItemsStone,
              BuildCraftTransport.pipeItemsIron,
              null);

      pipeItemsStripes =
          createPipe(
              pipeItemsStripesID,
              PipeItemsStripes.class,
              "Stripes Transport Pipe",
              8,
              new ItemStack(Item.dyePowder, 1, 0),
              Block.glass,
              new ItemStack(Item.dyePowder, 1, 11));

      pipePowerSwitch =
          createPipe(
              pipePowerSwitchID,
              PipePowerSwitch.class,
              "Power Switch Pipe",
              1,
              BuildCraftTransport.pipePowerGold,
              Block.lever,
              null);

      pipePowerIron =
          createPipe(
              pipePowerIronID,
              PipePowerIron.class,
              "Iron Power Pipe",
              1,
              Item.redstone,
              BuildCraftTransport.pipeItemsIron,
              null);

      pipeDistributionConductive =
          createPipe(
              pipeDistributionConductiveID,
              PipePowerDistribution.class,
              "Distribution Conductive Pipe",
              2,
              pipePowerIron,
              BuildCraftTransport.pipeItemsDiamond,
              pipePowerIron);

      triggerEngineSafe = new TriggerEngineSafe(triggerEngineSafeID);
      actionSwitchOnPipe = new ActionSwitchOnPipe(actionSwitchOnPipeID);
      actionToggleOnPipe = new ActionToggleOnPipe(actionToggleOnPipeID);
      actionToggleOffPipe = new ActionToggleOffPipe(actionToggleOffPipeID);

      ActionManager.registerActionProvider(new ABOActionProvider());
      ActionManager.registerTriggerProvider(new ABOTriggerProvider());

      BuildCraftCore.itemBptProps[pipeItemsExtraction.itemID] = new BptItemPipeWooden();
      BuildCraftCore.itemBptProps[pipeFluidsValve.itemID] = new BptItemPipeIron();
      BuildCraftCore.itemBptProps[pipeFluidsGoldenIron.itemID] = new BptItemPipeIron();
      BuildCraftCore.itemBptProps[pipeFluidsDiamond.itemID] = new BptItemPipeDiamond();
      BuildCraftCore.itemBptProps[pipePowerIron.itemID] = new BptItemPipeIron();

      MinecraftForge.EVENT_BUS.register(this);
    } finally {
      if (aboConfiguration.hasChanged()) aboConfiguration.save();
    }
  }
  @EventHandler
  public void init(FMLInitializationEvent event) {
    NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());

    logger.info("Registering chunk load handler");
    ForgeChunkManager.setForcedChunkLoadingCallback(this, new ChunkLoadingHandler());
    chunkLoadViewer = new ChunkLoadViewDataProxy(chunkSightRange);
    FMLCommonHandler.instance().bus().register(chunkLoadViewer);

    proxy.registerKeyHandler();

    proxy.registerRendering();

    loadConfigs(true);

    logger.info("Registering pipes");
    loadPipes();

    triggerPipeClosed = new TriggerPipeClosed("APClosed");
    ActionManager.registerTriggerProvider(new GateProvider());

    if (allowWRRemove) {
      // Additional Pipes
      GameRegistry.addRecipe(
          new ItemStack(pipeItemsTeleport), new Object[] {"A", 'A', pipePowerTeleport});
      GameRegistry.addRecipe(
          new ItemStack(pipeItemsTeleport), new Object[] {"A", 'A', pipeLiquidsTeleport});
      GameRegistry.addRecipe(
          new ItemStack(pipeItemsRedStone), new Object[] {"A", 'A', pipeLiquidsRedstone});
      // BC Liquid
      GameRegistry.addRecipe(
          new ItemStack(BuildCraftTransport.pipeItemsCobblestone),
          new Object[] {"A", 'A', BuildCraftTransport.pipeFluidsCobblestone});
      GameRegistry.addRecipe(
          new ItemStack(BuildCraftTransport.pipeItemsGold),
          new Object[] {"A", 'A', BuildCraftTransport.pipeFluidsGold});
      GameRegistry.addRecipe(
          new ItemStack(BuildCraftTransport.pipeItemsIron),
          new Object[] {"A", 'A', BuildCraftTransport.pipeFluidsIron});
      GameRegistry.addRecipe(
          new ItemStack(BuildCraftTransport.pipeItemsStone),
          new Object[] {"A", 'A', BuildCraftTransport.pipeFluidsStone});
      GameRegistry.addRecipe(
          new ItemStack(BuildCraftTransport.pipeItemsWood),
          new Object[] {"A", 'A', BuildCraftTransport.pipeFluidsWood});
      // BC Power
      GameRegistry.addRecipe(
          new ItemStack(BuildCraftTransport.pipeItemsGold),
          new Object[] {"A", 'A', BuildCraftTransport.pipePowerGold});
      GameRegistry.addRecipe(
          new ItemStack(BuildCraftTransport.pipeItemsStone),
          new Object[] {"A", 'A', BuildCraftTransport.pipePowerStone});
      GameRegistry.addRecipe(
          new ItemStack(BuildCraftTransport.pipeItemsWood),
          new Object[] {"A", 'A', BuildCraftTransport.pipePowerWood});
    }

    // ChunkLoader
    blockChunkLoader = new BlockChunkLoader();
    blockChunkLoader.setBlockName("TeleportTether");
    GameRegistry.registerBlock(blockChunkLoader, ItemBlock.class, "chunkLoader");
    GameRegistry.registerTileEntity(TileChunkLoader.class, "TeleportTether");
    GameRegistry.addRecipe(
        new ItemStack(blockChunkLoader),
        new Object[] {
          "iii", "iLi", "iii", 'i', Items.iron_ingot, 'L', new ItemStack(Items.dye, 1, 4)
        });
  }