mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-21 05:42:15 +00:00
Search for method mappings in superclasses during AP run, closes #33
This commit is contained in:
1 parent
a012596e98
commit
fae89c3eb7
3 files changed
+55
-3
No files matched your search
@@ -167,13 +167,26 @@ public class MemberInfo {
|
||||
*
|
||||
* @param methodData MethodData object to copy values from
|
||||
*/
|
||||
public MemberInfo(MethodData methodData) {
|
||||
private MemberInfo(MethodData methodData) {
|
||||
int slashPos = methodData.name.lastIndexOf('/');
|
||||
this.owner = methodData.name.substring(0, slashPos);
|
||||
this.name = methodData.name.substring(slashPos + 1);
|
||||
this.desc = methodData.sig;
|
||||
this.matchAll = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise a remapped MemberInfo using the supplied MethodData object
|
||||
*
|
||||
* @param methodData MethodData object to copy values from
|
||||
*/
|
||||
private MemberInfo(MemberInfo remapped, MethodData methodData, boolean setOwner) {
|
||||
int slashPos = methodData.name.lastIndexOf('/');
|
||||
this.owner = setOwner ? methodData.name.substring(0, slashPos) : remapped.owner;
|
||||
this.name = methodData.name.substring(slashPos + 1);
|
||||
this.desc = remapped.desc;
|
||||
this.matchAll = false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
@@ -305,6 +318,17 @@ public class MemberInfo {
|
||||
&& (ordinal == 0 || this.matchAll);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a remapped version of this member using the supplied method data
|
||||
*
|
||||
* @param methodData Method data to use
|
||||
* @param setOwner True to set the owner as well as the name
|
||||
* @return New MethodInfo with remapped values
|
||||
*/
|
||||
public MemberInfo remapUsing(MethodData methodData, boolean setOwner) {
|
||||
return new MemberInfo(this, methodData, setOwner);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a MemberInfo from a string
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user