summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-08-27 09:54:36 +0200
committer zaaarf <zaaarf@proton.me>2023-08-27 09:54:36 +0200
commitffbcdaeee10d72ba8a65aa1458d538a3c26fdd2a (patch)
treed7405c1d884cdcd22aa893a866620c2bdb8b39f2 /src
parentbbea72ed47ccde96a4200382e4ea67e277cd5378 (diff)
feat: added type descriptor support0.1.0
Diffstat (limited to 'src')
-rw-r--r--src/main/java/ftbsc/lll/mapper/writer/impl/TinyV2Writer.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/ftbsc/lll/mapper/writer/impl/TinyV2Writer.java b/src/main/java/ftbsc/lll/mapper/writer/impl/TinyV2Writer.java
index 8dc955c..981ea2f 100644
--- a/src/main/java/ftbsc/lll/mapper/writer/impl/TinyV2Writer.java
+++ b/src/main/java/ftbsc/lll/mapper/writer/impl/TinyV2Writer.java
@@ -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)));