-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMappingUtils.java
More file actions
98 lines (85 loc) · 3.06 KB
/
MappingUtils.java
File metadata and controls
98 lines (85 loc) · 3.06 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
91
92
93
94
95
96
97
98
package io.github.fabriccompatibiltylayers.modremappingapi.api.v1;
import io.github.fabriccompatibiltylayers.modremappingapi.impl.MappingsUtilsImpl;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface MappingUtils {
/**
*
* @param className original class name
* @return remapped class name
*/
static String mapClass(String className) {
return MappingsUtilsImpl.mapClass(MappingsUtilsImpl.getV1Registry(), className);
}
/**
*
* @param className remapped class name
* @return original class name
*/
static String unmapClass(String className) {
return MappingsUtilsImpl.unmapClass(MappingsUtilsImpl.getV1Registry(), className);
}
/**
*
* @param className original class name
* @param fieldName
* @param fieldDesc
* @return
*/
static ClassMember mapField(String className, String fieldName, @Nullable String fieldDesc) {
return MappingsUtilsImpl.mapField(MappingsUtilsImpl.getV1Registry(), className, fieldName, fieldDesc);
}
/**
*
* @param className remapped class name
* @param fieldName
* @param fieldDesc
* @return
*/
static ClassMember mapFieldFromRemappedClass(String className, String fieldName, @Nullable String fieldDesc) {
return MappingsUtilsImpl.mapFieldFromRemappedClass(MappingsUtilsImpl.getV1Registry(), className, fieldName, fieldDesc);
}
/**
*
* @param className original class name
* @param methodName
* @param methodDesc
* @return
*/
static ClassMember mapMethod(String className, String methodName, String methodDesc) {
return MappingsUtilsImpl.mapMethod(MappingsUtilsImpl.getV1Registry(), className, methodName, methodDesc);
}
/**
*
* @param className remapped class name
* @param methodName
* @param methodDesc
* @return
*/
static ClassMember mapMethodFromRemappedClass(String className, String methodName, String methodDesc) {
return MappingsUtilsImpl.mapMethodFromRemappedClass(MappingsUtilsImpl.getV1Registry(), className, methodName, methodDesc);
}
static ClassMember mapField(Class<?> owner, String fieldName) {
return MappingsUtilsImpl.mapField(MappingsUtilsImpl.getV1Registry(), owner, fieldName);
}
static ClassMember mapMethod(Class<?> owner, String methodName, Class<?>[] parameterTypes) {
return MappingsUtilsImpl.mapMethod(MappingsUtilsImpl.getV1Registry(), owner, methodName, parameterTypes);
}
/**
*
* @param desc original descriptor
* @return remapped descriptor
*/
static String mapDescriptor(String desc) {
return MappingsUtilsImpl.mapDescriptor(MappingsUtilsImpl.getV1Registry(), desc);
}
class ClassMember {
public final @NotNull String name;
public final @Nullable String desc;
public ClassMember(@NotNull String name, @Nullable String desc) {
assert name != null;
this.name = name;
this.desc = desc;
}
}
}