mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fix: Don't rename extensions while the extension directory is being walked (#4197)
This commit is contained in:
parent
3fdd6b41d0
commit
3f0e366bac
1 changed files with 35 additions and 36 deletions
|
@ -43,9 +43,9 @@ import java.io.Reader;
|
|||
import java.nio.file.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class GeyserExtensionLoader extends ExtensionLoader {
|
||||
|
@ -148,8 +148,8 @@ public class GeyserExtensionLoader extends ExtensionLoader {
|
|||
Map<String, GeyserExtensionContainer> loadedExtensions = new LinkedHashMap<>();
|
||||
|
||||
Pattern[] extensionFilters = this.extensionFilters();
|
||||
try (Stream<Path> entries = Files.walk(extensionsDirectory)) {
|
||||
entries.forEach(path -> {
|
||||
List<Path> extensionPaths = Files.walk(extensionsDirectory).toList();
|
||||
extensionPaths.forEach(path -> {
|
||||
if (Files.isDirectory(path)) {
|
||||
return;
|
||||
}
|
||||
|
@ -188,7 +188,6 @@ public class GeyserExtensionLoader extends ExtensionLoader {
|
|||
GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.extensions.load.failed_with_name", path.getFileName(), path.toAbsolutePath()), e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
for (GeyserExtensionContainer container : loadedExtensions.values()) {
|
||||
this.extensionContainers.put(container.extension(), container);
|
||||
|
|
Loading…
Reference in a new issue