Check the local extension for the class before expanding the search

This commit is contained in:
rtm516 2023-05-01 23:24:34 +01:00
parent aa5e2e9cac
commit b48d4a0625
No known key found for this signature in database
GPG key ID: 331715B8B007C67A

View file

@ -82,15 +82,13 @@ public class GeyserExtensionClassLoader extends URLClassLoader {
Class<?> result = this.classes.get(name); Class<?> result = this.classes.get(name);
if (result == null) { if (result == null) {
if (checkGlobal) { result = super.findClass(name);
if (result == null && checkGlobal) {
result = this.loader.classByName(name); result = this.loader.classByName(name);
} }
if (result == null) { if (result != null) {
result = super.findClass(name); this.loader.setClass(name, result);
if (result != null) {
this.loader.setClass(name, result);
}
} }
this.classes.put(name, result); this.classes.put(name, result);