Class ResourcePackManager

java.lang.Object
stawa.vitalstrike.resources.ResourcePackManager

public class ResourcePackManager extends Object
Manages the custom resource pack functionality for the VitalStrike plugin. Handles resource pack initialization, distribution, and status monitoring.
  • Constructor Details

    • ResourcePackManager

      public ResourcePackManager(VitalStrike plugin)
      Constructs a new ResourcePackManager instance.
      Parameters:
      plugin - The VitalStrike plugin instance
  • Method Details

    • sendResourcePack

      public void sendResourcePack(org.bukkit.entity.Player player)
      Sends the resource pack to a specific player if they haven't received it yet. Includes automatic reinitialization if the resource pack hash is not available.
      Parameters:
      player - The player to send the resource pack to
    • onResourcePackStatus

      public void onResourcePackStatus(org.bukkit.event.player.PlayerResourcePackStatusEvent event)
      Handles resource pack status change events from players. Monitors acceptance, decline, successful loading, and download failures. Provides appropriate feedback and logging for each status.
      Parameters:
      event - The resource pack status event
    • removePlayer

      public void removePlayer(UUID playerId)
      Removes a player from the tracked set of players who have received the resource pack.
      Parameters:
      playerId - The UUID of the player to remove
    • hasResourcePack

      public boolean hasResourcePack(UUID playerId)
      Checks if a player has the resource pack loaded.
      Parameters:
      playerId - The UUID of the player to check, or null for general check
      Returns:
      true if the player has the resource pack, false otherwise