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

129 lines
7.8 KiB
Diff
Raw Normal View History

2021-06-12 18:04:04 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Luna <lunahatesgogle@gmail.com>
Date: Sat, 12 Mar 2022 22:22:22 -0300
2021-06-12 18:04:04 +00:00
Subject: [PATCH] Build changes
diff --git a/build.gradle.kts b/build.gradle.kts
2023-08-23 00:24:44 +00:00
index 9ee90bc753e65f9dd532f28ec75cc16bf16486c8..9ca282a17c94d1314c625ca4ad15bb899cd6e02f 100644
2021-06-12 18:04:04 +00:00
--- a/build.gradle.kts
+++ b/build.gradle.kts
2023-08-23 00:24:44 +00:00
@@ -13,12 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
2023-07-03 04:31:14 +00:00
val alsoShade: Configuration by configurations.creating
2021-06-12 18:04:04 +00:00
dependencies {
2023-08-23 00:24:44 +00:00
- // Folia start
- implementation(project(":folia-api"))
- implementation("io.papermc.paper:paper-mojangapi:1.19.3-R0.1-SNAPSHOT") {
+ // Scissors start
+ implementation(project(":Scissors-API"))
2023-06-13 17:45:38 +00:00
+ implementation("io.papermc.paper:paper-mojangapi:1.20.1-R0.1-SNAPSHOT") {
2023-08-23 00:24:44 +00:00
exclude("io.papermc.paper", "paper-api")
}
- // Folia end
+ // Scissors end
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")
2023-08-23 00:24:44 +00:00
@@ -72,11 +72,19 @@ tasks.jar {
2022-04-22 08:04:10 +00:00
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
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",
"Implementation-Title" to "CraftBukkit",
2023-08-23 00:24:44 +00:00
- "Implementation-Version" to "git-Folia-$implementationVersion", // Folia
+ "Implementation-Version" to "git-Scissors-$implementationVersion", // Scissors // Folia
2021-08-25 04:06:30 +00:00
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
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
2023-08-23 00:24:44 +00:00
index cb60d58d4a7556dd896f31d0cd249f860bb3ef84..f7038ee0d3475ee9c187da8feb12ff4553130e1d 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)) {
2023-08-23 00:24:44 +00:00
- Metrics metrics = new Metrics("Folia", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page
+ Metrics metrics = new Metrics("Scissors", serverUUID, logFailedRequests, Bukkit.getLogger()); // Scissors // Folia - we have our own bstats page
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);
2023-08-23 00:24:44 +00:00
- paperVersion = "git-Folia-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Folia - we have our own bstats page
+ paperVersion = "git-Scissors-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Scissors // Folia - we have our own bstats page
2023-06-09 01:14:22 +00:00
} else {
paperVersion = "unknown";
}
2023-08-23 00:24:44 +00:00
- metrics.addCustomChart(new Metrics.SimplePie("folia_version", () -> paperVersion)); // Folia - we have our own bstats page
+ metrics.addCustomChart(new Metrics.SimplePie("scissors_version", () -> paperVersion)); // Scissors // Folia - we have our own bstats page
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
index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..21ded7c14c56a40feaa7741131be5166947f7169 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")
+ .appName("Scissors") // 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-06-12 18:04:04 +00:00
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
2023-08-23 00:24:44 +00:00
index 355acd1dd3b2e9f2a086a8d95928cdebbf63d06f..840105551533aef45583f0c36ee7fc41bcd0d2d0 100644
2021-06-12 18:04:04 +00:00
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
2023-08-23 00:24:44 +00:00
@@ -1812,7 +1812,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
2021-06-12 18:04:04 +00:00
@DontObfuscate
public String getServerModName() {
2023-08-23 00:24:44 +00:00
- return "Folia"; // Folia - Folia > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
+ return "Scissors"; // Scissors - Scissors > // Folia - Folia > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
2021-06-12 18:04:04 +00:00
}
2021-08-25 04:06:30 +00:00
public SystemReport fillSystemReport(SystemReport details) {
2021-06-12 18:04:04 +00:00
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2023-08-23 00:24:44 +00:00
index 9485d754ec6ce4031d88734e327abda240d9db90..442cbb83e520df2ba890b291a618b5bb4ad8dc9d 100644
2021-06-12 18:04:04 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2023-08-06 21:48:24 +00:00
@@ -265,7 +265,7 @@ import javax.annotation.Nullable; // Paper
2021-06-12 18:04:04 +00:00
import javax.annotation.Nonnull; // Paper
public final class CraftServer implements Server {
2023-08-23 00:24:44 +00:00
- private final String serverName = "Folia"; // Folia // Paper
+ private final String serverName = "Scissors"; // Scissors // Folia // Paper
2021-06-12 18:04:04 +00:00
private final String serverVersion;
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
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
2023-08-23 00:24:44 +00:00
index e9b6ca3aa25e140467ae866d572483050ea3fa0e..bb37db7715b7c5eb497f4d5f5a32668ad947943b 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";
2023-08-23 00:24:44 +00:00
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/dev.folia/folia-api/pom.properties"); // Folia
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/me.totalfreedom.scissors/Scissors-API/pom.properties"); // Folia // Scissors
2021-08-25 04:06:30 +00:00
Properties properties = new Properties();
if (stream != null) {