Scissors/patches/server/0026-Update-for-1.18.2.patch

57 lines
2.9 KiB
Diff
Raw Normal View History

2022-04-20 00:05:57 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Telesphoreo <me@telesphoreo.me>
2022-04-22 06:31:04 +00:00
Date: Fri, 22 Apr 2022 01:27:54 -0500
2022-04-22 05:30:55 +00:00
Subject: [PATCH] Update for 1.18.2
2022-04-20 00:05:57 +00:00
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
2022-04-22 05:27:06 +00:00
index f92610edcfb724374c69e66443eab60919ee955a..1531d21c6e73ae69ec728d107b917967e0c6222b 100644
2022-04-20 00:05:57 +00:00
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
2022-04-22 05:27:06 +00:00
@@ -18,10 +18,12 @@ import java.io.*;
2022-04-20 00:05:57 +00:00
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.stream.StreamSupport;
+import org.bukkit.Bukkit;
public class PaperVersionFetcher implements VersionFetcher {
private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end
2022-04-22 05:27:06 +00:00
- private static final String GITHUB_BRANCH_NAME = getBranch();
+ // Scissors - This must be changed manually for update checking to work
+ private static final String GITHUB_BRANCH_NAME = "ver/1.18.2";
private static final String DOWNLOAD_PAGE = "https://ci.plex.us.org/job/Scissors/job/" + GITHUB_BRANCH_NAME;
private static @Nullable String mcVer;
@@ -56,15 +58,10 @@ public class PaperVersionFetcher implements VersionFetcher {
return mcVer;
2022-04-20 00:05:57 +00:00
}
2022-04-22 05:27:06 +00:00
- // Scissors start - Allow getting git information
2022-04-20 00:05:57 +00:00
- public static String getCommit() {
- Map<String, String> attributes = JarManifests.MANIFEST_MAP;
- return attributes.get("Git-Commit");
2022-04-22 05:27:06 +00:00
- }
-
2022-04-20 00:05:57 +00:00
- public static String getBranch() {
- Map<String, String> attributes = JarManifests.MANIFEST_MAP;
- return attributes.get("Git-Branch");
2022-04-22 05:27:06 +00:00
+ // Scissors start - Allow getting Git commit
+ private static String getCommit() {
2022-04-20 00:05:57 +00:00
+ final var manifest = JarManifests.manifest(Bukkit.getServer().getClass());
2022-04-22 05:27:06 +00:00
+ return manifest == null ? null : manifest.getMainAttributes().getValue("Git-Commit");
2022-04-20 00:05:57 +00:00
}
// Scissors end
diff --git a/src/main/java/net/minecraft/network/chat/NbtComponent.java b/src/main/java/net/minecraft/network/chat/NbtComponent.java
2022-04-22 06:31:04 +00:00
index f518e47818a47be0dfd7cccc4845ba9736c6cd8b..218525ba1742d68cde10f6caf09ee30eb2d01d50 100644
2022-04-20 00:05:57 +00:00
--- a/src/main/java/net/minecraft/network/chat/NbtComponent.java
+++ b/src/main/java/net/minecraft/network/chat/NbtComponent.java
2022-04-22 06:31:04 +00:00
@@ -96,6 +96,7 @@ public abstract class NbtComponent extends BaseComponent implements ContextAware
2022-04-20 00:05:57 +00:00
return stream.map((string) -> {
return new TextComponent(string);
}).reduce((accumulator, current) -> {
+ // Scissors - untested, likely needs fixing
2022-04-22 06:31:04 +00:00
return (TextComponent) accumulator.append(text).append(current);
2022-04-20 00:05:57 +00:00
}).orElseGet(() -> {
return new TextComponent("");