2021-06-12 18:04:04 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2023-07-01 20:21:13 +00:00
|
|
|
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-10-18 22:49:54 +00:00
|
|
|
index a79461457ea19339f47572c70705d655ebc55276..1ac1484fa13e1aadf6dfc964e7797534e2231950 100644
|
2021-06-12 18:04:04 +00:00
|
|
|
--- a/build.gradle.kts
|
|
|
|
+++ b/build.gradle.kts
|
2023-10-18 22:49:54 +00:00
|
|
|
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
|
|
|
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"))
|
|
|
|
- implementation(project(":paper-mojangapi"))
|
2023-07-01 20:21:13 +00:00
|
|
|
+ // Scissors start
|
2022-04-22 05:15:08 +00:00
|
|
|
+ implementation(project(":Scissors-API"))
|
2023-10-18 22:49:54 +00:00
|
|
|
+ implementation("io.papermc.paper:paper-mojangapi:1.20.2-R0.1-SNAPSHOT") {
|
2022-08-09 03:51:43 +00:00
|
|
|
+ exclude("io.papermc.paper", "paper-api")
|
|
|
|
+ }
|
2023-07-01 20:21:13 +00:00
|
|
|
+ // Scissors end
|
2021-06-12 18:04:04 +00:00
|
|
|
// Paper start
|
2021-11-04 02:59:43 +00:00
|
|
|
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
|
|
|
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
2023-10-18 22:49:54 +00:00
|
|
|
@@ -66,11 +70,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
|
2023-07-01 20:21:13 +00:00
|
|
|
+ // 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")
|
|
|
|
+ }
|
2023-07-01 20:21:13 +00:00
|
|
|
+ // Scissors end
|
2021-08-25 04:06:30 +00:00
|
|
|
attributes(
|
|
|
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
|
|
|
"Implementation-Title" to "CraftBukkit",
|
|
|
|
- "Implementation-Version" to "git-Paper-$implementationVersion",
|
2023-07-01 20:21:13 +00:00
|
|
|
+ "Implementation-Version" to "git-Scissors-$implementationVersion", // Scissors
|
2021-08-25 04:06:30 +00:00
|
|
|
"Implementation-Vendor" to date, // Paper
|
|
|
|
"Specification-Title" to "Bukkit",
|
|
|
|
"Specification-Version" to project.version,
|
2023-10-18 22:49:54 +00:00
|
|
|
@@ -154,7 +166,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"
|
2023-07-01 20:21:13 +00:00
|
|
|
+ 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
|
2023-07-01 20:21:13 +00:00
|
|
|
index 4b002e8b75d117b726b0de274a76d3596fce015b..a46d3f40642bbf249c2d24e689f474d07175ca09 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());
|
2023-07-01 20:21:13 +00:00
|
|
|
+ Metrics metrics = new Metrics("Scissors", serverUUID, logFailedRequests, Bukkit.getLogger()); // Scissors
|
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);
|
2023-07-01 20:21:13 +00:00
|
|
|
+ paperVersion = "git-Scissors-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Scissors
|
2023-06-09 01:14:22 +00:00
|
|
|
} else {
|
|
|
|
paperVersion = "unknown";
|
|
|
|
}
|
|
|
|
- metrics.addCustomChart(new Metrics.SimplePie("paper_version", () -> paperVersion));
|
2023-07-01 20:21:13 +00:00
|
|
|
+ metrics.addCustomChart(new Metrics.SimplePie("scissors_version", () -> paperVersion)); // Scissors
|
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
|
2023-07-01 20:21:13 +00:00
|
|
|
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")
|
2023-07-01 20:21:13 +00:00
|
|
|
+ .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-10-18 22:49:54 +00:00
|
|
|
index 97745f0bab8d82d397c6c2a5775aed92bca0a034..2f511b9c5f48773c17a659c00a94ba3df82edf93 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-10-18 22:49:54 +00:00
|
|
|
@@ -1697,7 +1697,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
2021-06-12 18:04:04 +00:00
|
|
|
|
|
|
|
@DontObfuscate
|
|
|
|
public String getServerModName() {
|
2021-09-25 02:10:14 +00:00
|
|
|
- return "Paper"; // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
2022-06-11 03:24:53 +00:00
|
|
|
+ return "Scissors"; // Scissors - Scissors > // 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-10-18 22:49:54 +00:00
|
|
|
index b7e7e6ed60f55d2ab5e4fcefb3638ad1768c3b7f..f7c3b65e0d6c76189aea00232b33722c4363d7dd 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-10-18 22:49:54 +00:00
|
|
|
@@ -267,7 +267,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 {
|
|
|
|
- private final String serverName = "Paper"; // Paper
|
2023-07-01 20:21:13 +00:00
|
|
|
+ private final String serverName = "Scissors"; // Scissors // 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-07-01 20:21:13 +00:00
|
|
|
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");
|
2023-07-01 20:21:13 +00:00
|
|
|
+ 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) {
|