API patches
This commit is contained in:
parent
56e64243ed
commit
028e2d9f00
381 changed files with 263 additions and 311 deletions
48
patches/api/0214-Add-setMaxPlayers-API.patch
Normal file
48
patches/api/0214-Add-setMaxPlayers-API.patch
Normal file
|
@ -0,0 +1,48 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mariell Hoversholm <proximyst@proximyst.com>
|
||||
Date: Sat, 22 Aug 2020 23:59:25 +0200
|
||||
Subject: [PATCH] Add #setMaxPlayers API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 43674a3fb8b0b1dc4bef13ecaf83f68f06b29ec1..4eafa8f3342648d0b58642102d6c75a8a79c9764 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -188,6 +188,17 @@ public final class Bukkit {
|
||||
return server.getMaxPlayers();
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Set the maximum amount of players which can login to this server.
|
||||
+ *
|
||||
+ * @param maxPlayers the amount of players this server allows
|
||||
+ */
|
||||
+ public static void setMaxPlayers(int maxPlayers) {
|
||||
+ server.setMaxPlayers(maxPlayers);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Get the game port that the server runs on.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index c11d802408c793c6410118bd281a21e59394066f..a7ba813396fab77bed292422f881b5a0952972fb 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -159,6 +159,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
public int getMaxPlayers();
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Set the maximum amount of players which can login to this server.
|
||||
+ *
|
||||
+ * @param maxPlayers the amount of players this server allows
|
||||
+ */
|
||||
+ public void setMaxPlayers(int maxPlayers);
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Get the game port that the server runs on.
|
||||
*
|
Loading…
Add table
Add a link
Reference in a new issue