Package org.stianloader.micromixin.transform.api

## Enum MixinVendor

- java.lang.Object
- - java.lang.Enum<MixinVendor>
  - - org.stianloader.micromixin.transform.api.MixinVendor

All Implemented Interfaces:
  `java.io.Serializable`, `java.lang.Comparable<MixinVendor>`

    @AvailableSince("0.6.5-a20240912")
    public enum MixinVendor
    extends java.lang.Enum<MixinVendor>

An enumeration storing vendors of a mixin transformation API, with whom micromixin-transformer can try to establish compatibility in selected subsystems.

Keep note that micromixin-transformer cannot establish compatibility with future releases, nor will it guarantee compatibility with past releases. Further, please be aware that micromixin-transformer cannot replicate the behaviour of every implementation up to the smallest detail. Doing so would simply take too long to implement. Henceforth, when relying on a vendor compatibility, users are advised to test it in all environments where usage is expected (which may include micromixin-transformer as well as other implementations, such as the spongeian mixin implementation).

Note: The `Enum.ordinal()` of this class is not considered part of public ABI. Different versions (even minor versions) might have different ordinals. As such, the ordinal of this enumeration should never be used for serialisation, unless it is known ahead of time that the library version is the same between encoder and decoder.

Since:
  0.6.5-a20240912

### Enum Constant Summary

Enum Constants
`FABRIC` The Mixin implementation maintained by FabricMC, this version is a fork of Sponge's Mixin implementation defined by `SPONGE`.
`MICROMIXIN` The micromixin suite, developed under the stianloader banner.
`SPONGE` The Mixin implementation by SpongePowered (or short, Sponge).

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `isSpongeLike()` Check whether the current `MixinVendor` instance (`this`) is a mixin implementation derived from the spongeian mixin implementation.
`static boolean` `isSpongeLike​(MixinVendor vendor)` Check whether the provided `MixinVendor` instance is a mixin implementation derived from the spongeian mixin implementation.
`static MixinVendor` `valueOf​(java.lang.String name)` Returns the enum constant of this type with the specified name.
`static MixinVendor[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

`getClass, notify, notifyAll, wait, wait, wait`

### Enum Constant Detail

#### FABRIC

    @AvailableSince("0.9.0-a20260503")
    public static final MixinVendor FABRIC

The Mixin implementation maintained by FabricMC, this version is a fork of Sponge's Mixin implementation defined by `SPONGE`.

Like with `SPONGE`, micromixin-transformer treats MixinExtras to be a part of the mixin implementation itself, even though in reality that is not the case. That being said, most mixin runtimes will have both the core mixin engine as well as MixinExtras available. Even when the environment does not provide MixinExtras out of the box, it usually is possible to add MixinExtras manually as a plugin (that being said, micromixin-transformer does not support plugins at all as of writing).

Since:
  0.9.0-a20260503

#### MICROMIXIN

    @AvailableSince("0.6.5-a20240912")
    public static final MixinVendor MICROMIXIN

The micromixin suite, developed under the stianloader banner. This specifically means behaviour that is specific to micromixin-transformer, this only includes behaviour that was written intentionally different compared to mainstream mixin implementations as well as behaviour unintentionally differing to the mainstream mixin implementations, but these differences being deemed to be useful or intuitive. Accidental differences deemed useless or even negative are almost guaranteed to be removed at some point and this entry does not exist to reactivate those differences.

Micromixin is a mixin implementation that was written from scratch, it is unlikely to support the full breadth of mixin. Micromixin supports some MixinExtras features.

Since:
  0.6.5-a20240912

#### SPONGE

    @AvailableSince("0.6.5-a20240912")
    public static final MixinVendor SPONGE

The Mixin implementation by SpongePowered (or short, Sponge). This is deemed to original mixin implementation and is used by miromixin-transformer as the reference implementation. This means that micromixin-transformer tries to apply the behaviour of Sponge's mixin implementation as the default implementation.

While from a technical perspective the spongeian implementation does not support MixinExtras features, micromixin-transformer treats MixinExtras as part of the spongeian implementation as in almost all cases both systems will be used alongside each other (even though MixinExtras can be used alongside the Fabric mixin implementation).

Since:
  0.6.5-a20240911
See Also:
  `The fabric vendor mode is more standard as it is more internally consistent and has fewer bugs. Meanwhile, sponge's implementation has been left unmaintained for a longer amount of time, making it potentially unattractive to consumers as reported bugs are unlikely to get fixed within reasonable time, if at all.`

### Method Detail

#### values

    public static MixinVendor[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

    for (MixinVendor c : MixinVendor.values())
        System.out.println(c);

Returns:
  an array containing the constants of this enum type, in the order they are declared

#### valueOf

    public static MixinVendor valueOf​(java.lang.String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
  `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
  `java.lang.NullPointerException` - if the argument is null

#### isSpongeLike

    @AvailableSince("0.9.0-a20260503")
    @Contract(pure=true,
              value="null -> false; !null -> _")
    public static boolean isSpongeLike​(@Nullable
                                       MixinVendor vendor)

Check whether the provided `MixinVendor` instance is a mixin implementation derived from the spongeian mixin implementation.

Specifically, this method returns `true` for `FABRIC` and `SPONGE`, and returns `false` for more esoteric implementations such as `MICROMIXIN`.

If the provided instance is `null`, then `false` shall be returned. This method exists as a convenience method

Parameters:
  `vendor` - The `MixinVendor` instance to test against. May be `null`.
Returns:
  `true` if the mixin vendor is sponge-derived, `false` if otherwise.
Since:
  0.9.0-a20260503

#### isSpongeLike

    @AvailableSince("0.9.0-a20260503")
    public boolean isSpongeLike()

Check whether the current `MixinVendor` instance (`this`) is a mixin implementation derived from the spongeian mixin implementation.

Specifically, this method returns `true` for `FABRIC` and `SPONGE`, and returns `false` for more esoteric implementations such as `MICROMIXIN`.

Returns:
  `true` if the mixin vendor is sponge-derived, `false` if otherwise.
Since:
  0.9.0-a20260503