Package me.kzlyth.api.freeze


package me.kzlyth.api.freeze
API package for freezing players in Zenith-Mod.

This package contains the FreezeAPI class, which provides methods to freeze and unfreeze players. All freeze actions are automatically recorded in the history database with a case ID, and staff notifications are automatically sent.

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:

  • Freeze and unfreeze players
  • Check if a player is frozen
  • Get list of all frozen players
  • Automatic staff notifications

Important Notes:

  • Players must be online to be frozen
  • Players with the zenith.freeze.bypass permission cannot be frozen
  • All freezes are recorded in the history database (zn_history)
  • Each freeze receives a unique case ID
  • Staff notifications are automatically sent to players with zenith.freeze.notifications permission

Example usage:


 ZenithAPI api = ZenithAPI.getInstance();
 if (api != null) {
     FreezeAPI freezeAPI = api.getFreezeAPI();
     
     UUID playerUuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000");
     UUID staffUuid = UUID.fromString("00000000-0000-0000-0000-000000000001");
     
     // Freeze a player
     freezeAPI.freeze(playerUuid, staffUuid, "Investigation").thenAccept(success -> {
         if (success) {
             getLogger().info("Player frozen successfully");
         }
     });
     
     // Check if player is frozen
     freezeAPI.isFrozen(playerUuid).thenAccept(frozen -> {
         if (frozen) {
             getLogger().info("Player is frozen");
         }
     });
 }
 
Seit:
1.2.3
Autor:
Zenith-Studios
  • Klassen
    Klasse
    Beschreibung
    API for freezing players in Zenith-Mod.