mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-22 02:26:00 +01:00
Reduce log-presence of the ClassNotFound error for RemovelCause on forge
This commit is contained in:
parent
db1794aa38
commit
3f634974bc
@ -24,20 +24,15 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.RemovalCause;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import org.spongepowered.configurate.ConfigurationNode;
|
||||
import org.spongepowered.configurate.gson.GsonConfigurationLoader;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
|
||||
public class BlueMap {
|
||||
|
||||
// early-loading this class, to fix a classloading issue
|
||||
private static final RemovalCause RC = null;
|
||||
|
||||
public static final String VERSION, GIT_HASH, GIT_CLEAN;
|
||||
static {
|
||||
String version = "DEV", gitHash = "DEV", gitClean = "DEV";
|
||||
@ -63,6 +58,17 @@ public class BlueMap {
|
||||
GIT_CLEAN = gitClean;
|
||||
}
|
||||
|
||||
public static final ForkJoinPool THREAD_POOL = new ForkJoinPool();
|
||||
public static final ForkJoinPool THREAD_POOL = new ForkJoinPool(
|
||||
Runtime.getRuntime().availableProcessors(),
|
||||
ForkJoinPool.defaultForkJoinWorkerThreadFactory,
|
||||
(thread, ex) -> {
|
||||
if (ex instanceof ClassNotFoundException && ex.getMessage().contains("RemovalCause")) {
|
||||
Logger.global.noFloodWarning("RemovalCauseError", ex.getMessage());
|
||||
} else {
|
||||
Logger.global.logError("Something went wrong!", ex);
|
||||
}
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user