Archiviert
13
0

Fix plugin update IO logic when replacing jars

Dieser Commit ist enthalten in:
Shane Freeder 2022-07-23 05:52:57 +01:00
Ursprung 46a9d2a4ac
Commit 44b6869fd2
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: A3F61EA5A085289C

Datei anzeigen

@ -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 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 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/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 { @@ -396,7 +396,7 @@ public final class SimplePluginManager implements PluginManager {
@ -49,7 +49,7 @@ index 94646b37c77fcb18fc4030306c431684e7e9a5cc..1c9d0a81d581d0e6a8b2551a2cb9ed5e
+ } + }
+ if (!pluginName.equals(updatePluginName)) continue; + if (!pluginName.equals(updatePluginName)) continue;
+ try { + 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) { + } catch (java.io.IOException exception) {
+ server.getLogger().log(Level.SEVERE, "Could not copy '" + updateFile.getPath() + "' to '" + file.getPath() + "' in update plugin process", exception); + server.getLogger().log(Level.SEVERE, "Could not copy '" + updateFile.getPath() + "' to '" + file.getPath() + "' in update plugin process", exception);
+ continue; + continue;