From b48d4a0625ed9a269d81fea6e535345bce01c0af Mon Sep 17 00:00:00 2001 From: rtm516 Date: Mon, 1 May 2023 23:24:34 +0100 Subject: [PATCH] Check the local extension for the class before expanding the search --- .../geyser/extension/GeyserExtensionClassLoader.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionClassLoader.java b/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionClassLoader.java index b94e70ed0..30d6ac856 100644 --- a/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionClassLoader.java +++ b/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionClassLoader.java @@ -82,15 +82,13 @@ public class GeyserExtensionClassLoader extends URLClassLoader { Class result = this.classes.get(name); if (result == null) { - if (checkGlobal) { + result = super.findClass(name); + if (result == null && checkGlobal) { result = this.loader.classByName(name); } - if (result == null) { - result = super.findClass(name); - if (result != null) { - this.loader.setClass(name, result); - } + if (result != null) { + this.loader.setClass(name, result); } this.classes.put(name, result);