Scissors/patches/server/0001-Build-changes.patch

113 lines
6.3 KiB
Diff
Raw Normal View History

2021-06-12 18:04:04 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2023-12-10 18:38:31 +00:00
From: Telesphoreo <me@telesphoreo.me>
2024-06-14 23:02:52 +00:00
Date: Fri, 14 Jun 2024 17:38:20 -0500
2021-06-12 18:04:04 +00:00
Subject: [PATCH] Build changes
diff --git a/build.gradle.kts b/build.gradle.kts
2024-06-14 23:02:52 +00:00
index 4998aff0b7cb084dcda15c6a18bbe45e99b6000a..b0e9bf22d546110d995b5625ce8ed22501992679 100644
2021-06-12 18:04:04 +00:00
--- a/build.gradle.kts
+++ b/build.gradle.kts
2024-06-14 23:02:52 +00:00
@@ -13,7 +13,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
2023-12-29 18:36:48 +00:00
val alsoShade: Configuration by configurations.creating
2021-06-12 18:04:04 +00:00
dependencies {
2022-04-19 23:21:18 +00:00
- implementation(project(":paper-api"))
2024-06-14 23:02:52 +00:00
+ implementation(project(":Scissors-API")) // Scissors
2021-06-12 18:04:04 +00:00
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
2024-06-14 23:02:52 +00:00
@@ -77,17 +77,25 @@ tasks.jar {
2022-04-22 08:04:10 +00:00
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
2024-06-14 23:02:52 +00:00
val implementationVersion = "$mcVersion-${build ?: "DEV"}-$gitHash"
2022-04-22 08:04:10 +00:00
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
- val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
+ // Scissors start
2022-04-22 08:04:10 +00:00
+ var gitBranch: String;
+ if (System.getenv("JENKINS_URL") == null)
+ {
+ gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
+ } else {
+ gitBranch = System.getenv("GITHUB_BRANCH")
+ }
+ // Scissors end
2021-08-25 04:06:30 +00:00
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
2024-06-14 23:02:52 +00:00
"Implementation-Title" to "Paper",
"Implementation-Version" to implementationVersion,
2021-08-25 04:06:30 +00:00
"Implementation-Vendor" to date, // Paper
2024-06-14 23:02:52 +00:00
- "Specification-Title" to "Paper",
+ "Specification-Title" to "Scissors",
2021-08-25 04:06:30 +00:00
"Specification-Version" to project.version,
2024-06-14 23:02:52 +00:00
- "Specification-Vendor" to "Paper Team",
- "Brand-Id" to "papermc:paper",
- "Brand-Name" to "Paper",
+ "Specification-Vendor" to "Scissors Team",
+ "Brand-Id" to "scissorsmc:scissors",
+ "Brand-Name" to "Scissors",
"Build-Number" to (build ?: ""),
"Build-Time" to Instant.now().toString(),
"Git-Branch" to gitBranch, // Paper
@@ -144,7 +152,7 @@ fun TaskContainer.registerRunTask(
2022-04-19 23:21:18 +00:00
name: String,
block: JavaExec.() -> Unit
2021-06-16 06:28:10 +00:00
): TaskProvider<JavaExec> = register<JavaExec>(name) {
- group = "paper"
+ group = "paperweight" // Scissors
2022-04-19 23:21:18 +00:00
mainClass.set("org.bukkit.craftbukkit.Main")
2021-06-16 06:28:10 +00:00
standardInput = System.`in`
2022-04-19 23:21:18 +00:00
workingDir = rootProject.layout.projectDirectory
2023-06-09 01:14:22 +00:00
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
2024-06-14 23:02:52 +00:00
index 4b002e8b75d117b726b0de274a76d3596fce015b..5ff11b9bcef76cb767f0b03ffc326d3f7a361371 100644
2023-06-09 01:14:22 +00:00
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -593,7 +593,7 @@ public class Metrics {
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
// Only start Metrics, if it's enabled in the config
if (config.getBoolean("enabled", true)) {
- Metrics metrics = new Metrics("Paper", serverUUID, logFailedRequests, Bukkit.getLogger());
2024-06-14 23:02:52 +00:00
+ Metrics metrics = new Metrics("Scissors", serverUUID, logFailedRequests, Bukkit.getLogger());
2023-06-09 01:14:22 +00:00
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
String minecraftVersion = Bukkit.getVersion();
@@ -607,11 +607,11 @@ public class Metrics {
final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion();
if (implVersion != null) {
final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
- paperVersion = "git-Paper-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash);
2024-06-14 23:02:52 +00:00
+ paperVersion = "git-Scissors-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash);
2023-06-09 01:14:22 +00:00
} else {
paperVersion = "unknown";
}
- metrics.addCustomChart(new Metrics.SimplePie("paper_version", () -> paperVersion));
2024-06-14 23:02:52 +00:00
+ metrics.addCustomChart(new Metrics.SimplePie("scissors_version", () -> paperVersion));
2023-06-09 01:14:22 +00:00
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
Map<String, Map<String, Integer>> map = new HashMap<>();
2023-06-09 01:19:18 +00:00
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
2024-06-14 23:02:52 +00:00
index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..2fbb5fc19e6d7f3767c7c6eedcbc6af2b0877ae5 100644
2023-06-09 01:19:18 +00:00
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
@Override
protected LineReader buildReader(LineReaderBuilder builder) {
builder
- .appName("Paper")
2024-06-14 23:02:52 +00:00
+ .appName("Scissors")
2023-06-09 01:19:18 +00:00
.variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history"))
.completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true);
2021-08-25 04:06:30 +00:00
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 774556a62eb240da42e84db4502e2ed43495be17..741c76c4dfa0bb34cc23bd795c194bdea10418cc 100644
2021-08-25 04:06:30 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
@@ -11,7 +11,7 @@ public final class Versioning {
public static String getBukkitVersion() {
String result = "Unknown-Version";
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/io.papermc.paper/paper-api/pom.properties");
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/me.totalfreedom.scissors/Scissors-API/pom.properties"); // Scissors
2021-08-25 04:06:30 +00:00
Properties properties = new Properties();
if (stream != null) {