Class JsonBasedScanner

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

      • JsonBasedScanner

        JsonBasedScanner()
    • Method Detail

      • getJarJson

         final JsonNode getJarJson(File file, String entryInJar, ObjectMapper objectMapper)

        Acquire a JsonNode from the specified file in the specified file.

        Parameters:
        file - The file from which to get the JsonNode from.
        entryInJar - The file in the jar from which to get the JsonNode form.
        objectMapper - The ObjectMapper with which to parse the Json to a JsonNode.
        Returns:

        A JsonNode containing all information from the requested file in the specified jar.

      • cleanupClientMods

         final Unit cleanupClientMods(ArrayList<Pair<String, Pair<String, String>>> modDependencies, TreeSet<String> clientMods)

        Remove any dependency from the list of clientside-only mods to prevent excluding dependencies of other mods, resulting in a potentially broken server pack.

        Parameters:
        modDependencies - A set of modIds of dependencies.
        clientMods - A set of modIds of clientside-only mods.
      • checkForClientModsAndDeps

         abstract Unit checkForClientModsAndDeps(Collection<File> filesInModsDir, TreeSet<String> clientMods, ArrayList<Pair<String, Pair<String, String>>> modDependencies)

        Check every file and fill the clientMods and modDependencies sets with ids of mods which are clientside-only or dependencies of a mod.

        Parameters:
        filesInModsDir - Collection of files to check.
        clientMods - Set of clientside-only mod-ids.
        modDependencies - Set dependencies of other mods.
      • getModsDelta

         abstract TreeSet<File> getModsDelta(Collection<File> filesInModsDir, TreeSet<String> clientMods)

        Get a list of mod-jars which can safely be excluded from the server pack.

        Parameters:
        filesInModsDir - A collection of files from which to exclude mods.
        clientMods - A set of modIds which are clientside-only.
        Returns:

        A set of all files from the passed collection which can safely be excluded from the server pack.