Skip to content

Commit

Permalink
修复PluginClassLoader的类加载优先顺序
Browse files Browse the repository at this point in the history
  • Loading branch information
Luohuayu committed Dec 7, 2021
1 parent 3181f0c commit c06ba2e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ Class<?> findClass(String name, boolean checkGlobal) throws ClassNotFoundExcepti
}

if (result == null) {
try {
result = launchClassLoader.getClass().getClassLoader().loadClass(name);
} catch (Throwable throwable) {
throw new ClassNotFoundException(name, throwable);
if (checkGlobal) {
try {
result = launchClassLoader.getClass().getClassLoader().loadClass(name);
} catch (Throwable throwable) {
throw new ClassNotFoundException(name, throwable);
}
}
}

Expand Down

0 comments on commit c06ba2e

Please sign in to comment.