public static void setup() {
    BiomeGenBase.sky =
        new BiomeGenHardcoreEnd(9).setColor(8421631).setBiomeName("Sky").setDisableRain();
    BiomeGenBase.getBiomeGenArray()[9] = BiomeGenBase.sky;

    DimensionOverride instance = new DimensionOverride();
    MinecraftForge.EVENT_BUS.register(instance);
    MinecraftForge.TERRAIN_GEN_BUS.register(instance);

    GameRegistry.registerWorldGenerator(new WorldGenStronghold(), Integer.MAX_VALUE);
  }
Esempio n. 2
0
  @Init
  public void load(FMLInitializationEvent event) {
    // This is the place where the mod starts loading

    // Set the directory
    try {
      Field minecraftDir = Loader.class.getDeclaredField("minecraftDir");
      minecraftDir.setAccessible(true);
      terrainControlDirectory =
          new File((File) minecraftDir.get(null), "mods" + File.separator + "TerrainControl");
    } catch (Throwable e) {
      terrainControlDirectory = new File("mods" + File.separator + "TerrainControl");
      System.out.println(
          "Could not reflect the Minecraft directory, save location may be unpredicatble.");
      e.printStackTrace();
    }

    // Start TerrainControl engine
    TerrainControl.supportedBlockIds = 4095;
    TerrainControl.startEngine(this);

    // Register localization
    LanguageRegistry.instance().addStringLocalization("generator.TerrainControl", "TerrainControl");

    // Register world type
    worldType = new TCWorldType(this, "TerrainControl");

    // Register listening channel for listening to received configs.
    if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
      NetworkRegistry.instance()
          .registerChannel(new PacketHandler(this), TCDefaultValues.ChannelName.stringValue());
    }

    // Register player tracker, for sending configs.
    GameRegistry.registerPlayerTracker(new PlayerTracker(this));

    // Register sapling tracker, for custom tree growth.
    SaplingListener saplingListener = new SaplingListener();
    MinecraftForge.TERRAIN_GEN_BUS.register(saplingListener);
    MinecraftForge.EVENT_BUS.register(saplingListener);

    // Register to our own events, so that they can be fired again as Forge
    // events.
    // TODO: make this optional for people who haven't installed other
    // terrain mods, and don't want to lose performance.
    TerrainControl.registerEventHandler(new EventManager(), EventPriority.CANCELABLE);
  }
Esempio n. 3
0
  public void init(FMLInitializationEvent event) {
    NetworkRegistry.INSTANCE.registerGuiHandler(Botania.instance, new GuiHandler());

    MinecraftForge.TERRAIN_GEN_BUS.register(new BiomeDecorationHandler());
    MinecraftForge.EVENT_BUS.register(ManaNetworkHandler.instance);
    MinecraftForge.EVENT_BUS.register(new PixieHandler());
    MinecraftForge.EVENT_BUS.register(new SheddingHandler());
    MinecraftForge.EVENT_BUS.register(new SpawnerChangingHandler());
    MinecraftForge.EVENT_BUS.register(new SubTileNarslimmus.SpawnIntercepter());
    MinecraftForge.EVENT_BUS.register(TileCorporeaIndex.getInputHandler());

    FMLCommonHandler.instance().bus().register(new CommonTickHandler());

    FMLInterModComms.sendMessage(
        "ProjectE", "interdictionblacklist", EntityManaBurst.class.getCanonicalName());

    if (Botania.bcTriggersLoaded) new StatementAPIPlugin();
  }
Esempio n. 4
0
 public static byte getModdedBiomeSize(WorldType worldType, byte original) {
   WorldTypeEvent.BiomeSize event = new WorldTypeEvent.BiomeSize(worldType, original);
   MinecraftForge.TERRAIN_GEN_BUS.post(event);
   return event.newSize;
 }