diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index d7eed103d..a7732cc7f 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -672,6 +672,22 @@ public class QuickShop extends JavaPlugin { throw new IllegalStateException("Failed to reload QuickShop! Please consider restarting the server. (Plugin was updated)"); } } + // Maybe name changed, try search globally + if (!file.exists()) { + File pluginFolder = new File("plugins"); + if (pluginFolder.isDirectory()) { + //noinspection ConstantConditions + for (File listFile : pluginFolder.listFiles()) { + if (listFile.getName().endsWith(".jar")) { + if (getPluginLoader().loadPlugin(listFile).getName().equals(getDescription().getName())) { + file = listFile; + break; + } + } + } + } + } + if (!file.exists()) { throw new IllegalStateException("Failed to reload QuickShop! Please consider restarting the server. (Failed to find plugin jar)"); }