Enum Class TinyMappingFormat

java.lang.Object
java.lang.Enum<TinyMappingFormat>
net.fabricmc.lorenztiny.TinyMappingFormat
All Implemented Interfaces:
Serializable, Comparable<TinyMappingFormat>, Constable

public enum TinyMappingFormat extends Enum<TinyMappingFormat>
A helper class for working with Tiny mappings with Lorenz, in lieu of having a mapping format.
Since:
2.0.0
  • Enum Constant Details

    • TINY_2

      public static final TinyMappingFormat TINY_2
      Reads tiny mappings with new v2 ("tiny" header).
    • TINY

      public static final TinyMappingFormat TINY
      Reads tiny mappings with legacy v1 format ("v1" header).
    • DETECT

      public static final TinyMappingFormat DETECT
      Reads mappings of of any supported format.
  • Method Details

    • values

      public static TinyMappingFormat[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TinyMappingFormat valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • load

      protected abstract net.fabricmc.mappingio.tree.MappingTree load(BufferedReader reader) throws IOException
      Throws:
      IOException
    • createWriter

      public org.cadixdev.lorenz.io.MappingsWriter createWriter(Writer writer, String from, String to)
      Creates a new mappings writer for the writer supplied.

      The resulting mappings written will use the from namespace (for the obfuscated names in Lorenz) to the to namespace (for the de-obfuscated names in Lorenz).

      Parameters:
      writer - The Writer to write the mappings to
      from - The namespace to place the obfuscated names under
      to - The namespace to place the deobfuscated names under
      Returns:
      The mappings writer
      Since:
      3.0.0
    • write

      public void write(org.cadixdev.lorenz.MappingSet mappings, Path path, String from, String to) throws IOException
      Write the given mapping set to the file specified by the supplied path.

      The resulting mappings written will use the from namespace (for the obfuscated names in Lorenz) to the to namespace (for the de-obfuscated names in Lorenz).

      Parameters:
      mappings - The mappings to write
      path - The file to write the mappings to
      from - The namespace to place the obfuscated names under
      to - The namespace to place the deobfuscated names under
      Throws:
      IOException - if an I/O error occurs writing the file
      Since:
      3.0.0
    • createReader

      public org.cadixdev.lorenz.io.MappingsReader createReader(Path path, String from, String to) throws IOException
      Creates a new mappings reader for the mappings contained by the path supplied.

      The resulting mappings will use the from namespace (as the obfuscated names in Lorenz) to the to namespace (as the de-obfuscated names in Lorenz).

      Parameters:
      path - The path to the Tiny mappings
      from - The namespace to use in the tiny file, as Lorenz's obfuscated names
      to - The namespace to use in the tiny file, as Lorenz's de-obfuscated names
      Returns:
      The mappings reader
      Throws:
      IOException - if an I/O error occurs opening the file
    • read

      public org.cadixdev.lorenz.MappingSet read(org.cadixdev.lorenz.MappingSet mappings, Path path, String from, String to) throws IOException
      Reads Tiny mappings from the given path, into the given mapping set.

      The resulting mappings will use the from namespace (as the obfuscated names in Lorenz) to the to namespace (as the de-obfuscated names in Lorenz).

      Parameters:
      mappings - The mapping set to read to
      path - The path to the Tiny mappings
      from - The namespace to use in the tiny file, as Lorenz's obfuscated names
      to - The namespace to use in the tiny file, as Lorenz's de-obfuscated names
      Returns:
      The given mapping set
      Throws:
      IOException - if an I/O error occurs opening the file
    • read

      public org.cadixdev.lorenz.MappingSet read(Path path, String from, String to) throws IOException
      Reads Tiny mappings from the given path, into a new mapping set.

      The resulting mappings will use the from namespace (as the obfuscated names in Lorenz) to the to namespace (as the de-obfuscated names in Lorenz).

      Parameters:
      path - The path to the Tiny mappings
      from - The namespace to use in the tiny file, as Lorenz's obfuscated names
      to - The namespace to use in the tiny file, as Lorenz's de-obfuscated names
      Returns:
      The mapping set
      Throws:
      IOException - if an I/O error occurs opening the file