From 3cdd9f03ce0dc26ae5b40882ced7fb548a6b3e8c Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 18 Jun 2022 20:48:59 +1000 Subject: [PATCH] #758: Add missing server properties methods from 1.19 By: Doc --- .../src/main/java/org/bukkit/Bukkit.java | 31 +++++++++++++++++++ .../src/main/java/org/bukkit/Server.java | 25 +++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/Bukkit.java b/paper-api/src/main/java/org/bukkit/Bukkit.java index e85204a4ac..edeaa5d537 100644 --- a/paper-api/src/main/java/org/bukkit/Bukkit.java +++ b/paper-api/src/main/java/org/bukkit/Bukkit.java @@ -1007,6 +1007,26 @@ public final class Bukkit { server.setSpawnRadius(value); } + /** + * Gets whether the server should send a preview of the player's chat + * message to the client when the player sends a message + * + * @return true if the server should send a preview, false otherwise + */ + public static boolean shouldSendChatPreviews() { + return server.shouldSendChatPreviews(); + } + + /** + * Gets whether the server only allow players with Mojang-signed public key + * to join + * + * @return true if only Mojang-signed players can join, false otherwise + */ + public static boolean isEnforcingSecureProfiles() { + return server.isEnforcingSecureProfiles(); + } + /** * Gets whether the Server hide online players in server status. * @@ -1368,6 +1388,17 @@ public final class Bukkit { return server.createMerchant(title); } + /** + * Gets the amount of consecutive neighbor updates before skipping + * additional ones. + * + * @return the amount of consecutive neighbor updates, if the value is + * negative then the limit it's not used + */ + public static int getMaxChainedNeighborUpdates() { + return server.getMaxChainedNeighborUpdates(); + } + /** * Gets user-specified limit for number of monsters that can spawn in a * chunk. diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index 324e47f301..804453f54c 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -853,6 +853,22 @@ public interface Server extends PluginMessageRecipient { */ public void setSpawnRadius(int value); + /** + * Gets whether the server should send a preview of the player's chat + * message to the client when the player types a message + * + * @return true if the server should send a preview, false otherwise + */ + public boolean shouldSendChatPreviews(); + + /** + * Gets whether the server only allow players with Mojang-signed public key + * to join + * + * @return true if only Mojang-signed players can join, false otherwise + */ + public boolean isEnforcingSecureProfiles(); + /** * Gets whether the Server hide online players in server status. * @@ -1156,6 +1172,15 @@ public interface Server extends PluginMessageRecipient { @NotNull Merchant createMerchant(@Nullable String title); + /** + * Gets the amount of consecutive neighbor updates before skipping + * additional ones. + * + * @return the amount of consecutive neighbor updates, if the value is + * negative then the limit it's not used + */ + int getMaxChainedNeighborUpdates(); + /** * Gets user-specified limit for number of monsters that can spawn in a * chunk.