Paper/patches/api/0194-Expose-game-version.patch
2023-06-13 09:10:07 +02:00

51 Zeilen
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Fri, 1 May 2020 17:39:02 +0300
Subject: [PATCH] Expose game version
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 725de23dc102e3b63da5e49bb1eafca96e33fc4c..dfeaddc2d71f8569c349740c00c96868f9a56a12 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -156,6 +156,18 @@ public final class Bukkit {
return server.getBukkitVersion();
}
+ // Paper start - expose game version
+ /**
+ * Gets the version of game this server implements
+ *
+ * @return version of game
+ */
+ @NotNull
+ public static String getMinecraftVersion() {
+ return server.getMinecraftVersion();
+ }
+ // Paper end
+
/**
* Gets a view of all currently logged in players. This {@linkplain
* Collections#unmodifiableCollection(Collection) view} is a reused
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 960fc19a04bc3475bd81301ec283c9bb32f62821..ccec37c00f8ab318d41350907b40a64118e4fab1 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -114,6 +114,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull
public String getBukkitVersion();
+ // Paper start - expose game version
+ /**
+ * Gets the version of game this server implements
+ *
+ * @return version of game
+ */
+ @NotNull
+ String getMinecraftVersion();
+ // Paper end
+
/**
* Gets a view of all currently logged in players. This {@linkplain
* Collections#unmodifiableCollection(Collection) view} is a reused