Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-20 15:00:11 +01:00
Store file path to save on calls
Dieser Commit ist enthalten in:
Ursprung
23e6dbc899
Commit
571e97332d
@ -169,7 +169,7 @@ public class GeyserExtensionLoader extends ExtensionLoader {
|
|||||||
List<Path> extensionPaths;
|
List<Path> extensionPaths;
|
||||||
if (Files.isDirectory(updateDirectory)) {
|
if (Files.isDirectory(updateDirectory)) {
|
||||||
// Get the current extensions and store them in a map
|
// Get the current extensions and store them in a map
|
||||||
Map<String, String> extensionFiles = new HashMap<>();
|
Map<String, Path> extensionFiles = new HashMap<>();
|
||||||
extensionPaths = Files.list(extensionsDirectory).toList();
|
extensionPaths = Files.list(extensionsDirectory).toList();
|
||||||
extensionPaths.forEach(path -> {
|
extensionPaths.forEach(path -> {
|
||||||
if (Files.isDirectory(path)) {
|
if (Files.isDirectory(path)) {
|
||||||
@ -188,7 +188,7 @@ public class GeyserExtensionLoader extends ExtensionLoader {
|
|||||||
GeyserExtensionDescription description = this.extensionDescription(path);
|
GeyserExtensionDescription description = this.extensionDescription(path);
|
||||||
|
|
||||||
// Store the file name against ID for later use
|
// Store the file name against ID for later use
|
||||||
extensionFiles.put(description.id(), path.getFileName().toString());
|
extensionFiles.put(description.id(), path.getFileName());
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
@ -214,7 +214,7 @@ public class GeyserExtensionLoader extends ExtensionLoader {
|
|||||||
|
|
||||||
// Remove the old extension with the same ID if it exists
|
// Remove the old extension with the same ID if it exists
|
||||||
if (extensionFiles.containsKey(description.id())) {
|
if (extensionFiles.containsKey(description.id())) {
|
||||||
Files.delete(extensionsDirectory.resolve(extensionFiles.get(description.id())));
|
Files.delete(extensionFiles.get(description.id()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overwrite the extension with the new jar
|
// Overwrite the extension with the new jar
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren