Beispiel #1
0
  @PreInit
  public void preInit(FMLPreInitializationEvent event) {
    // Add Pre-Initialization code such as configuration loading
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());

    config.load();

    // Block ids
    blockHelloWorldId = config.getOrCreateBlockIdProperty("BlockHelloWorld", 160).getInt();
    blockFossilFuelPSActiveId =
        config.getOrCreateBlockIdProperty("BlockFossilFuelPSActive", 161).getInt();
    blockFossilFuelPSIdleId =
        config.getOrCreateBlockIdProperty("BlockFossilFuelPSIdle", 162).getInt();
    blockCableId = config.getOrCreateBlockIdProperty("BlockCable", 163).getInt();
    blockAccumulatorId = config.getOrCreateBlockIdProperty("BlockAccumulatorId", 164).getInt();

    // Renderer ids
    renderTypeCableId =
        RenderingRegistry
            .getNextAvailableRenderId(); // config.getOrCreateIntProperty("RenderTypeCable",
                                         // Configuration.CATEGORY_GENERAL, 20).getInt();

    config.save();
  }