SPIGOT-6455, SPIGOT-7030, #750: Improve ban API
By: Doc <nachito94@msn.com>
This commit is contained in:
11
paper-api/src/main/java/org/bukkit/ban/IpBanList.java
Normal file
11
paper-api/src/main/java/org/bukkit/ban/IpBanList.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package org.bukkit.ban;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import org.bukkit.BanList;
|
||||
|
||||
/**
|
||||
* A {@link BanList} targeting IP bans.
|
||||
*/
|
||||
public interface IpBanList extends BanList<InetSocketAddress> {
|
||||
|
||||
}
|
||||
30
paper-api/src/main/java/org/bukkit/ban/ProfileBanList.java
Normal file
30
paper-api/src/main/java/org/bukkit/ban/ProfileBanList.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package org.bukkit.ban;
|
||||
|
||||
import java.util.Date;
|
||||
import org.bukkit.BanEntry;
|
||||
import org.bukkit.BanList;
|
||||
import org.bukkit.profile.PlayerProfile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* A {@link BanList} targeting player profile bans.
|
||||
*/
|
||||
public interface ProfileBanList extends BanList<PlayerProfile> {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @param target the target of the ban
|
||||
* @param reason reason for the ban, null indicates implementation default
|
||||
* @param expires date for the ban's expiration (unban), or null to imply
|
||||
* forever
|
||||
* @param source source of the ban, null indicates implementation default
|
||||
* @return the entry for the newly created ban, or the entry for the
|
||||
* (updated) previous ban
|
||||
* @throws IllegalArgumentException if ProfilePlayer has an invalid UUID
|
||||
*/
|
||||
@Nullable
|
||||
public BanEntry<PlayerProfile> addBan(@NotNull PlayerProfile target, @Nullable String reason, @Nullable Date expires, @Nullable String source);
|
||||
|
||||
}
|
||||
4
paper-api/src/main/java/org/bukkit/ban/package-info.java
Normal file
4
paper-api/src/main/java/org/bukkit/ban/package-info.java
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Classes relevant to bans.
|
||||
*/
|
||||
package org.bukkit.ban;
|
||||
Reference in New Issue
Block a user