mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 12:13:54 -07:00
#882: Add modern time API methods to ban API
By: Yannick Lamprecht <yannicklamprecht@live.de>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.bukkit;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
import org.bukkit.ban.ProfileBanList;
|
||||
@@ -80,6 +82,34 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
@Nullable
|
||||
public BanEntry<PlayerProfile> ban(@Nullable String reason, @Nullable Date expires, @Nullable String source);
|
||||
|
||||
/**
|
||||
* 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 instant 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 Instant expires, @Nullable String source);
|
||||
|
||||
/**
|
||||
* 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 duration how long the ban last, 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 Duration duration, @Nullable String source);
|
||||
|
||||
/**
|
||||
* Checks if this player is whitelisted or not
|
||||
*
|
||||
|
Reference in New Issue
Block a user