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

This commit is contained in:
libraryaddict 2024-11-17 03:52:08 +13:00
parent c7f5201e00
commit f8594e7acb

View File

@ -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) {