Record Class VersionCapabilitiesInternal

java.lang.Object
java.lang.Record
net.neoforged.moddevgradle.internal.utils.VersionCapabilitiesInternal
Record Components:
minecraftVersion - The Minecraft version.
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, VersionCapabilities

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

    • VersionCapabilitiesInternal

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

    • latest

      public static VersionCapabilitiesInternal latest()
    • ofMinecraftVersion

      public static VersionCapabilitiesInternal ofMinecraftVersion(String minecraftVersion)
    • ofVersionIndex

      public static VersionCapabilitiesInternal ofVersionIndex(int versionIndex)
    • ofVersionIndex

      public static VersionCapabilitiesInternal ofVersionIndex(int versionIndex, String minecraftVersion)
    • ofNeoForgeVersion

      public static VersionCapabilitiesInternal ofNeoForgeVersion(String version)
    • ofNeoFormVersion

      public static VersionCapabilitiesInternal ofNeoFormVersion(String version)
    • ofForgeVersion

      public static VersionCapabilitiesInternal ofForgeVersion(String version)
    • withMinecraftVersion

      public VersionCapabilitiesInternal withMinecraftVersion(String minecraftVersion)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • minecraftVersion

      public String minecraftVersion()
      Returns the value of the minecraftVersion record component.
      Returns:
      the value of the minecraftVersion record component
    • javaVersion

      public int javaVersion()
      Returns the value of the javaVersion record component.
      Specified by:
      javaVersion in interface VersionCapabilities
      Returns:
      the value of the javaVersion record component
    • splitDataRuns

      public boolean splitDataRuns()
      Returns the value of the splitDataRuns record component.
      Specified by:
      splitDataRuns in interface VersionCapabilities
      Returns:
      the value of the splitDataRuns record component
    • testFixtures

      public boolean testFixtures()
      Returns the value of the testFixtures record component.
      Specified by:
      testFixtures in interface VersionCapabilities
      Returns:
      the value of the testFixtures record component
    • modLocatorRework

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