Package me.kzlyth.api.ban


package me.kzlyth.api.ban
API package for banning and unbanning players in Zenith-Mod.

This package contains the BanAPI class, which provides methods to ban players (regular and IP bans), ban using templates (custom bans with escalation support), and unban players. All bans are automatically recorded in the history database with a case ID.

Database Compatibility: All methods in this API are fully compatible with H2, SQLite, MySQL, and MariaDB databases. The API automatically adapts to the configured database type from the configuration file.

Features:

  • Regular bans and IP bans
  • Template-based bans with escalation support
  • Online and offline player banning
  • Unban functionality
  • Custom duration formats (e.g., "1d", "2h", "30m", "permanent")

Important Notes:

  • Players with the zenith.ban.bypass permission cannot be banned
  • All bans are recorded in the history database (zn_history)
  • Each ban receives a unique case ID
  • Templates support escalation (duration increases with repeat offenses)

Example usage:


 ZenithAPI api = ZenithAPI.getInstance();
 if (api != null) {
     BanAPI banAPI = api.getBanAPI();
     
     UUID playerUuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000");
     banAPI.ban(playerUuid, "Cheating", "7d").thenAccept(caseId -> {
         getLogger().info("Player banned. Case ID: " + caseId);
     });
 }
 
Seit:
1.2.3
Autor:
Zenith-Studios
  • Klassen
    Klasse
    Beschreibung
    Represents complete information about an active ban for a player.
    API for banning and unbanning players in Zenith-Mod.