Use default exception handler again

This commit is contained in:
Lukas Rieger (Blue) 2022-06-01 12:59:18 +02:00
parent 79a12d4d80
commit b28b4e8c1f
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2

View File

@ -63,17 +63,12 @@ public class BlueMap {
Runtime.getRuntime().availableProcessors(),
pool -> {
ForkJoinWorkerThread thread = ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool);
thread.setContextClassLoader(BlueMap.class.getClassLoader()); // use plugin-intended classloader
thread.setName("BlueMap-FJ-" + thread.getPoolIndex());
// use current classloader, this fixes ClassLoading issues with forge
thread.setContextClassLoader(BlueMap.class.getClassLoader());
thread.setName("BlueMap-FJP-" + thread.getPoolIndex());
return thread;
},
(thread, ex) -> {
if (ex instanceof ClassNotFoundException && ex.getMessage().contains("RemovalCause")) {
Logger.global.noFloodWarning("RemovalCauseError", ex.getMessage());
} else {
Logger.global.logError("Something went wrong!", ex);
}
},
null,
false
);