mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Store file path to save on calls
This commit is contained in:
parent
23e6dbc899
commit
571e97332d
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue