mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-05 22:16:10 +01:00
Fix stacktrace deobf when running as a bundler jar
This commit is contained in:
parent
9809c9e47b
commit
6e9e17aec1
1 changed files with 11 additions and 1 deletions
|
@ -326,6 +326,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
+import it.unimi.dsi.fastutil.ints.IntList;
|
||||
+import java.io.IOException;
|
||||
+import java.io.InputStream;
|
||||
+import java.util.Collections;
|
||||
+import java.util.HashMap;
|
||||
+import java.util.LinkedHashMap;
|
||||
|
@ -465,7 +466,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ };
|
||||
+ try {
|
||||
+ final ClassReader reader = new ClassReader(key.getName());
|
||||
+ final @Nullable InputStream inputStream = StacktraceDeobfuscator.class.getClassLoader()
|
||||
+ .getResourceAsStream(key.getName().replace('.', '/') + ".class");
|
||||
+ if (inputStream == null) {
|
||||
+ throw new IllegalStateException("Could not find class file: " + key.getName());
|
||||
+ }
|
||||
+ final byte[] classData;
|
||||
+ try (inputStream) {
|
||||
+ classData = inputStream.readAllBytes();
|
||||
+ }
|
||||
+ final ClassReader reader = new ClassReader(classData);
|
||||
+ reader.accept(classVisitor, 0);
|
||||
+ } catch (final IOException ex) {
|
||||
+ throw new RuntimeException(ex);
|
||||
|
|
Loading…
Add table
Reference in a new issue