Package org.spongepowered.asm.mixin
Enum Class MixinEnvironment.Feature
- All Implemented Interfaces:
Serializable,Comparable<MixinEnvironment.Feature>,Constable
- Enclosing class:
MixinEnvironment
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSupport for the use of injector annotations in interface mixinsSupports the unsafe flag on @At annotations to facilitate hassle-free constructor injections. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck whether a particular feature exists in this mixin version, even if it's not currently availablestatic MixinEnvironment.FeatureConvenience function which returns a Feature constant based on the feature id, but returns null instead of throwing an exception.static booleanCheck whether a particular feature is available and enabledbooleanGet whether this feature is available in the current runtime environmentbooleanGet whether this feature is supported in the current environment and compatibility levelstatic MixinEnvironment.FeatureReturns the enum constant of this class with the specified name.static MixinEnvironment.Feature[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNSAFE_INJECTION
Supports the unsafe flag on @At annotations to facilitate hassle-free constructor injections. -
INJECTORS_IN_INTERFACE_MIXINS
Support for the use of injector annotations in interface mixins
-
-
Method Details
-
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
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 nameNullPointerException- 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
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
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
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
-