mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-10-31 20:27:10 +00:00
136 lines
7.6 KiB
Diff
136 lines
7.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Telesphoreo <me@telesphoreo.me>
|
|
Date: Sun, 10 Dec 2023 12:34:45 -0600
|
|
Subject: [PATCH] Build changes
|
|
|
|
|
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
index bcfe59b6efb628ee1e7f9d60667360d4d885fb6a..855784d7f9c2993c5d91f67c9b8cc46fe6e4147e 100644
|
|
--- a/build.gradle.kts
|
|
+++ b/build.gradle.kts
|
|
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
|
val alsoShade: Configuration by configurations.creating
|
|
|
|
dependencies {
|
|
- implementation(project(":paper-api"))
|
|
- implementation(project(":paper-mojangapi"))
|
|
+ // Scissors start
|
|
+ implementation(project(":Scissors-API"))
|
|
+ implementation("io.papermc.paper:paper-mojangapi:1.20.4-R0.1-SNAPSHOT") {
|
|
+ exclude("io.papermc.paper", "paper-api")
|
|
+ }
|
|
+ // Scissors end
|
|
// Paper start
|
|
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
|
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
|
@@ -67,11 +71,19 @@ tasks.jar {
|
|
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
|
|
+ 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
|
|
attributes(
|
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
|
"Implementation-Title" to "CraftBukkit",
|
|
- "Implementation-Version" to "git-Paper-$implementationVersion",
|
|
+ "Implementation-Version" to "git-Scissors-$implementationVersion", // Scissors
|
|
"Implementation-Vendor" to date, // Paper
|
|
"Specification-Title" to "Bukkit",
|
|
"Specification-Version" to project.version,
|
|
@@ -150,7 +162,7 @@ fun TaskContainer.registerRunTask(
|
|
name: String,
|
|
block: JavaExec.() -> Unit
|
|
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
|
- group = "paper"
|
|
+ group = "paperweight" // Scissors
|
|
mainClass.set("org.bukkit.craftbukkit.Main")
|
|
standardInput = System.`in`
|
|
workingDir = rootProject.layout.projectDirectory
|
|
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
index 4b002e8b75d117b726b0de274a76d3596fce015b..a46d3f40642bbf249c2d24e689f474d07175ca09 100644
|
|
--- 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());
|
|
+ Metrics metrics = new Metrics("Scissors", serverUUID, logFailedRequests, Bukkit.getLogger()); // Scissors
|
|
|
|
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);
|
|
+ paperVersion = "git-Scissors-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Scissors
|
|
} else {
|
|
paperVersion = "unknown";
|
|
}
|
|
- metrics.addCustomChart(new Metrics.SimplePie("paper_version", () -> paperVersion));
|
|
+ metrics.addCustomChart(new Metrics.SimplePie("scissors_version", () -> paperVersion)); // Scissors
|
|
|
|
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
|
Map<String, Map<String, Integer>> map = new HashMap<>();
|
|
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
|
|
--- 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
|
|
.variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history"))
|
|
.completer(new ConsoleCommandCompleter(this.server))
|
|
.option(LineReader.Option.COMPLETE_IN_WORD, true);
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index c8772c773f9933ed1d1debfe707af4373c458152..05b0d82114aadbb713b7e5dad94ee0fe6221856a 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -1865,7 +1865,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
@DontObfuscate
|
|
public String getServerModName() {
|
|
- return "Paper"; // Paper
|
|
+ return "Scissors"; // Scissors
|
|
}
|
|
|
|
public SystemReport fillSystemReport(SystemReport details) {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index c490a29bcf7410bc54959ee71375605964379ed5..f192db9868129bd1ee45e2b29c0c7479af33ebe1 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -266,7 +266,7 @@ import javax.annotation.Nullable; // Paper
|
|
import javax.annotation.Nonnull; // Paper
|
|
|
|
public final class CraftServer implements Server {
|
|
- private final String serverName = "Paper"; // Paper
|
|
+ private final String serverName = "Scissors"; // Scissors > // Paper
|
|
private final String serverVersion;
|
|
private final String bukkitVersion = Versioning.getBukkitVersion();
|
|
private final Logger logger = Logger.getLogger("Minecraft");
|
|
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
|
|
--- 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
|
|
Properties properties = new Properties();
|
|
|
|
if (stream != null) {
|