From 9af6f948fe3b4cb6f2b0515d777161070718efa9 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Sun, 24 Apr 2022 12:07:50 -0500 Subject: [PATCH] Publish extensions branch --- Jenkinsfile | 1 + .../geysermc/geyser/extension/GeyserExtensionLoader.java | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 24acee78a..bcb8ffa24 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,6 +23,7 @@ pipeline { stage ('Deploy') { when { branch "master" + branch "feature/extensions" } steps { diff --git a/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionLoader.java b/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionLoader.java index 7092d1fc2..4c3c4bf11 100644 --- a/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionLoader.java +++ b/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionLoader.java @@ -61,7 +61,7 @@ public class GeyserExtensionLoader extends ExtensionLoader { private final Map classLoaders = new HashMap<>(); private final Map extensionContainers = new HashMap<>(); - public GeyserExtensionContainer loadExtension(Path path) throws InvalidExtensionException, InvalidDescriptionException { + public GeyserExtensionContainer loadExtension(Path path, GeyserExtensionDescription description) throws InvalidExtensionException, InvalidDescriptionException { if (path == null) { throw new InvalidExtensionException("Path is null"); } @@ -70,7 +70,6 @@ public class GeyserExtensionLoader extends ExtensionLoader { throw new InvalidExtensionException(new NoSuchFileException(path.toString()) + " does not exist"); } - GeyserExtensionDescription description = this.extensionDescription(path); Path parentFile = path.getParent(); Path dataFolder = parentFile.resolve(description.name()); if (Files.exists(dataFolder) && !Files.isDirectory(dataFolder)) { @@ -136,6 +135,7 @@ public class GeyserExtensionLoader extends ExtensionLoader { return; } + // noinspection ConstantConditions if (!GeyserImpl.VERSION.contains(".")) { GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.extensions.load.failed_version_number")); return; @@ -165,7 +165,7 @@ public class GeyserExtensionLoader extends ExtensionLoader { } try { - ExtensionDescription description = this.extensionDescription(path); + GeyserExtensionDescription description = this.extensionDescription(path); if (description == null) { return; } @@ -201,7 +201,7 @@ public class GeyserExtensionLoader extends ExtensionLoader { } extensions.put(name, path); - loadedExtensions.put(name, this.loadExtension(path)); + loadedExtensions.put(name, this.loadExtension(path, description)); } catch (Exception e) { GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.extensions.load.failed_with_name", path.getFileName(), path.toAbsolutePath()), e); }