From 4564d6b5660429b8f547916885275d0d7b8dc484 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Sat, 2 May 2020 10:56:08 +0200 Subject: [PATCH] Expose game version (#3274) --- Spigot-API-Patches/Expose-game-version.patch | 51 +++++++++++++++++++ .../Expose-game-version.patch | 25 +++++++++ 2 files changed, 76 insertions(+) create mode 100644 Spigot-API-Patches/Expose-game-version.patch create mode 100644 Spigot-Server-Patches/Expose-game-version.patch diff --git a/Spigot-API-Patches/Expose-game-version.patch b/Spigot-API-Patches/Expose-game-version.patch new file mode 100644 index 0000000000..e5a3a523af --- /dev/null +++ b/Spigot-API-Patches/Expose-game-version.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mark Vainomaa +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 b9973406..d4af3a1d 100644 +--- a/src/main/java/org/bukkit/Bukkit.java ++++ b/src/main/java/org/bukkit/Bukkit.java +@@ -0,0 +0,0 @@ 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 80f9abdc..08817f02 100644 +--- a/src/main/java/org/bukkit/Server.java ++++ b/src/main/java/org/bukkit/Server.java +@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { + @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 +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Expose-game-version.patch b/Spigot-Server-Patches/Expose-game-version.patch new file mode 100644 index 0000000000..957a996b6d --- /dev/null +++ b/Spigot-Server-Patches/Expose-game-version.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mark Vainomaa +Date: Fri, 1 May 2020 17:39:26 +0300 +Subject: [PATCH] Expose game version + + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index b9a398bc5..5bd6f2a88 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -0,0 +0,0 @@ public final class CraftServer implements Server { + return bukkitVersion; + } + ++ // Paper start - expose game version ++ @Override ++ public String getMinecraftVersion() { ++ return console.getVersion(); ++ } ++ // Paper end ++ + @Override + public List getOnlinePlayers() { + return this.playerView; +-- \ No newline at end of file