-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMappingUtils.java
More file actions
90 lines (79 loc) · 3.12 KB
/
MappingUtils.java
File metadata and controls
90 lines (79 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package io.github.fabriccompatibilitylayers.modremappingapi.api.v2;
import io.github.fabriccompatibiltylayers.modremappingapi.impl.MappingsUtilsImpl;
import org.jetbrains.annotations.Nullable;
public interface MappingUtils {
/**
*
* @param className original class name
* @return remapped class name
*/
static String mapClass(String contextId, String className) {
return MappingsUtilsImpl.mapClass(MappingsUtilsImpl.getMappingsRegistry(contextId), className);
}
/**
*
* @param className remapped class name
* @return original class name
*/
static String unmapClass(String contextId, String className) {
return MappingsUtilsImpl.unmapClass(MappingsUtilsImpl.getMappingsRegistry(contextId), className);
}
/**
*
* @param className original class name
* @param fieldName
* @param fieldDesc
* @return
*/
static ClassMember mapField(String contextId, String className, String fieldName, @Nullable String fieldDesc) {
return MappingsUtilsImpl.mapField(MappingsUtilsImpl.getMappingsRegistry(contextId), className, fieldName, fieldDesc);
}
/**
*
* @param className remapped class name
* @param fieldName
* @param fieldDesc
* @return
*/
static ClassMember mapFieldFromRemappedClass(String contextId, String className, String fieldName, @Nullable String fieldDesc) {
return MappingsUtilsImpl.mapFieldFromRemappedClass(MappingsUtilsImpl.getMappingsRegistry(contextId), className, fieldName, fieldDesc);
}
/**
*
* @param className original class name
* @param methodName
* @param methodDesc
* @return
*/
static ClassMember mapMethod(String contextId, String className, String methodName, String methodDesc) {
return MappingsUtilsImpl.mapMethod(MappingsUtilsImpl.getMappingsRegistry(contextId), className, methodName, methodDesc);
}
/**
*
* @param className remapped class name
* @param methodName
* @param methodDesc
* @return
*/
static ClassMember mapMethodFromRemappedClass(String contextId, String className, String methodName, String methodDesc) {
return MappingsUtilsImpl.mapMethodFromRemappedClass(MappingsUtilsImpl.getMappingsRegistry(contextId), className, methodName, methodDesc);
}
static ClassMember mapField(String contextId, Class<?> owner, String fieldName) {
return MappingsUtilsImpl.mapField(MappingsUtilsImpl.getMappingsRegistry(contextId), owner, fieldName);
}
static ClassMember mapMethod(String contextId, Class<?> owner, String methodName, Class<?>[] parameterTypes) {
return MappingsUtilsImpl.mapMethod(MappingsUtilsImpl.getMappingsRegistry(contextId), owner, methodName, parameterTypes);
}
/**
*
* @param desc original descriptor
* @return remapped descriptor
*/
static String mapDescriptor(String contextId, String desc) {
return MappingsUtilsImpl.mapDescriptor(MappingsUtilsImpl.getMappingsRegistry(contextId), desc);
}
interface ClassMember {
String getName();
@Nullable String getDesc();
}
}