@@ -5,7 +5,7 @@ Subject: [PATCH] Update Folder Uses Plugin Name
5
5
6
6
7
7
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
8
- index 45114d587a8f201778adcba16c8a019f9959f472..ed07f5820281b139739f673fa4e25171de81b894 100644
8
+ index 45114d587a8f201778adcba16c8a019f9959f472..5270e43c629fe63f42691d10c6f77dc1cc987457 100644
9
9
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
10
10
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
11
11
@@ -395,7 +395,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -17,7 +17,7 @@ index 45114d587a8f201778adcba16c8a019f9959f472..ed07f5820281b139739f673fa4e25171
17
17
18
18
Set<Pattern> filters = fileAssociations.keySet();
19
19
Plugin result = null;
20
- @@ -422,16 +422,56 @@ public final class SimplePluginManager implements PluginManager {
20
+ @@ -422,16 +422,61 @@ public final class SimplePluginManager implements PluginManager {
21
21
return result;
22
22
}
23
23
@@ -48,16 +48,21 @@ index 45114d587a8f201778adcba16c8a019f9959f472..ed07f5820281b139739f673fa4e25171
48
48
+ continue;
49
49
+ }
50
50
+ if (!pluginName.equals(updatePluginName)) continue;
51
- + if (!FileUtil.copy(updateFile, file)) continue;
51
+ + try {
52
+ + java.nio.file.Files.copy(updateFile.toPath(), file.toPath());
53
+ + } catch (java.io.IOException exception) {
54
+ + server.getLogger().log(Level.SEVERE, "Could not copy '" + updateFile.getPath() + "' to '" + file.getPath() + "' in update plugin process", exception);
55
+ + continue;
56
+ + }
52
57
+ File newName = new File(file.getParentFile(), updateFile.getName());
53
58
+ file.renameTo(newName);
54
59
+ updateFile.delete();
55
60
+ return newName;
56
61
+ }
57
- + }
62
+ }
58
63
+ catch (InvalidDescriptionException e) {
59
64
+ throw new InvalidPluginException(e);
60
- }
65
+ + }
61
66
+ return file;
62
67
+ }
63
68
0 commit comments