public BukkitContainer() {
    super(new ModMetadata());

    /*if (MinecraftServer.getServer().getGuiEnabled())
    FMLRelaunchLog.log.getLogger().addHandler(new BukkitLogHandler());*/
    if (MinecraftServer.getServer().getGuiEnabled()) {
      ServerGUI.logger.severe(
          "BukkitForge plugins may misbehave when using the gui! Run the server with 'nogui'!");
    }
    instance = this;
    /*BukkitContainer.bukkitLogger = FMLRelaunchLog.log.getLogger();
    if (bukkitLogger == null) {
    	bukkitLogger = FMLCommonHandler.instance().getFMLLogger();
    }*/

    ModMetadata meta = this.getMetadata();
    meta.modId = "BukkitForge";
    meta.name = "Bukkit For Vanilla";
    meta.version = BukkitServer.version + ", implementing Bukkit version " + BukkitServer.apiVer;
    meta.authorList = Arrays.asList(new String[] {"keepcalm"});
    meta.description = "An implementation Bukkit API for vanilla Minecraft.";
    if (FMLCommonHandler.instance().getEffectiveSide() != Side.SERVER) {
      super.setEnabledState(false);
      meta.description = meta.description + " - \u00A74Only for dedicated servers!\u00A7r";
      // meta.modId = null;
      // meta = null;

      return;
    }

    // ystem.out.println("CONTAINER - END");

  }
示例#2
0
 @Override
 public List<String> getAdditionalBrandingInformation() {
   if (optifineContainer != null) {
     return Arrays.asList(String.format("Optifine %s", optifineContainer.getVersion()));
   } else {
     return ImmutableList.<String>of();
   }
 }
示例#3
0
  /**
   * Called to start the whole game off
   *
   * @param minecraft The minecraft instance being launched
   * @param resourcePackList The resource pack list we will populate with mods
   * @param resourceManager The resource manager
   */
  public void beginMinecraftLoading(
      Minecraft minecraft, List resourcePackList, ReloadableResourceManager resourceManager) {
    client = minecraft;
    this.resourcePackList = resourcePackList;
    this.resourceManager = resourceManager;
    this.resourcePackMap = Maps.newHashMap();
    if (minecraft.func_71355_q()) {
      FMLLog.severe("DEMO MODE DETECTED, FML will not work. Finishing now.");
      haltGame("FML will not run in demo mode", new RuntimeException());
      return;
    }

    //        TextureFXManager.instance().setClient(client);
    FMLCommonHandler.instance().beginLoading(this);
    new ModLoaderClientHelper(client);
    try {
      Class<?> optifineConfig =
          Class.forName("Config", false, Loader.instance().getModClassLoader());
      String optifineVersion = (String) optifineConfig.getField("VERSION").get(null);
      Map<String, Object> dummyOptifineMeta =
          ImmutableMap.<String, Object>builder()
              .put("name", "Optifine")
              .put("version", optifineVersion)
              .build();
      ModMetadata optifineMetadata =
          MetadataCollection.from(getClass().getResourceAsStream("optifinemod.info"), "optifine")
              .getMetadataForId("optifine", dummyOptifineMeta);
      optifineContainer = new DummyModContainer(optifineMetadata);
      FMLLog.info(
          "Forge Mod Loader has detected optifine %s, enabling compatibility features",
          optifineContainer.getVersion());
    } catch (Exception e) {
      optifineContainer = null;
    }
    try {
      Loader.instance().loadMods();
    } catch (WrongMinecraftVersionException wrong) {
      wrongMC = wrong;
    } catch (DuplicateModsFoundException dupes) {
      dupesFound = dupes;
    } catch (MissingModsException missing) {
      modsMissing = missing;
    } catch (ModSortingException sorting) {
      modSorting = sorting;
    } catch (CustomModLoadingErrorDisplayException custom) {
      FMLLog.log(
          Level.SEVERE, custom, "A custom exception was thrown by a mod, the game will now halt");
      customError = custom;
    } catch (LoaderException le) {
      haltGame(
          "There was a severe problem during mod loading that has caused the game to fail", le);
      return;
    }
  }