Class IntermediaryNamespaces

java.lang.Object
net.fabricmc.loom.build.IntermediaryNamespaces

public final class IntermediaryNamespaces extends Object
Contains methods for checking the (fallback/platform default) intermediary namespace of a project.

The namespace returned by methods in this class is partially wrong for obfuscated versions of Forge that use Mojang names at runtime. SRG names are still used in the toolchain, so the methods in this class are useful for those versions. The actual production namespace is available from the extension using LoomGradleExtensionAPI.getProductionNamespace().

  • Constructor Details

    • IntermediaryNamespaces

      public IntermediaryNamespaces()
  • Method Details

    • intermediary

      public static String intermediary(org.gradle.api.Project project)
      Returns the intermediary namespace of the project.
    • intermediaryNamespace

      public static MappingsNamespace intermediaryNamespace(org.gradle.api.Project project)
      Returns the intermediary namespace of the project.
    • intermediaryNamespace

      public static MappingsNamespace intermediaryNamespace(ModPlatform platform)
      Returns the intermediary namespace of the platform. This is the fallback used before the extension property is set.
    • replaceMixinIntermediaryNamespace

      public static String replaceMixinIntermediaryNamespace(org.gradle.api.Project project, String namespace)
      Potentially replaces the remapping target namespace for mixin refmaps.

      srg and mojang production namespaces are replaced by intermediary since fabric-mixin-compile-extensions only supports intermediary and official. We transform the namespaces in the input mappings, e.g. intermediary -> yraidemretni and srg -> intermediary.

      Parameters:
      project - the project
      namespace - the original namespace
      Returns:
      the correct namespace to use