Enum Class MixinEnvironment.Feature

java.lang.Object
java.lang.Enum<MixinEnvironment.Feature>
org.spongepowered.asm.mixin.MixinEnvironment.Feature
All Implemented Interfaces:
Serializable, Comparable<MixinEnvironment.Feature>, Constable
Enclosing class:
MixinEnvironment

public static enum MixinEnvironment.Feature extends Enum<MixinEnvironment.Feature>
Mixin features which can be specified in mixin configs as required for the config to be valid. No support for backward compatibility but should help in the future to allow mixin configs to specify the features they require rather than relying purely on minVersion. Only applies to features added in version 0.8.6 and higher.
  • Enum Constant Details

    • UNSAFE_INJECTION

      public static final MixinEnvironment.Feature UNSAFE_INJECTION
      Supports the unsafe flag on @At annotations to facilitate hassle-free constructor injections.
    • INJECTORS_IN_INTERFACE_MIXINS

      public static final MixinEnvironment.Feature INJECTORS_IN_INTERFACE_MIXINS
      Support for the use of injector annotations in interface mixins
  • Method Details

    • values

      public static MixinEnvironment.Feature[] 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 MixinEnvironment.Feature 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
    • isAvailable

      public boolean isAvailable()
      Get whether this feature is available in the current runtime environment
    • isEnabled

      public boolean isEnabled()
      Get whether this feature is supported in the current environment and compatibility level
    • get

      public static MixinEnvironment.Feature get(String featureId)
      Convenience function which returns a Feature constant based on the feature id, but returns null instead of throwing an exception.
      Parameters:
      featureId - Feature ID (enum constant name) to check for
      Returns:
      Feature or null
    • exists

      public static boolean exists(String featureId)
      Check whether a particular feature exists in this mixin version, even if it's not currently available
      Parameters:
      featureId - Feature ID (enum constant name) to check for
      Returns:
      true if the feature exists
    • isActive

      public static boolean isActive(String featureId)
      Check whether a particular feature is available and enabled
      Parameters:
      featureId - Feature ID (enum constant name) to check for
      Returns:
      true if the feature is currently available