示例#1
0
  @Override
  public void bindMetadata(MetadataCollection mc) {
    modMetadata = mc.getMetadataForId(getModId(), descriptor);

    if (descriptor.containsKey("useMetadata")) {
      overridesMetadata = !((Boolean) descriptor.get("useMetadata")).booleanValue();
    }

    if (overridesMetadata || !modMetadata.useDependencyInformation) {
      Set<ArtifactVersion> requirements = Sets.newHashSet();
      List<ArtifactVersion> dependencies = Lists.newArrayList();
      List<ArtifactVersion> dependants = Lists.newArrayList();
      annotationDependencies = (String) descriptor.get("dependencies");
      Loader.instance()
          .computeDependencies(annotationDependencies, requirements, dependencies, dependants);
      modMetadata.requiredMods = requirements;
      modMetadata.dependencies = dependencies;
      modMetadata.dependants = dependants;
      FMLLog.finest("Parsed dependency info : %s %s %s", requirements, dependencies, dependants);
    } else {
      FMLLog.finest(
          "Using mcmod dependency info : %s %s %s",
          modMetadata.requiredMods, modMetadata.dependencies, modMetadata.dependants);
    }
    if (Strings.isNullOrEmpty(modMetadata.name)) {
      FMLLog.info(
          "Mod %s is missing the required element 'name'. Substituting %s", getModId(), getModId());
      modMetadata.name = getModId();
    }
    internalVersion = (String) descriptor.get("version");
    if (Strings.isNullOrEmpty(internalVersion)) {
      Properties versionProps = searchForVersionProperties();
      if (versionProps != null) {
        internalVersion = versionProps.getProperty(getModId() + ".version");
        FMLLog.fine(
            "Found version %s for mod %s in version.properties, using",
            internalVersion, getModId());
      }
    }
    if (Strings.isNullOrEmpty(internalVersion) && !Strings.isNullOrEmpty(modMetadata.version)) {
      FMLLog.warning(
          "Mod %s is missing the required element 'version' and a version.properties file could not be found. Falling back to metadata version %s",
          getModId(), modMetadata.version);
      internalVersion = modMetadata.version;
    }
    if (Strings.isNullOrEmpty(internalVersion)) {
      FMLLog.warning(
          "Mod %s is missing the required element 'version' and no fallback can be found. Substituting '1.0'.",
          getModId());
      modMetadata.version = internalVersion = "1.0";
    }

    String mcVersionString = (String) descriptor.get("acceptedMinecraftVersions");
    if (!Strings.isNullOrEmpty(mcVersionString)) {
      minecraftAccepted = VersionParser.parseRange(mcVersionString);
    } else {
      minecraftAccepted = Loader.instance().getMinecraftModContainer().getStaticVersionRange();
    }
  }
示例#2
0
 public static void setModMetadata(String id, String name, ModMetadata metadata, String parent) {
   metadata.modId = id;
   metadata.name = name;
   metadata.description =
       "ICBM is a Minecraft Mod that introduces intercontinental ballistic missiles to Minecraft. But the fun doesn't end there! This mod also features many different explosives, missiles and machines classified in three different tiers. If strategic warfare, carefully coordinated airstrikes, messing with matter and general destruction are up your alley, then this mod is for you!";
   metadata.url = "http://www.calclavia.com/icbm/";
   metadata.logoFile = "/icbm_logo.png";
   metadata.version = Reference.VERSION;
   metadata.authorList = Arrays.asList(new String[] {"Calclavia"});
   metadata.parent = parent;
   metadata.credits = "Please visit the website.";
   metadata.autogenerated = false;
 }
 public DummyContainerGasesFramework() {
   super(new ModMetadata());
   ModMetadata meta = getMetadata();
   meta.modId = "gasesFrameworkCore";
   meta.name = "Gases Framework Core";
   meta.version = GasesFramework.version;
   meta.description = "Adds core functionality for mods based on the Gases Framework.";
   meta.authorList = Arrays.asList("Glenn");
   meta.url = "http://www.minecraftforum.net/topic/1890587-/";
   meta.screenshots = new String[0];
   meta.parent = "gasesFramework";
 }
  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");

  }
示例#5
0
 @Override
 public Map<String, String> getSharedModDescriptor() {
   Map<String, String> descriptor = Maps.newHashMap();
   descriptor.put("modsystem", "FML");
   descriptor.put("id", getModId());
   descriptor.put("version", getDisplayVersion());
   descriptor.put("name", getName());
   descriptor.put("url", modMetadata.url);
   descriptor.put("authors", modMetadata.getAuthorList());
   descriptor.put("description", modMetadata.description);
   return descriptor;
 }
 public ScriptModContainer(TocManager.TableofContents toc, File source, IScriptingCore core) {
   ModMetadata META = new ModMetadata();
   META.authorList.add(toc.getAuthor());
   META.autogenerated = true;
   META.credits = "";
   META.description = "Fake mod container generated by the INpureCore script engine.";
   META.modId = toc.getTitle();
   META.name = toc.getTitle();
   META.parent = modInfo.modid;
   META.parentMod = FMLCommonHandler.instance().findContainerFor(INpureCore.instance);
   META.version = toc.getVersion();
   try {
     // Stupid private fields.
     Field f = this.getClass().getSuperclass().getDeclaredField("md");
     f.setAccessible(true);
     f.set(this, META);
   } catch (Throwable t) {
     t.printStackTrace();
   }
   this.source = source;
   this.core = core;
 }
示例#7
0
 @Override
 public String getSortingRules() {
   return ((overridesMetadata || !modMetadata.useDependencyInformation)
       ? Strings.nullToEmpty(annotationDependencies)
       : modMetadata.printableSortingRules());
 }
 public FMLDummyContainer() {
   super(new ModMetadata());
   ModMetadata meta = getMetadata();
   meta.modId = "FML";
   meta.name = "Forge Mod Loader";
   meta.version = Loader.instance().getFMLVersionString();
   meta.credits = "Made possible with help from many people";
   meta.authorList = Arrays.asList("cpw, LexManos");
   meta.description =
       "The Forge Mod Loader provides the ability for systems to load mods "
           + "from the file system. It also provides key capabilities for mods to be able "
           + "to cooperate and provide a good modding environment. "
           + "The mod loading system is compatible with ModLoader, all your ModLoader "
           + "mods should work.";
   meta.url = "https://github.com/MinecraftForge/FML/wiki";
   meta.updateUrl = "https://github.com/MinecraftForge/FML/wiki";
   meta.screenshots = new String[0];
   meta.logoFile = "";
 }