Package net.neoforged.neoforge.coremods
Class ReplaceFieldWithGetterAccess
java.lang.Object
net.neoforged.neoforge.coremods.ReplaceFieldWithGetterAccess
- All Implemented Interfaces:
cpw.mods.modlauncher.api.ITransformer<ClassNode>
public class ReplaceFieldWithGetterAccess
extends Object
implements cpw.mods.modlauncher.api.ITransformer<ClassNode>
Replaces direct field access in a class with access to the getter.
The field specified by fieldName must be private and non-static. The method-call the field-access is redirected to does not take any parameters and returns an object of the same type as the field. If no methodName is passed, any method matching the described signature will be used as callable method.
-
Nested Class Summary
Nested classes/interfaces inherited from interface cpw.mods.modlauncher.api.ITransformer
cpw.mods.modlauncher.api.ITransformer.Target<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from interface cpw.mods.modlauncher.api.ITransformer
DEFAULT_LABEL -
Constructor Summary
ConstructorsConstructorDescriptionReplaceFieldWithGetterAccess(String className, Map<String, String> fieldToMethod) -
Method Summary
Modifier and TypeMethodDescriptioncpw.mods.modlauncher.api.TransformerVoteResultcastVote(cpw.mods.modlauncher.api.ITransformerVotingContext context) cpw.mods.modlauncher.api.TargetType<ClassNode> private static voidredirectFieldToMethod(ClassNode classNode, String fieldName, @Nullable String methodName) targets()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cpw.mods.modlauncher.api.ITransformer
labels
-
Field Details
-
fieldToMethod
-
targets
-
-
Constructor Details
-
ReplaceFieldWithGetterAccess
-
-
Method Details
-
getTargetType
- Specified by:
getTargetTypein interfacecpw.mods.modlauncher.api.ITransformer<ClassNode>
-
targets
- Specified by:
targetsin interfacecpw.mods.modlauncher.api.ITransformer<ClassNode>
-
transform
public ClassNode transform(ClassNode input, cpw.mods.modlauncher.api.ITransformerVotingContext context) - Specified by:
transformin interfacecpw.mods.modlauncher.api.ITransformer<ClassNode>
-
castVote
public cpw.mods.modlauncher.api.TransformerVoteResult castVote(cpw.mods.modlauncher.api.ITransformerVotingContext context) - Specified by:
castVotein interfacecpw.mods.modlauncher.api.ITransformer<ClassNode>
-
redirectFieldToMethod
-