From 020876f38ef6c3f42085f0c960438e085d458582 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 30 Dec 2017 07:00:16 +1100 Subject: [PATCH] SPIGOT-3723: Delegate PluginClassLoader back to parent By: md_5 --- .../java/org/bukkit/plugin/java/PluginClassLoader.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/paper-api/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java index 3be5634123..9fc6bd7721 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/paper-api/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java @@ -116,10 +116,14 @@ final class PluginClassLoader extends URLClassLoader { CodeSource source = new CodeSource(url, signers); result = defineClass(name, classBytes, 0, classBytes.length, source); + } + if (result == null) { + result = super.findClass(name); + } + + if (result != null) { loader.setClass(name, result); - } else { - throw new ClassNotFoundException(name); } }