Class MinecraftExtensionImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      MinecraftExtensionImpl​(org.gradle.api.invocation.Gradle gradle, org.gradle.api.model.ObjectFactory factory, org.gradle.api.provider.ProviderFactory providers, org.gradle.api.Project project, org.gradle.api.provider.Provider<MinecraftProviderService> providerService)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.gradle.api.file.ConfigurableFileCollection accessWideners()  
      void accessWideners​(java.lang.Object... files)
      Apply access wideners to the project.
      org.gradle.api.file.DirectoryProperty assetsDirectory()  
      RunConfigurationContainer getRuns()
      Get run configurations configured for this project.
      void injectedVersion​(java.lang.Object versionFile)
      Use a version derived from a provided file.
      org.gradle.api.provider.Property<java.lang.Boolean> injectRepositories()
      Get whether repositories should be injected into the build.
      void injectRepositories​(boolean injectRepositories)
      Set whether standard repositories should be added to the project.
      java.lang.String injectVersion​(java.io.File file)
      Inject a version from the provided file
      java.lang.String injectVersion​(java.lang.String file)
      Inject a version from the provided file
      void latestRelease()
      Set the version of Minecraft used to the latest release.
      void latestSnapshot()
      Set the version of Minecraft used to the latest snapshot.
      java.util.Set<ArtifactModifier> modifiers()  
      org.gradle.api.provider.Provider<java.lang.Boolean> needsPrepareWorkspace()  
      org.gradle.api.provider.Property<MinecraftPlatform> platform()
      Get a property pointing to the Minecraft platform being prepared.
      void platform​(MinecraftPlatform platform)
      Set the platform/environment of Minecraft to prepare.
      void runs​(groovy.lang.Closure run)
      Operate on the available run configurations.
      void runs​(org.gradle.api.Action<RunConfigurationContainer> run)
      Operate on the available run configurations.
      org.gradle.api.provider.Provider<VersionDescriptor.Full> targetVersion()  
      org.gradle.api.provider.Property<java.lang.String> version()
      Get a property pointing to the version of Minecraft to prepare.
      void version​(java.lang.String version)
      Set the version of Minecraft to prepare.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MinecraftExtensionImpl

        @Inject
        public MinecraftExtensionImpl​(org.gradle.api.invocation.Gradle gradle,
                                      org.gradle.api.model.ObjectFactory factory,
                                      org.gradle.api.provider.ProviderFactory providers,
                                      org.gradle.api.Project project,
                                      org.gradle.api.provider.Provider<MinecraftProviderService> providerService)
    • Method Detail

      • injectRepositories

        public org.gradle.api.provider.Property<java.lang.Boolean> injectRepositories()
        Description copied from interface: MinecraftRepositoryExtension
        Get whether repositories should be injected into the build.

        For users who run their own proxying repositories or who want to manage repositories in another way, this property can be disabled. However, to function VanillaGradle must be able to resolve artifacts that are present in the following repositories:

        This list is subject to change in any feature release without that release being marked as "breaking".

        Specified by:
        injectRepositories in interface MinecraftRepositoryExtension
        Returns:
        the inject repositories property
      • injectVersion

        public java.lang.String injectVersion​(java.lang.String file)
        Description copied from interface: MinecraftRepositoryExtension
        Inject a version from the provided file

        This allows building against Minecraft versions that may not be available in the ordinary version list, such as combat snapshots.

        This will override whatever data may be present in the manifest repository

        Specified by:
        injectVersion in interface MinecraftRepositoryExtension
        Parameters:
        file - a path relative to the root directory
        Returns:
        the ID of the injected version
      • injectVersion

        public java.lang.String injectVersion​(java.io.File file)
        Description copied from interface: MinecraftRepositoryExtension
        Inject a version from the provided file

        This allows building against Minecraft versions that may not be available in the ordinary version list, such as combat snapshots.

        This will override whatever data may be present in the manifest repository

        Specified by:
        injectVersion in interface MinecraftRepositoryExtension
        Parameters:
        file - a file to load
        Returns:
        the ID of the injected version
      • version

        public org.gradle.api.provider.Property<java.lang.String> version()
        Description copied from interface: MinecraftExtension
        Get a property pointing to the version of Minecraft to prepare.

        Values of the property are unvalidated!

        There is no default value.

        Specified by:
        version in interface MinecraftExtension
        Returns:
        the version
      • version

        public void version​(java.lang.String version)
        Description copied from interface: MinecraftExtension
        Set the version of Minecraft to prepare.

        This version is only validated when the Minecraft development environment is prepared.

        Specified by:
        version in interface MinecraftExtension
        Parameters:
        version - the minecraft version
      • injectedVersion

        public void injectedVersion​(java.lang.Object versionFile)
        Description copied from interface: MinecraftExtension
        Use a version derived from a provided file.

        This allows building against Minecraft versions that may not be available in the ordinary version list, such as combat snapshots.

        Specified by:
        injectedVersion in interface MinecraftExtension
        Parameters:
        versionFile - a file-like object that can be handled by Project.file(Object)
      • latestRelease

        public void latestRelease()
        Description copied from interface: MinecraftExtension
        Set the version of Minecraft used to the latest release.

        This should only be used in development workspaces or for analysis tools.

        Specified by:
        latestRelease in interface MinecraftExtension
      • latestSnapshot

        public void latestSnapshot()
        Description copied from interface: MinecraftExtension
        Set the version of Minecraft used to the latest snapshot.

        This should only be used in development workspaces or for analysis tools.

        Specified by:
        latestSnapshot in interface MinecraftExtension
      • platform

        public org.gradle.api.provider.Property<MinecraftPlatform> platform()
        Description copied from interface: MinecraftExtension
        Get a property pointing to the Minecraft platform being prepared.

        Default: JOINED

        Specified by:
        platform in interface MinecraftExtension
        Returns:
        the platform property
      • accessWideners

        public void accessWideners​(java.lang.Object... files)
        Description copied from interface: MinecraftExtension
        Apply access wideners to the project.

        Access wideners can only be added before the first time a Minecraft dependency is resolved.

        Specified by:
        accessWideners in interface MinecraftExtension
        Parameters:
        files - any file that can be passed to Project.file(Object)
      • accessWideners

        public org.gradle.api.file.ConfigurableFileCollection accessWideners()
      • assetsDirectory

        public org.gradle.api.file.DirectoryProperty assetsDirectory()
      • needsPrepareWorkspace

        public org.gradle.api.provider.Provider<java.lang.Boolean> needsPrepareWorkspace()