3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00

Log IOException in plugin update (#7960)

Dieser Commit ist enthalten in:
Pedro 2022-07-18 05:31:33 -04:00 committet von GitHub
Ursprung 036a09c300
Commit fdd910e0cf
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

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
index 45114d587a8f201778adcba16c8a019f9959f472..ed07f5820281b139739f673fa4e25171de81b894 100644
index 45114d587a8f201778adcba16c8a019f9959f472..5270e43c629fe63f42691d10c6f77dc1cc987457 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -395,7 +395,7 @@ public final class SimplePluginManager implements PluginManager {
@ -17,7 +17,7 @@ index 45114d587a8f201778adcba16c8a019f9959f472..ed07f5820281b139739f673fa4e25171
Set<Pattern> filters = fileAssociations.keySet();
Plugin result = null;
@@ -422,16 +422,56 @@ public final class SimplePluginManager implements PluginManager {
@@ -422,16 +422,61 @@ public final class SimplePluginManager implements PluginManager {
return result;
}
@ -48,16 +48,21 @@ index 45114d587a8f201778adcba16c8a019f9959f472..ed07f5820281b139739f673fa4e25171
+ continue;
+ }
+ if (!pluginName.equals(updatePluginName)) continue;
+ if (!FileUtil.copy(updateFile, file)) continue;
+ try {
+ java.nio.file.Files.copy(updateFile.toPath(), file.toPath());
+ } catch (java.io.IOException exception) {
+ server.getLogger().log(Level.SEVERE, "Could not copy '" + updateFile.getPath() + "' to '" + file.getPath() + "' in update plugin process", exception);
+ continue;
+ }
+ File newName = new File(file.getParentFile(), updateFile.getName());
+ file.renameTo(newName);
+ updateFile.delete();
+ return newName;
+ }
+ }
}
+ catch (InvalidDescriptionException e) {
+ throw new InvalidPluginException(e);
}
+ }
+ return file;
+ }