Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-20 15:00:11 +01:00
Add extension update folder
Dieser Commit ist enthalten in:
Ursprung
3d7e62a408
Commit
d3c5961547
@ -164,7 +164,30 @@ public class GeyserExtensionLoader extends ExtensionLoader {
|
|||||||
Map<String, GeyserExtensionContainer> loadedExtensions = new LinkedHashMap<>();
|
Map<String, GeyserExtensionContainer> loadedExtensions = new LinkedHashMap<>();
|
||||||
|
|
||||||
Pattern[] extensionFilters = this.extensionFilters();
|
Pattern[] extensionFilters = this.extensionFilters();
|
||||||
List<Path> extensionPaths = Files.walk(extensionsDirectory).toList();
|
|
||||||
|
List<Path> extensionUpdatePaths = Files.list(extensionsDirectory.resolve("update")).toList();
|
||||||
|
extensionUpdatePaths.forEach(path -> {
|
||||||
|
if (Files.isDirectory(path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Pattern filter : extensionFilters) {
|
||||||
|
if (!filter.matcher(path.getFileName().toString()).matches()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Try load the description, so we know it's a valid extension
|
||||||
|
GeyserExtensionDescription description = this.extensionDescription(path);
|
||||||
|
|
||||||
|
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 -> {
|
extensionPaths.forEach(path -> {
|
||||||
if (Files.isDirectory(path)) {
|
if (Files.isDirectory(path)) {
|
||||||
return;
|
return;
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 60b20023a92f084aba895ab0336e70fa7fb311fb
|
Subproject commit 8c4b92445bf48f7104f9ab1708efdd3b6acf1f2c
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren