[Bleeding] Added loadbefore property; Addresses BUKKIT-843
By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
@@ -25,6 +25,7 @@ public final class PluginDescriptionFile {
|
||||
private String classLoaderOf = null;
|
||||
private List<String> depend = null;
|
||||
private List<String> softDepend = null;
|
||||
private List<String> loadBefore = null;
|
||||
private String version = null;
|
||||
private Map<String, Map<String, Object>> commands = null;
|
||||
private String description = null;
|
||||
@@ -121,6 +122,14 @@ public final class PluginDescriptionFile {
|
||||
return softDepend;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of plugins that should consider this plugin a soft-dependency
|
||||
* @return immutable list of plugins that should consider this plugin a soft-dependency
|
||||
*/
|
||||
public List<String> getLoadBefore() {
|
||||
return softDepend;
|
||||
}
|
||||
|
||||
public PluginLoadOrder getLoad() {
|
||||
return order;
|
||||
}
|
||||
@@ -267,6 +276,20 @@ public final class PluginDescriptionFile {
|
||||
softDepend = softDependBuilder.build();
|
||||
}
|
||||
|
||||
if (map.get("loadbefore") != null) {
|
||||
ImmutableList.Builder<String> loadBeforeBuilder = ImmutableList.<String>builder();
|
||||
try {
|
||||
for (Object predependency : (Iterable<?>) map.get("loadbefore")) {
|
||||
loadBeforeBuilder.add(predependency.toString());
|
||||
}
|
||||
} catch (ClassCastException ex) {
|
||||
throw new InvalidDescriptionException(ex, "loadbefore is of wrong type");
|
||||
} catch (NullPointerException ex) {
|
||||
throw new InvalidDescriptionException(ex, "invalid load-before format");
|
||||
}
|
||||
loadBefore = loadBeforeBuilder.build();
|
||||
}
|
||||
|
||||
if (map.get("database") != null) {
|
||||
try {
|
||||
database = (Boolean) map.get("database");
|
||||
|
||||
Reference in New Issue
Block a user