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:
Ursprung
d3c5961547
Commit
4106d24f2a
@ -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 -> {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren