Class BundlerMetadata


  • @Immutable
    public abstract class BundlerMetadata
    extends java.lang.Object
    • Constructor Detail

      • BundlerMetadata

        public BundlerMetadata()
    • Method Detail

      • read

        public static java.util.Optional<BundlerMetadata> read​(java.nio.file.Path jar)
                                                        throws java.io.IOException
        Attempt to read bundler metadata from a jar.

        If the jar is not a Minecraft bundler jar, an empty Optional will be returned.

        Parameters:
        jar - the jar to read
        Returns:
        parsed metadata
        Throws:
        java.io.IOException - if an error occurs while trying to read from the jar
      • read

        public static java.util.Optional<BundlerMetadata> read​(java.util.jar.JarFile file)
                                                        throws java.io.IOException
        Attempt to read bundler metadata from a jar.

        If the jar is not a Minecraft bundler jar, an empty Optional will be returned.

        Parameters:
        file - the jar to read
        Returns:
        parsed metadata
        Throws:
        java.io.IOException - if an error occurs while trying to read from the jar
      • version

        @Parameter
        public abstract FormatVersion version()
        The bundler format used by this jar.

        While VanillaGradle only knows about versions that existed at the time of its release, we will attempt to read future versions as well.

        Returns:
        the format version
      • libraries

        @Parameter
        public abstract java.util.Set<BundleElement> libraries()
        Libraries packed in the jar as dependencies for the server.
        Returns:
        the library elements
      • server

        @Parameter
        public abstract BundleElement server()
        Get a bundle element describing the server itself.
        Returns:
        an index entry describing the server
      • mainClass

        @Parameter
        public abstract @Nullable java.lang.String mainClass()
        The main class to execute.
        Returns:
        the main class