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