Record Class VersionCapabilities

java.lang.Object
java.lang.Record
net.neoforged.moddevgradle.internal.utils.VersionCapabilities
Record Components:
javaVersion - Which Java version Vanilla uses to compile and run.
splitDataRuns - Whether Vanilla has separate main classes for generating client and server data.
testFixtures - If the NeoForge version for this Minecraft version supports test fixtures.
All Implemented Interfaces:
Serializable

public record VersionCapabilities(int javaVersion, boolean splitDataRuns, boolean testFixtures) extends Record implements Serializable
Models the changing capabilities of the modding platform and Vanilla, which we tie to the Minecraft version.
See Also:
  • Constructor Details

    • VersionCapabilities

      public VersionCapabilities(int javaVersion, boolean splitDataRuns, boolean testFixtures)
      Creates an instance of a VersionCapabilities record class.
      Parameters:
      javaVersion - the value for the javaVersion record component
      splitDataRuns - the value for the splitDataRuns record component
      testFixtures - the value for the testFixtures record component
  • Method Details

    • latest

      public static VersionCapabilities latest()
    • ofMinecraftVersion

      public static VersionCapabilities ofMinecraftVersion(String minecraftVersion)
    • ofVersionIndex

      public static VersionCapabilities ofVersionIndex(int versionIndex)
    • ofNeoForgeVersion

      public static VersionCapabilities ofNeoForgeVersion(String version)
    • ofNeoFormVersion

      public static VersionCapabilities ofNeoFormVersion(String version)
    • ofForgeVersion

      public static VersionCapabilities ofForgeVersion(String version)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • javaVersion

      public int javaVersion()
      Returns the value of the javaVersion record component.
      Returns:
      the value of the javaVersion record component
    • splitDataRuns

      public boolean splitDataRuns()
      Returns the value of the splitDataRuns record component.
      Returns:
      the value of the splitDataRuns record component
    • testFixtures

      public boolean testFixtures()
      Returns the value of the testFixtures record component.
      Returns:
      the value of the testFixtures record component