mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-22 16:29:23 +00:00
Include time in startup logs
This commit is contained in:
@@ -1,20 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
||||||
Date: Sat, 1 Apr 2023 00:05:45 +0300
|
|
||||||
Subject: [PATCH] Paper PR - Deep clone unhandled nbt tags inside
|
|
||||||
CraftMetaItem's constuctor
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
|
||||||
index 7a4acbb32fbd600e629d0ec2e90868785320d822..7a0253782d8c699fcea929a7051fe3705e25ccc2 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
|
||||||
@@ -342,7 +342,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
|
||||||
this.destroyableKeys = new java.util.HashSet<>(meta.destroyableKeys);
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
- this.unhandledTags.putAll(meta.unhandledTags);
|
|
||||||
+ meta.unhandledTags.forEach((key, tag) -> this.unhandledTags.put(key, tag.copy())); // Paper - Deep clone unhandled nbt tags
|
|
||||||
this.persistentDataContainer.putAll(meta.persistentDataContainer.getRaw());
|
|
||||||
|
|
||||||
this.internalTag = meta.internalTag;
|
|
||||||
68
patches/server/0022-Include-time-in-startup-logs.patch
Normal file
68
patches/server/0022-Include-time-in-startup-logs.patch
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||||
|
Date: Sun, 2 Apr 2023 05:31:02 +0300
|
||||||
|
Subject: [PATCH] Include time in startup logs
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
|
index ab05f4151e6ec7404a85ddb3a141ed39d9ed86d7..2ca4492304d57d47e3f0b5f78e0ad7e13d045dcf 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
|
@@ -2,6 +2,7 @@ package org.bukkit.craftbukkit;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
+import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Calendar;
|
||||||
|
@@ -24,6 +25,26 @@ public class Main {
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
|
||||||
|
+ // DivineMC start - include time in startup logs
|
||||||
|
+ private static final DateFormat startupDateFormat = new SimpleDateFormat("hh:mm:ss");
|
||||||
|
+
|
||||||
|
+ private static void printlnStartupToSystemOut(String type, String line) {
|
||||||
|
+ System.out.println("[" + startupDateFormat.format(new Date()) + " " + type + "]: " + line);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public static void printlnStartupInfoToSystemOut(String line) {
|
||||||
|
+ printlnStartupToSystemOut("INFO", line);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public static void printlnStartupWarningToSystemOut(String line) {
|
||||||
|
+ printlnStartupToSystemOut("WARN", line);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public static void printlnStartupErrorToSystemOut(String line) {
|
||||||
|
+ printlnStartupToSystemOut("ERROR", line);
|
||||||
|
+ }
|
||||||
|
+ // DivineMC end
|
||||||
|
+
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// Paper start
|
||||||
|
final String warnWhenLegacyFormattingDetected = String.join(".", "net", "kyori", "adventure", "text", "warnWhenLegacyFormattingDetected");
|
||||||
|
@@ -309,17 +330,16 @@ public class Main {
|
||||||
|
// Paper start - Log Java and OS versioning to help with debugging plugin issues
|
||||||
|
java.lang.management.RuntimeMXBean runtimeMX = java.lang.management.ManagementFactory.getRuntimeMXBean();
|
||||||
|
java.lang.management.OperatingSystemMXBean osMX = java.lang.management.ManagementFactory.getOperatingSystemMXBean();
|
||||||
|
+ String javaInfo = "Java " + runtimeMX.getSpecVersion() + " (" + runtimeMX.getVmName() + " " + runtimeMX.getVmVersion() + ")"; // DivineMC - include time in startup logs
|
||||||
|
+ String osInfo = "Host: " + osMX.getName() + " " + osMX.getVersion() + " (" + osMX.getArch() + ")"; // DivineMC - include time in startup logs
|
||||||
|
if (runtimeMX != null && osMX != null) {
|
||||||
|
- String javaInfo = "Java " + runtimeMX.getSpecVersion() + " (" + runtimeMX.getVmName() + " " + runtimeMX.getVmVersion() + ")";
|
||||||
|
- String osInfo = "Host: " + osMX.getName() + " " + osMX.getVersion() + " (" + osMX.getArch() + ")";
|
||||||
|
-
|
||||||
|
- System.out.println("System Info: " + javaInfo + " " + osInfo);
|
||||||
|
+ printlnStartupInfoToSystemOut("System Info: " + javaInfo + " " + osInfo); // DivineMC - include time in startup logs
|
||||||
|
} else {
|
||||||
|
- System.out.println("Unable to read system info");
|
||||||
|
+ printlnStartupInfoToSystemOut("System Info: " + javaInfo + " " + osInfo); // DivineMC - include time in startup logs
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
System.setProperty( "library.jansi.version", "Paper" ); // Paper - set meaningless jansi version to prevent git builds from crashing on Windows
|
||||||
|
- System.out.println("Loading libraries, please wait...");
|
||||||
|
+ printlnStartupInfoToSystemOut("Loading libraries, please wait..."); // DivineMC - include time in startup logs
|
||||||
|
net.minecraft.server.Main.main(options);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
t.printStackTrace();
|
||||||
Reference in New Issue
Block a user