From 81f79b407d59136b7308d57fa99496d4f31fb374 Mon Sep 17 00:00:00 2001 From: Viktor Hrekh Date: Tue, 28 Feb 2023 14:17:49 +0200 Subject: [PATCH] Log message if plugin bootstrap provided external plugin instead of throwing an exception (#8914) --- patches/server/Paper-Plugins.patch | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/patches/server/Paper-Plugins.patch b/patches/server/Paper-Plugins.patch index 0d68604a41..0cf4fbf9f0 100644 --- a/patches/server/Paper-Plugins.patch +++ b/patches/server/Paper-Plugins.patch @@ -5592,9 +5592,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + plugin = bootstrap.createPlugin(PaperPluginParent.this.context); + } + -+ // Don't allow plugins to load plugins other than the one defined in main. This restriction might not be necessary. + if (!plugin.getClass().isAssignableFrom(Class.forName(PaperPluginParent.this.description.getMainClass(), true, plugin.getClass().getClassLoader()))) { -+ throw new IllegalArgumentException("Plugin provided must be the same type as main defined in plugin configuration!"); ++ logger.info("Bootstrap of plugin " + PaperPluginParent.this.description.getName() + " provided a plugin instance of class " + plugin.getClass().getName() + " which does not match the plugin declared main class"); + } + + this.status = ProviderStatus.INITIALIZED;