Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-10-08 10:50:11 +02:00
Publish extensions branch
Dieser Commit ist enthalten in:
Ursprung
f2e606c0f3
Commit
9af6f948fe
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@ -23,6 +23,7 @@ pipeline {
|
|||||||
stage ('Deploy') {
|
stage ('Deploy') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "master"
|
||||||
|
branch "feature/extensions"
|
||||||
}
|
}
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
|
@ -61,7 +61,7 @@ public class GeyserExtensionLoader extends ExtensionLoader {
|
|||||||
private final Map<String, GeyserExtensionClassLoader> classLoaders = new HashMap<>();
|
private final Map<String, GeyserExtensionClassLoader> classLoaders = new HashMap<>();
|
||||||
private final Map<Extension, GeyserExtensionContainer> extensionContainers = new HashMap<>();
|
private final Map<Extension, GeyserExtensionContainer> extensionContainers = new HashMap<>();
|
||||||
|
|
||||||
public GeyserExtensionContainer loadExtension(Path path) throws InvalidExtensionException, InvalidDescriptionException {
|
public GeyserExtensionContainer loadExtension(Path path, GeyserExtensionDescription description) throws InvalidExtensionException, InvalidDescriptionException {
|
||||||
if (path == null) {
|
if (path == null) {
|
||||||
throw new InvalidExtensionException("Path is 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");
|
throw new InvalidExtensionException(new NoSuchFileException(path.toString()) + " does not exist");
|
||||||
}
|
}
|
||||||
|
|
||||||
GeyserExtensionDescription description = this.extensionDescription(path);
|
|
||||||
Path parentFile = path.getParent();
|
Path parentFile = path.getParent();
|
||||||
Path dataFolder = parentFile.resolve(description.name());
|
Path dataFolder = parentFile.resolve(description.name());
|
||||||
if (Files.exists(dataFolder) && !Files.isDirectory(dataFolder)) {
|
if (Files.exists(dataFolder) && !Files.isDirectory(dataFolder)) {
|
||||||
@ -136,6 +135,7 @@ public class GeyserExtensionLoader extends ExtensionLoader {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// noinspection ConstantConditions
|
||||||
if (!GeyserImpl.VERSION.contains(".")) {
|
if (!GeyserImpl.VERSION.contains(".")) {
|
||||||
GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.extensions.load.failed_version_number"));
|
GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.extensions.load.failed_version_number"));
|
||||||
return;
|
return;
|
||||||
@ -165,7 +165,7 @@ public class GeyserExtensionLoader extends ExtensionLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ExtensionDescription description = this.extensionDescription(path);
|
GeyserExtensionDescription description = this.extensionDescription(path);
|
||||||
if (description == null) {
|
if (description == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -201,7 +201,7 @@ public class GeyserExtensionLoader extends ExtensionLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extensions.put(name, path);
|
extensions.put(name, path);
|
||||||
loadedExtensions.put(name, this.loadExtension(path));
|
loadedExtensions.put(name, this.loadExtension(path, description));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.extensions.load.failed_with_name", path.getFileName(), path.toAbsolutePath()), e);
|
GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.extensions.load.failed_with_name", path.getFileName(), path.toAbsolutePath()), e);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren