Class RemappingReferenceMapper
java.lang.Object
org.spongepowered.asm.mixin.refmap.RemappingReferenceMapper
- All Implemented Interfaces:
IClassReferenceMapper
,IReferenceMapper
public final class RemappingReferenceMapper
extends Object
implements IClassReferenceMapper, IReferenceMapper
This adapter is designed to apply the same remapping used elsewhere in
the development chain (RemapperChain) to reference maps.
-
Method Summary
Modifier and TypeMethodDescriptionGet the current contextGet the resource name this refmap was loaded from (if available).Get a user-readable "status" string for this refmap for use in error messagesboolean
Get whether this mapper is defaulted.static IReferenceMapper
of
(MixinEnvironment env, IReferenceMapper refMap) Wrap the specified refmap in a remapping adapter using settings in the supplied environmentRemap a reference for the specified owning class in the current contextremapClassName
(String className, String inputClassName) remapClassNameWithContext
(String context, String className, String remapped) remapWithContext
(String context, String className, String reference) Remap a reference for the specified owning class in the specified contextvoid
setContext
(String context) Set the current remap context, can be null
-
Method Details
-
isDefault
public boolean isDefault()Description copied from interface:IReferenceMapper
Get whether this mapper is defaulted. Use this flag rather than reference comparison toReferenceMapper.DEFAULT_MAPPER
because of classloader shenanigans- Specified by:
isDefault
in interfaceIReferenceMapper
- Returns:
- true if this mapper is a defaulted mapper
-
getResourceName
Description copied from interface:IReferenceMapper
Get the resource name this refmap was loaded from (if available).- Specified by:
getResourceName
in interfaceIReferenceMapper
- Returns:
- name of the resource
-
getStatus
Description copied from interface:IReferenceMapper
Get a user-readable "status" string for this refmap for use in error messages- Specified by:
getStatus
in interfaceIReferenceMapper
- Returns:
- status message
-
getContext
Description copied from interface:IReferenceMapper
Get the current context- Specified by:
getContext
in interfaceIReferenceMapper
- Returns:
- current context key, can be null
-
setContext
Description copied from interface:IReferenceMapper
Set the current remap context, can be null- Specified by:
setContext
in interfaceIReferenceMapper
- Parameters:
context
- remap context
-
remap
Description copied from interface:IReferenceMapper
Remap a reference for the specified owning class in the current context- Specified by:
remap
in interfaceIReferenceMapper
- Parameters:
className
- Owner classreference
- Reference to remap- Returns:
- remapped reference, returns original reference if not remapped
-
remapWithContext
Description copied from interface:IReferenceMapper
Remap a reference for the specified owning class in the specified context- Specified by:
remapWithContext
in interfaceIReferenceMapper
- Parameters:
context
- Remap context to useclassName
- Owner classreference
- Reference to remap- Returns:
- remapped reference, returns original reference if not remapped
-
of
Wrap the specified refmap in a remapping adapter using settings in the supplied environment- Parameters:
env
- environment to read configuration fromrefMap
- refmap to wrap- Returns:
- wrapped refmap or original refmap is srg data is not available
-
remapClassName
- Specified by:
remapClassName
in interfaceIClassReferenceMapper
-
remapClassNameWithContext
- Specified by:
remapClassNameWithContext
in interfaceIClassReferenceMapper
-