SPIGOT-6455, SPIGOT-7030, #750: Improve ban API

By: Doc <nachito94@msn.com>
This commit is contained in:
Bukkit/Spigot
2023-07-01 13:55:59 +10:00
parent ea46ef7a62
commit ba835793ed
9 changed files with 238 additions and 19 deletions

View File

@@ -1,6 +1,8 @@
package org.bukkit;
import java.util.Date;
import java.util.UUID;
import org.bukkit.ban.ProfileBanList;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.entity.AnimalTamer;
import org.bukkit.entity.EntityType;
@@ -58,12 +60,26 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
PlayerProfile getPlayerProfile();
/**
* Checks if this player is banned or not
* Checks if this player has had their profile banned.
*
* @return true if banned, otherwise false
*/
public boolean isBanned();
/**
* Adds this user to the {@link ProfileBanList}. If a previous ban exists, this will
* update the entry.
*
* @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
*/
@Nullable
public BanEntry<PlayerProfile> ban(@Nullable String reason, @Nullable Date expires, @Nullable String source);
/**
* Checks if this player is whitelisted or not
*