mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 11:42:55 +01:00
Expose game version (#3274)
This commit is contained in:
parent
85fb00152a
commit
4d20537e6e
2 changed files with 78 additions and 0 deletions
52
Spigot-API-Patches/0201-Expose-game-version.patch
Normal file
52
Spigot-API-Patches/0201-Expose-game-version.patch
Normal file
|
@ -0,0 +1,52 @@
|
|||
From 12be987716c0516e0300b7e3b79bfa064747d46c 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 b9973406..d4af3a1d 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -118,6 +118,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 80f9abdc..08817f02 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -97,6 +97,16 @@ 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
|
||||
--
|
||||
2.25.1
|
26
Spigot-Server-Patches/0497-Expose-game-version.patch
Normal file
26
Spigot-Server-Patches/0497-Expose-game-version.patch
Normal file
|
@ -0,0 +1,26 @@
|
|||
From af32f51b7d7f78c747834086cecc8e87c6180a97 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
|
||||
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
|
||||
@@ -488,6 +488,13 @@ 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<CraftPlayer> getOnlinePlayers() {
|
||||
return this.playerView;
|
||||
--
|
||||
2.25.1
|
Loading…
Reference in a new issue