From 6ec42321a36bb44f71ca27a52c774a8dee21ef08 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 26 Aug 2023 23:20:06 +0200 Subject: feat: heavily reworked api to provide data instead of names --- src/main/java/ftbsc/lll/mapper/tools/MappingUtils.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main/java/ftbsc/lll/mapper/tools/MappingUtils.java') diff --git a/src/main/java/ftbsc/lll/mapper/tools/MappingUtils.java b/src/main/java/ftbsc/lll/mapper/tools/MappingUtils.java index c8d76af..fcc5525 100644 --- a/src/main/java/ftbsc/lll/mapper/tools/MappingUtils.java +++ b/src/main/java/ftbsc/lll/mapper/tools/MappingUtils.java @@ -15,7 +15,7 @@ public class MappingUtils { * Maps a method descriptor, replacing its class references with their mapped counterparts. * @param descriptor a {@link String} containing the descriptor * @param mapper the {@link IMapper} to use for the process - * @param reverse whether it should deobfuscate rather than obfuscate + * @param reverse if true it uses the inverted mapper rather than the normal one * @return the mapped descriptor */ public static String mapMethodDescriptor(String descriptor, IMapper mapper, boolean reverse) { @@ -34,8 +34,8 @@ public class MappingUtils { * Given a {@link Type} and a valid {@link IMapper} it returns its mapped counterpart. * @param type the type in question * @param mapper the {@link IMapper} to use for the process - * @param reverse whether it should deobfuscate rather than obfuscate - * @return the obfuscated type + * @param reverse if true it uses the inverted mapper rather than the normal one + * @return the mapped type */ public static Type mapType(Type type, IMapper mapper, boolean reverse) { //unwrap arrays @@ -55,8 +55,8 @@ public class MappingUtils { String internalNameMapped; try { internalNameMapped = reverse - ? mapper.deobfuscateClass(internalName) - : mapper.obfuscateClass(internalName); + ? mapper.getInverted().getClassData(internalName).nameMapped + : mapper.getClassData(internalName).nameMapped; return Type.getType(DescriptorBuilder.nameToDescriptor(internalNameMapped, arrayLevel)); } catch(MappingNotFoundException e) { return type; -- cgit v1.2.3-56-ga3b1