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 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: PunishmentManager
      Prepares a ban for a player with custom reason and duration.
      Specified by:
      createBan in interface PunishmentManager
      Parameters:
      player - the uuid of the player which should be banned (by either {link Player#getUniqueId() or PlayerResolver.getPlayerUuid(String).
      reason - the reason given as a Component.
      duration - the duration, which can be created via PunishmentDuration.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: PunishmentManager
      Prepares a mute for a player with custom reason and duration.
      Specified by:
      createMute in interface PunishmentManager
      Parameters:
      player - the uuid of the player which should be banned (by either Player#getUniqueId() or PlayerResolver.getPlayerUuid(String).
      reason - the reason given as a Component.
      duration - the duration, which can be created via PunishmentDuration.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: PunishmentManager
      This method queries all punishments with the given UUID of a player and returns them in a list.
      Specified by:
      getPunishments in interface PunishmentManager
      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

      public CompletableFuture<Optional<Punishment>> getPunishment(UUID punishmentId, Executor service)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: PunishmentManager
      Queries the punishment stored with the given punishmentId
      Specified by:
      getPunishment in interface PunishmentManager
      Parameters:
      punishmentId - the punishment id from the punishment that should be queried
      service - an Executor which will be used to perform async operations
      Returns:
      an Optional containing the queried punishment or Optional.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

      public NecrifyVelocityPlugin plugin()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isBanned

      public CompletableFuture<Boolean> isBanned(UUID playerUuid, Executor executor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: PunishmentManager
      Checks whether the player specified via playerUuid. By default this method must not be overwritten and throws an UnsupportedOperationException
      Specified by:
      isBanned in interface PunishmentManager
      Parameters:
      playerUuid - the uuid of the player
      executor - an Executor used for async operations
      Returns:
      a CompletableFuture, being completed with true if this player is banned and false if not