diff --git a/patches/api/Update-Folder-Uses-Plugin-Name.patch b/patches/api/Update-Folder-Uses-Plugin-Name.patch index 03e43e2fd9..a633c4c6a0 100644 --- a/patches/api/Update-Folder-Uses-Plugin-Name.patch +++ b/patches/api/Update-Folder-Uses-Plugin-Name.patch @@ -48,16 +48,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + 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; + }