Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 08:30:09 +01:00
Uncap mapping loader executor pool, less logging
Dieser Commit ist enthalten in:
Ursprung
1157029f23
Commit
bf4e4d771f
@ -68,7 +68,9 @@ public class MappingDataBase implements MappingData {
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
getLogger().info("Loading " + oldVersion + " -> " + newVersion + " mappings...");
|
||||
if (Via.getManager().isDebug()) {
|
||||
getLogger().info("Loading " + oldVersion + " -> " + newVersion + " mappings...");
|
||||
}
|
||||
JsonObject diffmapping = hasDiffFile ? loadDiffFile() : null;
|
||||
JsonObject oldMappings = MappingDataLoader.loadData("mapping-" + oldVersion + ".json", true);
|
||||
JsonObject newMappings = MappingDataLoader.loadData("mapping-" + newVersion + ".json", true);
|
||||
|
@ -87,9 +87,11 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaPlatform<Player>
|
||||
protocolSupport = Bukkit.getPluginManager().getPlugin("ProtocolSupport") != null;
|
||||
lateBind = !((BukkitViaInjector) Via.getManager().getInjector()).isBinded();
|
||||
|
||||
getLogger().info("ViaVersion " + getDescription().getVersion() + " is now loaded" + (lateBind ? ", waiting for boot. (late-bind)" : ", injecting!"));
|
||||
if (!lateBind) {
|
||||
getLogger().info("ViaVersion " + getDescription().getVersion() + " is now loaded. Registering protocol transformers and injecting...");
|
||||
((ViaManagerImpl) Via.getManager()).init();
|
||||
} else {
|
||||
getLogger().info("ViaVersion " + getDescription().getVersion() + " is now loaded. Waiting for boot (late-bind).");
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,6 +107,7 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaPlatform<Player>
|
||||
@Override
|
||||
public void onEnable() {
|
||||
if (lateBind) {
|
||||
getLogger().info("Registering protocol transformers and injecting...");
|
||||
((ViaManagerImpl) Via.getManager()).init();
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ public class ProtocolManagerImpl implements ProtocolManager {
|
||||
|
||||
public ProtocolManagerImpl() {
|
||||
ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("Via-Mappingloader-%d").build();
|
||||
mappingLoaderExecutor = new ThreadPoolExecutor(5, 16, 45L, TimeUnit.SECONDS, new SynchronousQueue<>(), threadFactory);
|
||||
mappingLoaderExecutor = new ThreadPoolExecutor(12, Integer.MAX_VALUE, 30L, TimeUnit.SECONDS, new SynchronousQueue<>(), threadFactory);
|
||||
mappingLoaderExecutor.allowCoreThreadTimeOut(true);
|
||||
}
|
||||
|
||||
@ -434,7 +434,9 @@ public class ProtocolManagerImpl implements ProtocolManager {
|
||||
public boolean checkForMappingCompletion() {
|
||||
mappingLoaderLock.readLock().lock();
|
||||
try {
|
||||
if (mappingsLoaded) return false;
|
||||
if (mappingsLoaded) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (CompletableFuture<Void> future : mappingLoaderFutures.values()) {
|
||||
// Return if any future hasn't completed yet
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren