Added "class-loader-of" field to plugin.yml. Big thanks to CmdrDats for the PR.

By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot
2012-01-15 12:54:06 +00:00
parent 77c577bdf8
commit 8377ee22f8
3 changed files with 26 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ public final class PluginDescriptionFile {
private static final Yaml yaml = new Yaml(new SafeConstructor());
private String name = null;
private String main = null;
private String classLoaderOf = null;
private ArrayList<String> depend = null;
private ArrayList<String> softDepend = null;
private String version = null;
@@ -154,6 +155,10 @@ public final class PluginDescriptionFile {
return defaultPerm;
}
public String getClassLoaderOf() {
return classLoaderOf;
}
@SuppressWarnings("unchecked")
private void loadMap(Map<String, Object> map) throws InvalidDescriptionException {
try {
@@ -195,6 +200,10 @@ public final class PluginDescriptionFile {
}
}
if (map.containsKey("class-loader-of")) {
classLoaderOf = map.get("class-loader-of").toString();
}
if (map.containsKey("depend")) {
try {
depend = (ArrayList<String>) map.get("depend");
@@ -318,6 +327,10 @@ public final class PluginDescriptionFile {
map.put("authors", authors);
}
if (classLoaderOf != null) {
map.put("class-loader-of", classLoaderOf);
}
return map;
}
}