From a5ce775b3e761894cf7e86bb8ad014f276a1ebdf Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Sat, 3 Sep 2011 01:59:08 +0100 Subject: Added 3 methods to Server for IP banning and unbanning --- src/main/java/org/bukkit/Bukkit.java | 13 +++++++++++++ src/main/java/org/bukkit/Server.java | 22 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'src/main') diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index ca1e537a..9ad8de08 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -3,6 +3,7 @@ package org.bukkit; import com.avaje.ebean.config.ServerConfig; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.UUID; import java.util.logging.Logger; import org.bukkit.World.Environment; @@ -227,4 +228,16 @@ public final class Bukkit { public static OfflinePlayer getOfflinePlayer(String name) { return server.getOfflinePlayer(name); } + + public static Set getIPBans() { + return server.getIPBans(); + } + + public static void banIP(String address) { + server.banIP(address); + } + + public static void unbanIP(String address) { + server.unbanIP(address); + } } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index 51b90f4e..036ec47e 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -7,6 +7,7 @@ import org.bukkit.inventory.Recipe; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.UUID; import java.util.logging.Logger; import org.bukkit.command.PluginCommand; @@ -385,4 +386,25 @@ public interface Server { * @return OfflinePlayer object */ public OfflinePlayer getOfflinePlayer(String name); + + /** + * Gets a set containing all current IPs that are banned + * + * @return Set containing banned IP addresses + */ + public Set getIPBans(); + + /** + * Bans the specified address from the server + * + * @param address IP address to ban + */ + public void banIP(String address); + + /** + * Unbans the specified address from the server + * + * @param address IP address to unban + */ + public void unbanIP(String address); } -- cgit v1.2.3