Package org.stianloader.sll

# Class SLLEnvironment

java.lang.Object
org.stianloader.sll.SLLEnvironment

@AvailableSince("4.0.0-a20250922") public class SLLEnvironment extends Object
Obtain metadata information about this SLL (stianloader-launcher) environment.

This mainly focuses on traits about the environment that might differ greatly between installations. Though in truth the chance of there being significant difference is low as users will in general not use their own SLL install but use whatever installation is already provided for them (i.e. through modpacks or by the game itself).

Thus the traits are largely focused on the Mixin capabilities of SLL, alongside vendor information.

Since:
  4.0.0-a20250922

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SLLEnvironment()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static @NotNull String`
  `getMixinCompiledArtifactId()`
  Obtains the artifactId of the mixin implementation this version of SLL was compiled against.
  `static @NotNull String`
  `getMixinCompiledGroupId()`
  Obtains the groupId of the mixin implementation.
  `static @NotNull String`
  `getMixinCompiledVersion()`
  Obtains the version of the mixin implementation this SLL binary was compiled against.
  `static @NotNull String`
  `getSLLArtifactId()`
  Obtains the artifactId of the SLL environment.
  `static @NotNull String`
  `getSLLGroupId()`
  Obtains the groupId of the SLL environment.
  `static @NotNull String`
  `getSLLVersion()`
  Obtains the the version string of the SLL binary used in this environment.
  `static boolean`
  `isMixinSpongelike()`
  Query whether the used Mixin implementation is similar to sponge's original Mixin implementation.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SLLEnvironment

    public SLLEnvironment()

- ## Method Details

  - ### getMixinCompiledArtifactId

    @AvailableSince("4.0.0-a20250922") @NotNull @Contract(pure=true) public static @NotNull String getMixinCompiledArtifactId()
    Obtains the artifactId of the mixin implementation this version of SLL was compiled against. This gives a good idea about what the runtime mixin implementation is based on. In practice it doesn't mean much though, but is useful information for the developer, especially as it highlights the capabilities of the mixin implementation.

    Please note that the artifactId alone does not suffice to completely distinguish mixin implementations. For example, the stianloader organisation as well as fabric both offer "sponge-mixin" under the "org.stianloader" and "net.fabricmc" groupIds respectively. Hence, artifactIds and groupIds are tightly linked together.

    Also note that it is generally possible in the java ecosystem to swap out singular classes or even entire packages or jars. As such, it is possible (albeit unlikely outside of a modular environment) that the reported data does not match the actual runtime data.

    Returns:
      The groupId of the mixin implementation the SLL environment was built against.
    Since:
      4.0.0-a20250922

  - ### getMixinCompiledGroupId

    @AvailableSince("4.0.0-a20250922") @NotNull @Contract(pure=true) public static @NotNull String getMixinCompiledGroupId()
    Obtains the groupId of the mixin implementation. This gives a good idea on who the author of the mixin implementation is, especially useful for assigning blame. In practice it only hints at who is vendoring the mixin implementation binary.

    Please note that the groupId alone does not suffice to distinguish between mixin implementations. For example, the stianloader organisation offers both "micromixin-transformer" and "sponge-mixin" under the "org.stianloader" groupId.

    Also note that it is generally possible in the java ecosystem to swap out singular classes or even entire packages or jars. As such, it is possible (albeit unlikely outside of a modular environment) that the reported data does not match the actual runtime data.

    Returns:
      The groupId of the mixin implementation the SLL environment was built against.
    Since:
      4.0.0-a20250922

  - ### getMixinCompiledVersion

    @AvailableSince("4.0.0-a20250922") @NotNull @Contract(pure=true) public static @NotNull String getMixinCompiledVersion()
    Obtains the version of the mixin implementation this SLL binary was compiled against. Note that it is generally possible in the java ecosystem to swap out singular classes or even entire packages or jars. As such, it is possible (albeit unlikely outside of a modular environment) that the reported data does not match the actual runtime data.

    Mixin implementation versions can be extremely chaotic. Sponge's Mixins and micromixin-transformer, as well as other reimplementations will more likely than not stay with a "sane" X.Y.Z release format. However, the version naming scheme of forks will be a bit chaotic by nature. For example, stianloader's mixin fork (but not micromixin-transformer) has version names such as "0.16.4-0.8.7-1-a20250906".

    Returns:
      The version string of the mixin implementation binary
    Since:
      4.0.0-a20250922

  - ### getSLLArtifactId

    @AvailableSince("4.0.0-a20250922") @NotNull @Contract(pure=true) public static @NotNull String getSLLArtifactId()
    Obtains the artifactId of the SLL environment.

    This gives a good hint as to what the SLL binary is being vendored as. It also gives a hint to the intended mixin environment. For example, the launcher binary using micromixin has the artifactId of launcher-micromixin. However finding out information about the mixin environment through that way is prone to failure in the future.

    Returns:
      SLL's artifact groupId.
    Since:
      4.0.0-a20250922

  - ### getSLLGroupId

    @AvailableSince("4.0.0-a20250922") @NotNull @Contract(pure=true) public static @NotNull String getSLLGroupId()
    Obtains the groupId of the SLL environment. This gives a good hint at who the vendor of the compiled SLL binary is.
    Returns:
      SLL's artifact groupId.
    Since:
      4.0.0-a20250922

  - ### getSLLVersion

    @AvailableSince("4.0.0-a20250922") @NotNull @Contract(pure=true) public static @NotNull String getSLLVersion()
    Obtains the the version string of the SLL binary used in this environment.

    Please note that the returned string is generally not semver-compliant. Instead, should be interpreted as a maven version string. Tools to compare such versions are provided by picoresolve (which SLL already depends on), though other libraries exist for the same result.

    Returns:
      The version string.
    Since:
      4.0.0-a20250922

  - ### isMixinSpongelike

    @AvailableSince("4.0.0-a20250922") @Contract(pure=true) public static boolean isMixinSpongelike()
    Query whether the used Mixin implementation is similar to sponge's original Mixin implementation. In other words, this method returns `true` if the mixin implementation is Mixin or a fork of Mixin, whilst it returns `false` if the implementation happens to be a rewrite of the mixin API that may or may not have been written from scratch.
    Returns:
      Whether the mixin implementation is "sponge-like", using the definitions defined above.
    Since:
      4.0.0-a20250922