Added 3 methods to Server for IP banning and unbanning

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot 2011-09-03 01:59:08 +01:00
parent fdd66c057c
commit 6d43d89f5e
2 changed files with 35 additions and 0 deletions

View File

@ -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<String> getIPBans() {
return server.getIPBans();
}
public static void banIP(String address) {
server.banIP(address);
}
public static void unbanIP(String address) {
server.unbanIP(address);
}
}

View File

@ -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<String> 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);
}