mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 18:09:48 -05:00
Fixed #1351, Try search the quickshop jar if old jar not found
This commit is contained in:
1 parent
91fed0a35a
commit
5b4530f827
1 file changed
+16
@@ -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)");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user