diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/translation/mapping')
| -rw-r--r-- | src/main/java/cuchaz/enigma/translation/mapping/EntryRemapper.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/cuchaz/enigma/translation/mapping/EntryRemapper.java b/src/main/java/cuchaz/enigma/translation/mapping/EntryRemapper.java index 8c4a326..c9808cc 100644 --- a/src/main/java/cuchaz/enigma/translation/mapping/EntryRemapper.java +++ b/src/main/java/cuchaz/enigma/translation/mapping/EntryRemapper.java | |||
| @@ -21,7 +21,7 @@ public class EntryRemapper { | |||
| 21 | 21 | ||
| 22 | private final MappingValidator validator; | 22 | private final MappingValidator validator; |
| 23 | 23 | ||
| 24 | public EntryRemapper(JarIndex jarIndex, EntryTree<EntryMapping> obfToDeobf) { | 24 | private EntryRemapper(JarIndex jarIndex, EntryTree<EntryMapping> obfToDeobf) { |
| 25 | this.obfToDeobf = new DeltaTrackingTree<>(obfToDeobf); | 25 | this.obfToDeobf = new DeltaTrackingTree<>(obfToDeobf); |
| 26 | 26 | ||
| 27 | this.obfResolver = jarIndex.getEntryResolver(); | 27 | this.obfResolver = jarIndex.getEntryResolver(); |
| @@ -31,8 +31,12 @@ public class EntryRemapper { | |||
| 31 | this.validator = new MappingValidator(obfToDeobf, deobfuscator, jarIndex); | 31 | this.validator = new MappingValidator(obfToDeobf, deobfuscator, jarIndex); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | public EntryRemapper(JarIndex jarIndex) { | 34 | public static EntryRemapper mapped(JarIndex index, EntryTree<EntryMapping> obfToDeobf) { |
| 35 | this(jarIndex, new HashEntryTree<>()); | 35 | return new EntryRemapper(index, obfToDeobf); |
| 36 | } | ||
| 37 | |||
| 38 | public static EntryRemapper empty(JarIndex index) { | ||
| 39 | return new EntryRemapper(index, new HashEntryTree<>()); | ||
| 36 | } | 40 | } |
| 37 | 41 | ||
| 38 | public <E extends Entry<?>> void mapFromObf(E obfuscatedEntry, @Nullable EntryMapping deobfMapping) { | 42 | public <E extends Entry<?>> void mapFromObf(E obfuscatedEntry, @Nullable EntryMapping deobfMapping) { |