Class DefaultPunishmentManager
java.lang.Object
de.jvstvshd.necrify.velocity.impl.DefaultPunishmentManager
- All Implemented Interfaces:
PunishmentManager
@Deprecated(since="1.2.0",
forRemoval=true)
@ScheduledForRemoval(inVersion="1.3.0")
public class DefaultPunishmentManager
extends Object
implements PunishmentManager
Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultPunishmentManager(com.velocitypowered.api.proxy.ProxyServer proxyServer, com.zaxxer.hikari.HikariDataSource dataSource, NecrifyVelocityPlugin plugin) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptioncreateBan(UUID player, net.kyori.adventure.text.Component reason, PunishmentDuration duration) Deprecated, for removal: This API element is subject to removal in a future version.Prepares a ban for a player with custom reason and duration.createMute(UUID player, net.kyori.adventure.text.Component reason, PunishmentDuration duration) Deprecated, for removal: This API element is subject to removal in a future version.Prepares a mute for a player with custom reason and duration.getPunishment(UUID punishmentId, Executor service) Deprecated, for removal: This API element is subject to removal in a future version.Queries the punishment stored with the givenpunishmentIdgetPunishments(UUID player, Executor service, PunishmentType... types) Deprecated, for removal: This API element is subject to removal in a future version.This method queries all punishments with the givenUUIDof a player and returns them in a list.com.velocitypowered.api.proxy.ProxyServerDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Checks whether the player specified viaplayerUuid.plugin()Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.jvstvshd.necrify.api.punishment.PunishmentManager
createPermanentBan, createPermanentMute
-
Constructor Details
-
DefaultPunishmentManager
public DefaultPunishmentManager(com.velocitypowered.api.proxy.ProxyServer proxyServer, com.zaxxer.hikari.HikariDataSource dataSource, NecrifyVelocityPlugin plugin) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
createBan
public Ban createBan(UUID player, net.kyori.adventure.text.Component reason, PunishmentDuration duration) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:PunishmentManagerPrepares a ban for a player with custom reason and duration.- Specified by:
createBanin interfacePunishmentManager- Parameters:
player- the uuid of the player which should be banned (by either {link Player#getUniqueId() orPlayerResolver.getPlayerUuid(String).reason- the reason given as aComponent.duration- the duration, which can be created viaPunishmentDuration.parse(String)when it's source is from minecraft commands.- Returns:
- the prepared ban with the given reason and duration. This duration remains the same at any duration since it is only added when the player is banned.
Only
Punishment.punish()is needed to execute the punishment.
-
createMute
public Mute createMute(UUID player, net.kyori.adventure.text.Component reason, PunishmentDuration duration) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:PunishmentManagerPrepares a mute for a player with custom reason and duration.- Specified by:
createMutein interfacePunishmentManager- Parameters:
player- the uuid of the player which should be banned (by either Player#getUniqueId() orPlayerResolver.getPlayerUuid(String).reason- the reason given as aComponent.duration- the duration, which can be created viaPunishmentDuration.parse(String)when it's source is from minecraft commands.- Returns:
- the prepared ban with the given reason and duration. This duration remains the same at any duration since it is only added when the player is banned.
Only
Punishment.punish()is needed to execute the punishment.
-
getPunishments
public CompletableFuture<List<Punishment>> getPunishments(UUID player, Executor service, PunishmentType... types) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:PunishmentManagerThis method queries all punishments with the givenUUIDof a player and returns them in a list.- Specified by:
getPunishmentsin interfacePunishmentManager- Parameters:
player- the player whose punishments should be queried- Returns:
- the list of punishments which are stored at the moment. This list may contains punishments which are over.
-
getPunishment
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:PunishmentManagerQueries the punishment stored with the givenpunishmentId- Specified by:
getPunishmentin interfacePunishmentManager- Parameters:
punishmentId- the punishment id from the punishment that should be queriedservice- anExecutorwhich will be used to perform async operations- Returns:
- an
Optionalcontaining the queried punishment orOptional.empty()if it was not found
-
getServer
public com.velocitypowered.api.proxy.ProxyServer getServer()Deprecated, for removal: This API element is subject to removal in a future version. -
plugin
Deprecated, for removal: This API element is subject to removal in a future version. -
isBanned
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:PunishmentManagerChecks whether the player specified viaplayerUuid. By default this method must not be overwritten and throws anUnsupportedOperationException- Specified by:
isBannedin interfacePunishmentManager- Parameters:
playerUuid- the uuid of the playerexecutor- anExecutorused for async operations- Returns:
- a
CompletableFuture, being completed with true if this player is banned and false if not
-