3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-10-03 16:31:14 +02:00

Check the update folder exists before trying to use it

Dieser Commit ist enthalten in:
rtm516 2024-08-02 16:07:04 +01:00
Ursprung d3c5961547
Commit 4106d24f2a
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 331715B8B007C67A

Datei anzeigen

@ -165,7 +165,9 @@ public class GeyserExtensionLoader extends ExtensionLoader {
Pattern[] extensionFilters = this.extensionFilters();
List<Path> extensionUpdatePaths = Files.list(extensionsDirectory.resolve("update")).toList();
Path updateDirectory = extensionsDirectory.resolve("update");
if (Files.isDirectory(updateDirectory)) {
List<Path> extensionUpdatePaths = Files.list(updateDirectory).toList();
extensionUpdatePaths.forEach(path -> {
if (Files.isDirectory(path)) {
return;
@ -181,11 +183,13 @@ public class GeyserExtensionLoader extends ExtensionLoader {
// Try load the description, so we know it's a valid extension
GeyserExtensionDescription description = this.extensionDescription(path);
// Overwrite the extension with the new jar
Files.move(path, extensionsDirectory.resolve(path.getFileName()), StandardCopyOption.REPLACE_EXISTING);
} catch (Throwable e) {
GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.extensions.update.failed", path.getFileName()), e);
}
});
}
List<Path> extensionPaths = Files.list(extensionsDirectory).toList();
extensionPaths.forEach(path -> {