Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/patches/api/0194-Expose-game-version.patch
2023-09-21 21:54:46 +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 f444294c96f6ab7362eacad47805c6b0f4afdc3a..1c0a7bba8cbab86382598e20b7b73f0fd2dabcae 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -157,6 +157,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 12d338b6751a04b626162f91c35cddaa49cdead1..62716a5a5e6936430f50bf725c061ef39952b96c 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -115,6 +115,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