mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-11-30 08:06:01 +00:00
Add Metrics to Scissors
This commit is contained in:
parent
a40a8e3ed6
commit
f128a0fc62
@ -2,7 +2,7 @@ group=me.totalfreedom.scissors
|
|||||||
version=1.20-R0.1-SNAPSHOT
|
version=1.20-R0.1-SNAPSHOT
|
||||||
|
|
||||||
mcVersion=1.20
|
mcVersion=1.20
|
||||||
paperRef=8ce5219e074e4ab0dc3ecb8c3f7ff9fdc4b527f8
|
paperRef=04509f0234dfd4c05be002de1985ab4915c2092c
|
||||||
|
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
|
@ -50,6 +50,33 @@ index a3a76b9b7efa773117d2ee1ce53ef784b09b277d..fad5e021f1282cd478f6ce484edbc135
|
|||||||
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 fb82bb52f219e7683fe1d3c0fb3acbe2251de8d4..0f9928bf68f8bc5abfe02f41c98c63888987d9b9 100644
|
index fb82bb52f219e7683fe1d3c0fb3acbe2251de8d4..0f9928bf68f8bc5abfe02f41c98c63888987d9b9 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Reset large tags
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
index 103ad5f373a59fadb4783892579f3e681a8fd596..ab1065ce7b626ad242905dbbfec98839fd0cd9c6 100644
|
index b367ec1feaccbd67e9e28c0d0515e163f37135fe..d1547b9ba36baec925751b9bb0498c8a8cac12f8 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
@@ -21,6 +21,7 @@ import java.util.function.Predicate;
|
@@ -21,6 +21,7 @@ import java.util.function.Predicate;
|
||||||
@ -29,7 +29,7 @@ index 103ad5f373a59fadb4783892579f3e681a8fd596..ab1065ce7b626ad242905dbbfec98839
|
|||||||
this.item = (Item) BuiltInRegistries.ITEM.get(new ResourceLocation(nbttagcompound.getString("id")));
|
this.item = (Item) BuiltInRegistries.ITEM.get(new ResourceLocation(nbttagcompound.getString("id")));
|
||||||
this.count = nbttagcompound.getByte("Count");
|
this.count = nbttagcompound.getByte("Count");
|
||||||
if (nbttagcompound.contains("tag", 10)) {
|
if (nbttagcompound.contains("tag", 10)) {
|
||||||
@@ -546,7 +553,11 @@ public final class ItemStack {
|
@@ -550,7 +557,11 @@ public final class ItemStack {
|
||||||
nbt.putString("id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString());
|
nbt.putString("id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString());
|
||||||
nbt.putByte("Count", (byte) this.count);
|
nbt.putByte("Count", (byte) this.count);
|
||||||
if (this.tag != null) {
|
if (this.tag != null) {
|
||||||
@ -42,7 +42,7 @@ index 103ad5f373a59fadb4783892579f3e681a8fd596..ab1065ce7b626ad242905dbbfec98839
|
|||||||
}
|
}
|
||||||
|
|
||||||
return nbt;
|
return nbt;
|
||||||
@@ -876,6 +887,9 @@ public final class ItemStack {
|
@@ -880,6 +891,9 @@ public final class ItemStack {
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
public void setTag(@Nullable CompoundTag nbt) {
|
public void setTag(@Nullable CompoundTag nbt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user