Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-20 15:00:11 +01:00
Check the update folder exists before trying to use it
Dieser Commit ist enthalten in:
Ursprung
d3c5961547
Commit
4106d24f2a
@ -165,27 +165,31 @@ public class GeyserExtensionLoader extends ExtensionLoader {
|
|||||||
|
|
||||||
Pattern[] extensionFilters = this.extensionFilters();
|
Pattern[] extensionFilters = this.extensionFilters();
|
||||||
|
|
||||||
List<Path> extensionUpdatePaths = Files.list(extensionsDirectory.resolve("update")).toList();
|
Path updateDirectory = extensionsDirectory.resolve("update");
|
||||||
extensionUpdatePaths.forEach(path -> {
|
if (Files.isDirectory(updateDirectory)) {
|
||||||
if (Files.isDirectory(path)) {
|
List<Path> extensionUpdatePaths = Files.list(updateDirectory).toList();
|
||||||
return;
|
extensionUpdatePaths.forEach(path -> {
|
||||||
}
|
if (Files.isDirectory(path)) {
|
||||||
|
|
||||||
for (Pattern filter : extensionFilters) {
|
|
||||||
if (!filter.matcher(path.getFileName().toString()).matches()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
for (Pattern filter : extensionFilters) {
|
||||||
// Try load the description, so we know it's a valid extension
|
if (!filter.matcher(path.getFileName().toString()).matches()) {
|
||||||
GeyserExtensionDescription description = this.extensionDescription(path);
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Files.move(path, extensionsDirectory.resolve(path.getFileName()), StandardCopyOption.REPLACE_EXISTING);
|
try {
|
||||||
} catch (Throwable e) {
|
// Try load the description, so we know it's a valid extension
|
||||||
GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.extensions.update.failed", path.getFileName()), e);
|
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();
|
List<Path> extensionPaths = Files.list(extensionsDirectory).toList();
|
||||||
extensionPaths.forEach(path -> {
|
extensionPaths.forEach(path -> {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren