public final class MixinEnvironment extends java.lang.Object implements ITokenProvider
| Modifier and Type | Class and Description |
|---|---|
static class |
MixinEnvironment.CompatibilityLevel
Operational compatibility level for the mixin subsystem
|
static class |
MixinEnvironment.Option
Mixin options
|
static class |
MixinEnvironment.Phase
Environment phase, deliberately not implemented as an enum
|
static class |
MixinEnvironment.Side
Represents a "side", client or dedicated server
|
| Modifier and Type | Method and Description |
|---|---|
MixinEnvironment |
addConfiguration(java.lang.String config)
Deprecated.
use Mixins::addConfiguration instead
|
void |
addTransformerExclusion(java.lang.String name)
Deprecated.
Do not use this method
|
void |
audit()
Invoke a mixin environment audit process
|
java.lang.Object |
getActiveTransformer()
Get the active mixin transformer instance (if any)
|
static MixinEnvironment.CompatibilityLevel |
getCompatibilityLevel()
Get the current compatibility level
|
static MixinEnvironment |
getCurrentEnvironment()
Gets the current environment
|
static MixinEnvironment |
getDefaultEnvironment()
Gets the default environment
|
static MixinEnvironment |
getEnvironment(MixinEnvironment.Phase phase)
Get the mixin environment for the specified phase
|
java.util.Set<java.lang.String> |
getErrorHandlerClasses()
Deprecated.
use Mixins::getErrorHandlerClasses
|
java.util.List<java.lang.String> |
getMixinConfigs()
Deprecated.
no replacement
|
java.lang.String |
getObfuscationContext()
Get the current obfuscation context
|
boolean |
getOption(MixinEnvironment.Option option)
Get the specified option from the current environment
|
<E extends java.lang.Enum<E>> |
getOption(MixinEnvironment.Option option,
E defaultValue)
Get the specified option from the current environment
|
java.lang.String |
getOptionValue(MixinEnvironment.Option option)
Get the specified option from the current environment
|
MixinEnvironment.Phase |
getPhase()
Get the phase for this environment
|
static Profiler |
getProfiler()
Get the performance profiler
|
java.lang.String |
getRefmapObfuscationContext()
Get the current obfuscation context
|
RemapperChain |
getRemappers()
Get the remapper chain for this environment
|
MixinEnvironment.Side |
getSide()
Get (and detect if necessary) the current side
|
java.lang.Integer |
getToken(java.lang.String token)
Get a token value from this environment
|
java.util.List<ITransformer> |
getTransformers()
Deprecated.
Do not use this method
|
java.lang.String |
getVersion()
Get the current mixin subsystem version
|
static void |
init(MixinEnvironment.Phase phase)
Initialise the mixin environment in the specified phase
|
MixinEnvironment |
registerTokenProvider(IEnvironmentTokenProvider provider)
Add a new token provider to this environment
|
MixinEnvironment |
registerTokenProviderClass(java.lang.String providerName)
Add a new token provider class to this environment
|
void |
setActiveTransformer(IMixinTransformer transformer)
Set the mixin transformer instance
|
static void |
setCompatibilityLevel(MixinEnvironment.CompatibilityLevel level)
Deprecated.
set compatibility level in configuration
|
void |
setObfuscationContext(java.lang.String context)
Set the obfuscation context
|
void |
setOption(MixinEnvironment.Option option,
boolean value)
Set the specified option for this environment
|
MixinEnvironment |
setSide(MixinEnvironment.Side side)
Allows a third party to set the side if the side is currently UNKNOWN
|
java.lang.String |
toString() |
public MixinEnvironment.Phase getPhase()
@Deprecated public java.util.List<java.lang.String> getMixinConfigs()
@Deprecated public MixinEnvironment addConfiguration(java.lang.String config)
config - Name of configuration resource to addpublic MixinEnvironment registerTokenProviderClass(java.lang.String providerName)
providerName - Class name of the token provider to addpublic MixinEnvironment registerTokenProvider(IEnvironmentTokenProvider provider)
provider - Token provider to addpublic java.lang.Integer getToken(java.lang.String token)
getToken in interface ITokenProvidertoken - Token to fetch@Deprecated public java.util.Set<java.lang.String> getErrorHandlerClasses()
public java.lang.Object getActiveTransformer()
public void setActiveTransformer(IMixinTransformer transformer)
transformer - Mixin Transformerpublic MixinEnvironment setSide(MixinEnvironment.Side side)
side - Side to set topublic MixinEnvironment.Side getSide()
public java.lang.String getVersion()
public boolean getOption(MixinEnvironment.Option option)
option - Option to getpublic void setOption(MixinEnvironment.Option option, boolean value)
option - Option to setvalue - New option valuepublic java.lang.String getOptionValue(MixinEnvironment.Option option)
option - Option to getpublic <E extends java.lang.Enum<E>> E getOption(MixinEnvironment.Option option, E defaultValue)
E - enum typeoption - Option to getdefaultValue - value to use if the user-defined value is invalidpublic void setObfuscationContext(java.lang.String context)
context - new contextpublic java.lang.String getObfuscationContext()
public java.lang.String getRefmapObfuscationContext()
public RemapperChain getRemappers()
public void audit()
@Deprecated public java.util.List<ITransformer> getTransformers()
@Deprecated public void addTransformerExclusion(java.lang.String name)
name - Class transformer exclusion to addpublic java.lang.String toString()
toString in class java.lang.Objectpublic static void init(MixinEnvironment.Phase phase)
phase - initial phasepublic static MixinEnvironment getEnvironment(MixinEnvironment.Phase phase)
phase - phase to fetch environment forpublic static MixinEnvironment getDefaultEnvironment()
DEFAULT environmentpublic static MixinEnvironment getCurrentEnvironment()
public static MixinEnvironment.CompatibilityLevel getCompatibilityLevel()
@Deprecated public static void setCompatibilityLevel(MixinEnvironment.CompatibilityLevel level) throws java.lang.IllegalArgumentException
level - Level to set, ignored if less than the current leveljava.lang.IllegalArgumentException - if the specified level is not supportedpublic static Profiler getProfiler()