Class CooldownSender

java.lang.Object
net.flectone.pulse.platform.sender.CooldownSender

public class CooldownSender extends Object
Sends cooldown messages to players and checks cooldown bypass permissions.

Usage example:

CooldownSender cooldownSender = flectonePulse.get(CooldownSender.class);

Cooldown cooldown = new Cooldown(5000, true); // 5 second cooldown
PermissionSetting permissionByPass = new PermissionSetting("myplugin.bypass", false);

if (cooldownSender.sendIfCooldown(player, Pair.of(cooldown, permissionByPass))) {
    // Player is on cooldown, action should be blocked
}
Since:
1.6.0
  • Constructor Details

  • Method Details

    • sendIfCooldown

      public boolean sendIfCooldown(FEntity entity, Optional<org.apache.commons.lang3.tuple.Pair<Cooldown, PermissionSetting>> optionalCooldown, String cooldownOwner)
      Checks if an entity is on cooldown and sends a cooldown message if applicable. Only sends messages to players, not other entities.
      Parameters:
      entity - the entity to check
      optionalCooldown - optional pair of cooldown and permission settings
      cooldownOwner - name of the owner that checks cooldown
      Returns:
      true if cooldown message was sent, false otherwise
    • sendIfCooldown

      public boolean sendIfCooldown(FEntity entity, org.apache.commons.lang3.tuple.Pair<Cooldown, PermissionSetting> cooldownPermission, String cooldownOwner)
      Checks if a player is on cooldown and sends a formatted cooldown message.
      Parameters:
      entity - the entity to check
      cooldownPermission - pair of cooldown settings and bypass permission
      cooldownOwner - name of the owner that checks cooldown
      Returns:
      true if cooldown message was sent, false otherwise