mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-09 01:47:54 +01:00
General style alignment
This commit is contained in:
parent
5adbbd8c45
commit
79a8f4bd93
@ -95,6 +95,7 @@ public final class DiscoveredExtension {
|
||||
extension.name = extension.loadStatus.name();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!extension.name.matches(NAME_REGEX)) {
|
||||
LOGGER.error("Extension '{}' specified an invalid name.", extension.name);
|
||||
LOGGER.error("Extension '{}' will not be loaded.", extension.name);
|
||||
@ -104,6 +105,7 @@ public final class DiscoveredExtension {
|
||||
extension.name = extension.loadStatus.name();
|
||||
return;
|
||||
}
|
||||
|
||||
if (extension.entrypoint == null) {
|
||||
LOGGER.error("Extension '{}' did not specify an entry point (via 'entrypoint').", extension.name);
|
||||
LOGGER.error("Extension '{}' will not be loaded.", extension.name);
|
||||
@ -113,6 +115,7 @@ public final class DiscoveredExtension {
|
||||
extension.entrypoint = extension.loadStatus.name();
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle defaults
|
||||
// If we reach this code, then the extension will most likely be loaded:
|
||||
if (extension.version == null) {
|
||||
@ -120,19 +123,24 @@ public final class DiscoveredExtension {
|
||||
LOGGER.warn("Extension '{}' will continue to load but should specify a plugin version.", extension.name);
|
||||
extension.version = "Unspecified";
|
||||
}
|
||||
|
||||
if (extension.mixinConfig == null) {
|
||||
extension.mixinConfig = "";
|
||||
}
|
||||
|
||||
if (extension.authors == null) {
|
||||
extension.authors = new String[0];
|
||||
}
|
||||
|
||||
if (extension.codeModifiers == null) {
|
||||
extension.codeModifiers = new String[0];
|
||||
}
|
||||
|
||||
// No dependencies were specified
|
||||
if (extension.dependencies == null) {
|
||||
extension.dependencies = new String[0];
|
||||
}
|
||||
|
||||
// No external dependencies were specified;
|
||||
if (extension.externalDependencies == null) {
|
||||
extension.externalDependencies = new ExternalDependencies();
|
||||
@ -177,11 +185,11 @@ public final class DiscoveredExtension {
|
||||
}
|
||||
}
|
||||
|
||||
static final class ExternalDependencies {
|
||||
public static final class ExternalDependencies {
|
||||
Repository[] repositories = new Repository[0];
|
||||
String[] artifacts = new String[0];
|
||||
|
||||
static class Repository {
|
||||
public static class Repository {
|
||||
String name = "";
|
||||
String url = "";
|
||||
}
|
||||
|
@ -735,7 +735,7 @@ public class ExtensionManager {
|
||||
*/
|
||||
public static void loadCodeModifiersEarly() {
|
||||
// allow users to disable early code modifier load
|
||||
if("true".equalsIgnoreCase(System.getProperty(DISABLE_EARLY_LOAD_SYSTEM_KEY))) {
|
||||
if ("true".equalsIgnoreCase(System.getProperty(DISABLE_EARLY_LOAD_SYSTEM_KEY))) {
|
||||
return;
|
||||
}
|
||||
LOGGER.info("Early load of code modifiers from extensions.");
|
||||
@ -765,8 +765,8 @@ public class ExtensionManager {
|
||||
public void unloadAllExtensions() {
|
||||
// copy names, as the extensions map will be modified via the calls to unload
|
||||
Set<String> extensionNames = new HashSet<>(extensions.keySet());
|
||||
for(String ext : extensionNames) {
|
||||
if(extensions.containsKey(ext)) { // is still loaded? Because extensions can depend on one another, it might have already been unloaded
|
||||
for (String ext : extensionNames) {
|
||||
if (extensions.containsKey(ext)) { // is still loaded? Because extensions can depend on one another, it might have already been unloaded
|
||||
unloadExtension(ext);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user