Skip to content

Commit a18845e

Browse files
committed
Closes #11
1 parent 2feb6e8 commit a18845e

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ modrinth {
124124
token = System.getenv("MODRINTH_TOKEN")
125125
projectId = "mod-remapping-api"
126126
changelog = """
127-
Improve method name propagation.\\
128-
Add method to map descriptors.\\
129-
Fix method mapping on partial descriptors not working anymore.
127+
Fix mod mappings being inverted on Babric
130128
"""
131129
uploadFile = remapJar
132130

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ org.gradle.jvmargs=-Xmx1G
1212
spasm_version=0.2
1313

1414
# Mod Properties
15-
mod_version = 1.22.0
15+
mod_version = 1.22.1
1616
maven_group = io.github.fabriccompatibiltylayers
1717
archives_base_name = mod-remapping-api

src/main/java/fr/catcore/modremapperapi/remapping/RemapUtil.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package fr.catcore.modremapperapi.remapping;
22

3-
import fr.catcore.modremapperapi.ModRemappingAPI;
43
import fr.catcore.modremapperapi.utils.Constants;
54
import fr.catcore.modremapperapi.utils.FileUtils;
65
import fr.catcore.modremapperapi.utils.MappingsUtils;
@@ -36,9 +35,7 @@ public class RemapUtil {
3635
private static List<ModRemapper> remappers;
3736
private static MappingTree LOADER_TREE;
3837
private static MappingTree MINECRAFT_TREE;
39-
private static MappingTree MODS_TREE;
40-
41-
private static final MappingList MOD_MAPPINGS = new MappingList();
38+
private static MemoryMappingTree MODS_TREE;
4239

4340
protected static final Map<String, List<String>> MIXINED = new HashMap<>();
4441

@@ -71,6 +68,13 @@ public static void init(List<io.github.fabriccompatibiltylayers.modremappingapi.
7168
MC_CLASS_NAMES.add(className);
7269
}
7370
}
71+
72+
try {
73+
MODS_TREE = new MemoryMappingTree();
74+
MappingsUtilsImpl.initializeMappingTree(MODS_TREE);
75+
} catch (IOException e) {
76+
throw new RuntimeException(e);
77+
}
7478
}
7579

7680
private static void downloadRemappingLibs() {
@@ -166,28 +170,23 @@ public static List<String> makeModMappings(Path modPath) {
166170
}
167171
}
168172

169-
classes.forEach(cl -> MOD_MAPPINGS.add(cl, (cl.contains("/") ? "" : defaultPackage) + cl));
173+
io.github.fabriccompatibiltylayers.modremappingapi.api.v1.MappingBuilder mappingBuilder = new MappingBuilderImpl(MODS_TREE);
174+
175+
classes.forEach(cl -> mappingBuilder.addMapping(cl, (cl.contains("/") ? "" : defaultPackage) + cl));
170176

171177
return files;
172178
}
173179

174180
public static void generateModMappings() {
175-
MemoryMappingTree mappingTree = new MemoryMappingTree();
176-
177181
try {
178-
MappingsUtilsImpl.initializeMappingTree(mappingTree);
179-
180-
MOD_MAPPINGS.accept(mappingTree);
181-
182-
mappingTree.visitEnd();
182+
MODS_TREE.visitEnd();
183183

184184
MappingWriter writer = MappingWriter.create(Constants.REMAPPED_MAPPINGS_FILE.toPath(), MappingFormat.TINY_2_FILE);
185-
mappingTree.accept(writer);
185+
MODS_TREE.accept(writer);
186186
} catch (IOException e) {
187187
throw new RuntimeException("Error while generating mods mappings", e);
188188
}
189189

190-
MODS_TREE = mappingTree;
191190
MappingsUtilsImpl.addMappingsToContext(MODS_TREE);
192191
}
193192

0 commit comments

Comments
 (0)