mirror of
https://github.com/FalsePattern/FalsePatternLib.git
synced 2026-11-17 00:35:10 +00:00
Start implementing the ASM helpers
This commit is contained in:
7 files changed
+204
No files matched your search
@@ -74,6 +74,17 @@ public class MappingManager {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean containsClass(NameType nameType, MappingType mappingType, String className) {
|
||||
switch (nameType) {
|
||||
case Internal:
|
||||
return internalLookup.containsKey(mappingType, className);
|
||||
case Regular:
|
||||
return regularLookup.containsKey(mappingType, className);
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid enum value " + nameType);
|
||||
}
|
||||
}
|
||||
|
||||
public static UniversalField getField(FieldInsnNode instruction) throws ClassNotFoundException,
|
||||
NoSuchFieldException {
|
||||
if (!CoreLoadingPlugin.isObfuscated()) {
|
||||
|
||||
@@ -24,6 +24,19 @@ public class Lookup<T> {
|
||||
return values.contains(value);
|
||||
}
|
||||
|
||||
public boolean containsKey(MappingType mappingType, String key) {
|
||||
switch (mappingType) {
|
||||
case Notch:
|
||||
return notch.containsKey(key);
|
||||
case SRG:
|
||||
return srg.containsKey(key);
|
||||
case MCP:
|
||||
return mcp.containsKey(key);
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid enum value " + mappingType);
|
||||
}
|
||||
}
|
||||
|
||||
public void unwrap(@NonNull MappedString mappedString, @NonNull T value) {
|
||||
if (contains(value)) {
|
||||
//Collision avoidance.
|
||||
|
||||
Reference in new issue
Block a user