From 93040c71de4949bed80cc5725fa2e61f1be4a9b3 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 3 Sep 2011 02:13:37 +0100 Subject: [PATCH] Added new methods to Server, Player and OfflinePlayer for banning and unbanning By: Dinnerbone --- paper-api/src/main/java/org/bukkit/Bukkit.java | 4 ++++ .../src/main/java/org/bukkit/OfflinePlayer.java | 14 ++++++++++++++ paper-api/src/main/java/org/bukkit/Server.java | 7 +++++++ 3 files changed, 25 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/Bukkit.java b/paper-api/src/main/java/org/bukkit/Bukkit.java index 9ad8de0899..dd601dcf6a 100644 --- a/paper-api/src/main/java/org/bukkit/Bukkit.java +++ b/paper-api/src/main/java/org/bukkit/Bukkit.java @@ -240,4 +240,8 @@ public final class Bukkit { public static void unbanIP(String address) { server.unbanIP(address); } + + public Set getBannedPlayers() { + return server.getBannedPlayers(); + } } diff --git a/paper-api/src/main/java/org/bukkit/OfflinePlayer.java b/paper-api/src/main/java/org/bukkit/OfflinePlayer.java index ffb32ee9d9..469e54dc93 100644 --- a/paper-api/src/main/java/org/bukkit/OfflinePlayer.java +++ b/paper-api/src/main/java/org/bukkit/OfflinePlayer.java @@ -16,4 +16,18 @@ public interface OfflinePlayer extends ServerOperator { * @return Player name */ public String getName(); + + /** + * Checks if this player is banned or not + * + * @return true if banned, otherwise false + */ + public boolean isBanned(); + + /** + * Bans or unbans this player + * + * @param banned true if banned + */ + public void setBanned(boolean banned); } diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index 036ec47ec3..9467d74938 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -407,4 +407,11 @@ public interface Server { * @param address IP address to unban */ public void unbanIP(String address); + + /** + * Gets a set containing all banned players + * + * @return Set containing banned players + */ + public Set getBannedPlayers(); }