Skip to content
This repository was archived by the owner on Jun 7, 2022. It is now read-only.

Commit 8dc58fb

Browse files
derropGiantTreeLP
authored andcommitted
Fixed that the paperclip.jar was copied after the build and not the patched jar
1 parent 9d58bdf commit 8dc58fb

File tree

1 file changed

+7
-7
lines changed
  • cloudnet-cord/cloudnet-setup/src/main/java/de/dytanic/cloudnet/setup/spigot

1 file changed

+7
-7
lines changed

cloudnet-cord/cloudnet-setup/src/main/java/de/dytanic/cloudnet/setup/spigot/PaperBuilder.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,13 @@ private static boolean buildPaperVersion(String version, Path outputPath) throws
9797
runPaperClip(connection, buildFolder, paperclip, outputPath);
9898
return true;
9999
} else {
100-
File[] paperclips = buildFolder.listFiles(pathname -> pathname.getName().startsWith("paper"));
101-
if (Objects.requireNonNull(paperclips).length > 0) {
100+
File cacheFolder = new File(buildFolder, "cache");
101+
File[] patchedFiles = cacheFolder.listFiles(pathname -> pathname.getName().startsWith("patched"));
102+
if (Objects.requireNonNull(patchedFiles).length > 0) {
102103
System.out.println("Skipping build");
103104
System.out.println("Copying spigot.jar");
104105
try {
105-
Files.copy(new FileInputStream(Objects.requireNonNull(paperclips)[0]),
106+
Files.copy(new FileInputStream(Objects.requireNonNull(patchedFiles)[0]),
106107
outputPath,
107108
StandardCopyOption.REPLACE_EXISTING);
108109
return true;
@@ -136,10 +137,9 @@ private static void runPaperClip(URLConnection connection, File buildFolder, Fil
136137
exec = Runtime.getRuntime().exec("java -jar paperclip.jar", null, buildFolder);
137138
printProcessOutputToConsole(exec);
138139

139-
Files.copy(new FileInputStream(Objects.requireNonNull(buildFolder.listFiles(pathname -> pathname.getName()
140-
.startsWith("paperclip")))[0]),
141-
outputPath,
142-
StandardCopyOption.REPLACE_EXISTING);
140+
File cacheFolder = new File(buildFolder, "cache");
141+
File[] patchedFiles = cacheFolder.listFiles(pathname -> pathname.getName().startsWith("patched"));
142+
Files.copy(new FileInputStream(Objects.requireNonNull(patchedFiles)[0]), outputPath, StandardCopyOption.REPLACE_EXISTING);
143143
}
144144

145145
/**

0 commit comments

Comments
 (0)