mirror of
https://github.com/zaaarf/lillero-mapping-writer.git
synced 2024-11-22 20:34:50 +01:00
feat: implemented TSRGWriter
This commit is contained in:
parent
4243892870
commit
1d13d08565
2 changed files with 31 additions and 1 deletions
|
@ -24,7 +24,6 @@ dependencies {
|
||||||
implementation 'ftbsc.lll:mapper:0.2.2'
|
implementation 'ftbsc.lll:mapper:0.2.2'
|
||||||
implementation 'com.google.auto.service:auto-service-annotations:1.1.0'
|
implementation 'com.google.auto.service:auto-service-annotations:1.1.0'
|
||||||
annotationProcessor 'com.google.auto.service:auto-service:1.1.0'
|
annotationProcessor 'com.google.auto.service:auto-service:1.1.0'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
|
|
31
src/main/java/ftbsc/lll/mapper/writer/impl/TSRGWriter.java
Normal file
31
src/main/java/ftbsc/lll/mapper/writer/impl/TSRGWriter.java
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
package ftbsc.lll.mapper.writer.impl;
|
||||||
|
|
||||||
|
import com.google.auto.service.AutoService;
|
||||||
|
import ftbsc.lll.mapper.IMapper;
|
||||||
|
import ftbsc.lll.mapper.writer.IWriter;
|
||||||
|
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes to TSRG, an intermediary format used by Forge.
|
||||||
|
*/
|
||||||
|
@AutoService(IWriter.class)
|
||||||
|
public class TSRGWriter implements IWriter {
|
||||||
|
@Override
|
||||||
|
public String uniqueId() {
|
||||||
|
return "tsrg";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void write(IMapper mapper, PrintWriter writer) {
|
||||||
|
writer.println("tsrg2 left right");
|
||||||
|
mapper.getRawMappings().forEach((name, data) -> {
|
||||||
|
writer.printf("%s %s\n", data.name, data.nameMapped);
|
||||||
|
data.getFields().forEach((fieldName, fieldData) ->
|
||||||
|
writer.printf("\t%s %s\n", fieldName, fieldData.nameMapped));
|
||||||
|
data.getMethods().forEach(((methodSignature, methodData) ->
|
||||||
|
writer.printf("\t%s %s %s\n", methodSignature.name,
|
||||||
|
methodSignature.descriptor, methodData.nameMapped)));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue