Class ForgeMappingsMerger

java.lang.Object
dev.architectury.loom.mappings.ForgeMappingsMerger

public final class ForgeMappingsMerger extends Object
Merges a Tiny file with a new namespace.
  • Method Details

    • merge

      public net.fabricmc.mappingio.tree.MemoryMappingTree merge() throws IOException
      Throws:
      IOException
    • mergeSrg

      public static net.fabricmc.mappingio.tree.MemoryMappingTree mergeSrg(Path srg, Path tiny, @Nullable ForgeMappingsMerger.ExtraMappings extraMappings, boolean lenient) throws IOException, MappingException
      Merges SRG mappings with a tiny mappings tree through the obf names. This overload returns a MemoryMappingTree of the merged mappings.

      The namespaces in the tiny file should be official, intermediary, named. The SRG names will add a new namespace called srg so that the final namespaces are official, srg, intermediary, named.

      This method does not include local variables in the output. It can, however, be used for remapping the game jar since it has all classes, methods, fields, parameters and javadoc comments.

      If lenient is true, the merger will not error when encountering names not present in the tiny mappings. Instead, the names will be filled from the official namespace.

      Parameters:
      srg - the SRG file in .tsrg format
      tiny - the tiny file
      extraMappings - an extra mappings file that will be used to determine whether an unobfuscated name is needed in the result file
      lenient - whether lenient mode is enabled
      Returns:
      the merged mapping tree
      Throws:
      IOException - if an IO error occurs while reading the mappings
      MappingException - if the input tiny mappings' namespaces are incorrect or if an element mentioned in the SRG file does not have tiny mappings in non-lenient mode
    • mergeMojang

      public static net.fabricmc.mappingio.tree.MemoryMappingTree mergeMojang(MappingContext context, Path tiny, @Nullable ForgeMappingsMerger.ExtraMappings extraMappings, boolean lenient) throws IOException, MappingException
      Throws:
      IOException
      MappingException