From f8594e7acbce6d4dcad021809c749f0308d85122 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 17 Nov 2024 03:52:08 +1300 Subject: [PATCH] We only use this in 1.21.3+ because it was added in 1.21.1 and its not worth the bug reports if it breaks from class missing --- .../utilities/reflection/ClassMappings.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ClassMappings.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ClassMappings.java index 5a967233..9790e72a 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ClassMappings.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ClassMappings.java @@ -1,6 +1,8 @@ package me.libraryaddict.disguise.utilities.reflection; +import io.papermc.paper.ServerBuildInfo; import me.libraryaddict.disguise.LibsDisguises; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import org.bukkit.Bukkit; import org.bukkit.scheduler.BukkitRunnable; @@ -91,7 +93,17 @@ public class ClassMappings { } private static String getVersion() { - return "Built for: " + Bukkit.getVersion() + "\t" + LibsDisguises.getInstance().getDescription().getVersion(); + String version = Bukkit.getVersion() + "\t" + LibsDisguises.getInstance().getDescription().getVersion(); + + if (DisguiseUtilities.isRunningPaper() && NmsVersion.v1_21_R2.isSupported()) { + ServerBuildInfo buildInfo = ServerBuildInfo.buildInfo(); + + if (buildInfo != null && buildInfo.buildTime() != null) { + version += "\t" + buildInfo.buildTime(); + } + } + + return "Built for: " + version; } private static File getFile(File dataFolder) {