mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 17:57:34 +01:00
Added 3 methods to Server for IP banning and unbanning
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
fdd66c057c
commit
6d43d89f5e
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user