Add Metrics and compile fixes

This commit is contained in:
Telesphoreo 2023-07-22 12:57:20 -05:00
parent 60ef55e21e
commit 4b69690c68
No known key found for this signature in database
GPG Key ID: 68B745F7F8C2FADA
4 changed files with 40 additions and 6 deletions

8
Jenkinsfile vendored
View File

@ -16,6 +16,12 @@ pipeline {
withGradle { withGradle {
sh './gradlew createReobfPaperclipJar --no-daemon --refresh-dependencies' sh './gradlew createReobfPaperclipJar --no-daemon --refresh-dependencies'
} }
sh """
#!/bin/sh
BRANCH=\$(echo "\${BRANCH_NAME}" | sed 's/\\//_/g')
mv \${WORKSPACE}/build/libs/Scissors-paperclip-*.jar \${WORKSPACE}/build/libs/scissors-\${BRANCH}-\${BUILD_NUMBER}.jar
rm \${WORKSPACE}/build/libs/Scissors-bundler-*.jar
"""
} }
} }
stage('test') { stage('test') {
@ -28,7 +34,7 @@ pipeline {
} }
post { post {
always { always {
archiveArtifacts artifacts: 'build/libs/Scissors-paperclip-*.jar', fingerprint: true archiveArtifacts artifacts: 'build/libs/scissors-*.jar', fingerprint: true
junit 'Scissors-Server/build/test-results/test/*.xml' junit 'Scissors-Server/build/test-results/test/*.xml'
junit 'Scissors-API/build/test-results/test/*.xml' junit 'Scissors-API/build/test-results/test/*.xml'
cleanWs() cleanWs()

View File

@ -2,7 +2,7 @@ plugins {
java java
`maven-publish` `maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.0" apply false id("com.github.johnrengelman.shadow") version "8.1.0" apply false
id("io.papermc.paperweight.patcher") version "1.5.2" id("io.papermc.paperweight.patcher") version "1.5.5"
} }
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
@ -17,7 +17,7 @@ repositories {
dependencies { dependencies {
remapper("net.fabricmc:tiny-remapper:0.8.6:fat") remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
decompiler("net.minecraftforge:forgeflower:2.0.627.2") decompiler("net.minecraftforge:forgeflower:2.0.627.2")
paperclip("io.papermc:paperclip:3.0.2") paperclip("io.papermc:paperclip:3.0.3")
} }
allprojects { allprojects {

View File

@ -7,3 +7,4 @@ paperRef=155aa36d89b260ef5841615899299756b5983c0a
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.vfs.watch=false org.gradle.vfs.watch=false
org.gradle.jvmargs=-Xmx4096m

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Build changes
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 6a1853f3d988820f357c11371e32d50682e60401..fb72feb5878ae07c76754ab0e213f9797fcd88c2 100644 index 1919a8e9cb7c995b2a9c876ff4980bdc98977133..c2e924b05178e2c6324a0f797897cd69422a89ef 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -7,8 +7,10 @@ plugins { @@ -7,8 +7,10 @@ plugins {
@ -50,8 +50,35 @@ index 6a1853f3d988820f357c11371e32d50682e60401..fb72feb5878ae07c76754ab0e213f979
mainClass.set("org.bukkit.craftbukkit.Main") mainClass.set("org.bukkit.craftbukkit.Main")
standardInput = System.`in` standardInput = System.`in`
workingDir = rootProject.layout.projectDirectory 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..5ff11b9bcef76cb767f0b03ffc326d3f7a361371 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());
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);
} else {
paperVersion = "unknown";
}
- metrics.addCustomChart(new Metrics.SimplePie("paper_version", () -> paperVersion));
+ metrics.addCustomChart(new Metrics.SimplePie("scissors_version", () -> paperVersion));
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
Map<String, Map<String, Integer>> map = new HashMap<>();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 710ca7d3a5659953f64bc6dccdd93b43300961cc..ad9cd0987098c8969fdf002969188458b0398924 100644 index 753a917d34a1e1c1521a8916bc8e44a6acd90a46..b289da2fc7c2053415365505f830aaa045f70ff2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1654,7 +1654,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1654,7 +1654,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -64,7 +91,7 @@ index 710ca7d3a5659953f64bc6dccdd93b43300961cc..ad9cd0987098c8969fdf002969188458
public SystemReport fillSystemReport(SystemReport details) { 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 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f938095d999412d88fa3fcf76b87253034124cb9..83fa0d27e72261fe7bcec2ae58a61f431963b36e 100644 index bbb8335dae0a3e2761e6bbb8dc723bcf28cd82ba..3fa8a282e4511e79def2470f1abc34f3bf6527a3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -261,7 +261,7 @@ import javax.annotation.Nullable; // Paper @@ -261,7 +261,7 @@ import javax.annotation.Nullable; // Paper