summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2017-12-28 20:29:58 +1100
committermd_5 <git@md-5.net>2017-12-28 20:29:58 +1100
commit20971610daa5cbe1685ac9ba0fa93525e7158048 (patch)
treedd29ea7ffbf05865c668b0fa763562508430a20f
parentc29791a82d9350af40164b501f6ca26d00e2ccba (diff)
downloadbukkit-20971610daa5cbe1685ac9ba0fa93525e7158048.tar
bukkit-20971610daa5cbe1685ac9ba0fa93525e7158048.tar.gz
bukkit-20971610daa5cbe1685ac9ba0fa93525e7158048.tar.lz
bukkit-20971610daa5cbe1685ac9ba0fa93525e7158048.tar.xz
bukkit-20971610daa5cbe1685ac9ba0fa93525e7158048.zip
SPIGOT-3721: Plugins without manifests no longer load
-rw-r--r--src/main/java/org/bukkit/plugin/java/PluginClassLoader.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 205468cf..9fc6bd77 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -44,7 +44,7 @@ final class PluginClassLoader extends URLClassLoader {
this.description = description;
this.dataFolder = dataFolder;
this.file = file;
- this.jar = new JarFile(file, true);
+ this.jar = new JarFile(file);
this.manifest = jar.getManifest();
this.url = file.toURI().toURL();
@@ -104,7 +104,11 @@ final class PluginClassLoader extends URLClassLoader {
if (dot != -1) {
String pkgName = name.substring(0, dot);
if (getPackage(pkgName) == null) {
- definePackage(pkgName, manifest, url);
+ if (manifest != null) {
+ definePackage(pkgName, manifest, url);
+ } else {
+ definePackage(pkgName, null, null, null, null, null, null, null);
+ }
}
}