Skip to content

Commit

Permalink
fix version command throwing an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed May 17, 2024
1 parent 69d3bb4 commit ad32b22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions patches/server/0001-Rebrand.patch
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ index 4998aff0b7cb084dcda15c6a18bbe45e99b6000a..d23ecfabf6bf1e355fb2efe5abd80236
standardInput = System.`in`
workingDir = rootProject.layout.projectDirectory
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..af5890e6d915cc60cf19fc531022699599450493 100644
index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..eddc4426301d429968f44d493bae4e71b5969325 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -35,7 +35,10 @@ public class PaperVersionFetcher implements VersionFetcher {
Expand Down Expand Up @@ -115,11 +115,12 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..af5890e6d915cc60cf19fc5310226995
Charsets.UTF_8
).openBufferedStream()) {
final JsonObject json = new Gson().fromJson(reader, JsonObject.class);
final JsonArray builds = json.getAsJsonArray("builds");
- final JsonArray builds = json.getAsJsonArray("builds");
- final int latest = StreamSupport.stream(builds.spliterator(), false)
- .mapToInt(JsonElement::getAsInt)
- .max()
- .orElseThrow();
+ //final JsonArray builds = json.getAsJsonArray("builds"); // Purpur
+ final int latest = json.getAsJsonObject("builds").getAsJsonPrimitive("latest").getAsInt(); // Purpur
return latest - jenkinsBuild;
} catch (final JsonSyntaxException ex) {
Expand Down

0 comments on commit ad32b22

Please sign in to comment.