Fix plugin update IO logic when replacing jars

This commit is contained in:
Shane Freeder 2022-07-23 05:52:57 +01:00
parent 46a9d2a4ac
commit 44b6869fd2
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Update Folder Uses Plugin Name
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 94646b37c77fcb18fc4030306c431684e7e9a5cc..1c9d0a81d581d0e6a8b2551a2cb9ed5e18bb2991 100644
index 94646b37c77fcb18fc4030306c431684e7e9a5cc..9db611841b73fed8dc8a71f4d7fdef95af3cf89d 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -396,7 +396,7 @@ public final class SimplePluginManager implements PluginManager {
@ -49,7 +49,7 @@ index 94646b37c77fcb18fc4030306c431684e7e9a5cc..1c9d0a81d581d0e6a8b2551a2cb9ed5e
+ }
+ if (!pluginName.equals(updatePluginName)) continue;
+ try {
+ java.nio.file.Files.copy(updateFile.toPath(), file.toPath());
+ java.nio.file.Files.copy(updateFile.toPath(), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
+ } catch (java.io.IOException exception) {
+ server.getLogger().log(Level.SEVERE, "Could not copy '" + updateFile.getPath() + "' to '" + file.getPath() + "' in update plugin process", exception);
+ continue;