Skip to content

Commit 6f849ad

Browse files
committed
Fix "Decompile Inner Classes" Vineflower option
1 parent 6ef733a commit 6f849ad

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

enigma/src/main/java/org/quiltmc/enigma/impl/source/vineflower/EnigmaContextSource.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.quiltmc.enigma.impl.source.vineflower;
22

3+
import org.jetbrains.java.decompiler.main.extern.IFernflowerPreferences;
34
import org.quiltmc.enigma.api.class_provider.ClassProvider;
45
import org.quiltmc.enigma.util.AsmUtil;
56
import org.jetbrains.java.decompiler.main.extern.IContextSource;
@@ -11,6 +12,7 @@
1112
import java.util.ArrayList;
1213
import java.util.Collections;
1314
import java.util.List;
15+
import java.util.Map;
1416

1517
public class EnigmaContextSource implements IContextSource {
1618
private final IContextSource external = new ExternalContextSource();
@@ -40,7 +42,12 @@ private void collectClassNames() {
4042
this.classNames = new ArrayList<>();
4143
String root = this.name.contains("$") ? this.name.substring(0, this.name.indexOf("$")) : this.name;
4244
this.classNames.add(root);
43-
this.classNames.addAll(this.classProvider.getClasses(root).stream().filter(s -> s.contains("$")).toList());
45+
46+
Map<String, Object> options = VineflowerPreferences.getEffectiveOptions();
47+
if (!options.containsKey(IFernflowerPreferences.DECOMPILE_INNER)
48+
|| "1".equals(options.get(IFernflowerPreferences.DECOMPILE_INNER))) {
49+
this.classNames.addAll(this.classProvider.getClasses(root).stream().filter(s -> s.contains("$")).toList());
50+
}
4451
}
4552

4653
@Override

0 commit comments

Comments
 (0)