-
Notifications
You must be signed in to change notification settings - Fork 100
Matcher
When using Locator patches, you need to use the Matcher class to specify where in the game you want a patch to be inserted. Javassist can match many different types of expressions and ModTheSpire provides a Matcher for each type.
Matches: type cast expressions, i.e. Dog myDog = (Dog) myAnimal
Constructor:
-
String typeNamethe name of the class that the type cast is casting to
Matches: constructor call, i.e. super() or this()
Constructor:
-
Class<?> clazzthe Class type of the the class that the constructor is calling -
String methodName(optional) the name of the method being called, eithersuperorthis
Or:
-
String classNamethe name of the class that the constructor is calling -
String methodName(optional) the name of the method being called, eithersuperorthis
Matches: field access expressions, i.e. myObject.myField
Constructor:
-
Class<?> clazzthe Class type of the the class that is having its field accessed -
String fieldNamethe name of the field being accessed
Or:
-
String classNamethe name of the class that is having its field accessed -
String fieldNamethe name of the field being accessed
Matches: catch clauses, i.e. catch (SomethingException e) {// do stuff}
Constructor:
-
Class<?> exceptionTypethe Class type of the class of exception that is being caught -
boolean isFinallyif this matches acatchorfinallyclause
Or:
-
String exceptionTypethe name of the class of exception that is being caught -
boolean isFinallyif this matches acatchorfinallyclause
Matches: instanceof expressions, i.e. myObject instanceof Animal
Constructor:
-
Class<?> clazzthe Class type the type that we're checking if the object is an instance of
Or:
-
String comparedToTypethe name of the type that we're checking if the object is an instance of
Matches: method calls, i.e. myObject.doAThing()
Constructor:
-
Class<?> clazzthe Class type of the class of the object this method is being called on -
String methodNamethe name of the method that is being called
Or:
-
String classNamethe name of the class of the object this method is being called on -
String methodNamethe name of the method that is being called
Matches: new array expressions, i.e. myArray = new int[3]
Constructor:
-
Class<?> clazzthe Class type of the class that is the type of the array
Or:
-
String classNamethe name of the class that is the type of the array
Matches: new expressions, i.e. new Object()
Constructor:
-
Class<?> clazzthe Class type of the class that is being constructed
Or:
-
String classNamethe name of the class that is being constructed