mirror of
https://github.com/zaaarf/lillero-mapping-writer.git
synced 2024-11-13 00:49:21 +01:00
feat: added type descriptor support
This commit is contained in:
parent
bbea72ed47
commit
ffbcdaeee1
2 changed files with 5 additions and 2 deletions
|
@ -21,7 +21,7 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
implementation 'commons-cli:commons-cli:1.5.0'
|
||||
implementation 'ftbsc.lll:mapper:0.2.2'
|
||||
implementation 'ftbsc.lll:mapper:0.2.3'
|
||||
implementation 'com.google.auto.service:auto-service-annotations:1.1.0'
|
||||
annotationProcessor 'com.google.auto.service:auto-service:1.1.0'
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import ftbsc.lll.mapper.IMapper;
|
|||
import ftbsc.lll.mapper.writer.IWriter;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* An {@link IWriter} that writes in the Tiny v2 format.
|
||||
|
@ -22,7 +23,9 @@ public class TinyV2Writer implements IWriter {
|
|||
mapper.getRawMappings().forEach((name, data) -> {
|
||||
writer.printf("c\t%s\t%s\n", name, data.nameMapped);
|
||||
data.getFields().forEach((fieldName, fieldData) ->
|
||||
writer.printf("\tf\t?\t%s\t%s\n", fieldName, fieldData.nameMapped)); //TODO field descriptors
|
||||
writer.printf("\tf\t%s\t%s\t%s\n",
|
||||
Optional.ofNullable(fieldData.descriptor).orElse("?"),
|
||||
fieldName, fieldData.nameMapped));
|
||||
data.getMethods().forEach(((methodSignature, methodData) ->
|
||||
writer.printf("\tm\t%s\t%s\t%s\n", methodSignature.descriptor,
|
||||
methodSignature.name, methodData.nameMapped)));
|
||||
|
|
Loading…
Reference in a new issue