mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-26 12:05:41 +01:00
Don't expose executor and future map
This commit is contained in:
parent
248fd92f6e
commit
563c5f830d
@ -127,8 +127,7 @@ public class ProtocolRegistry {
|
||||
if (protocol.hasMappingDataToLoad()) {
|
||||
if (mappingLoaderExecutor != null) {
|
||||
// Submit mapping data loading
|
||||
CompletableFuture<Void> future = CompletableFuture.runAsync(protocol::loadMappingData, mappingLoaderExecutor);
|
||||
mappingLoaderFutures.put(protocol.getClass(), future);
|
||||
addMappingLoaderFuture(protocol.getClass(), protocol::loadMappingData);
|
||||
} else {
|
||||
// Late protocol adding - just do it on the current thread
|
||||
protocol.loadMappingData();
|
||||
@ -330,15 +329,12 @@ public class ProtocolRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
public static void addMappingLoaderFuture(Class<? extends Protocol> protocolClass, Runnable runnable) {
|
||||
CompletableFuture<Void> future = CompletableFuture.runAsync(runnable, mappingLoaderExecutor);
|
||||
mappingLoaderFutures.put(protocolClass, future);
|
||||
}
|
||||
|
||||
public static CompletableFuture<Void> getMappingLoaderFuture(Class<? extends Protocol> protocolClass) {
|
||||
return mappingLoaderFutures.get(protocolClass);
|
||||
}
|
||||
|
||||
public static Map<Class<? extends Protocol>, CompletableFuture<Void>> getMappingLoaderFutures() {
|
||||
return mappingLoaderFutures;
|
||||
}
|
||||
|
||||
public static ThreadPoolExecutor getMappingLoaderExecutor() {
|
||||
return mappingLoaderExecutor;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user