Package stawa.vitalstrike.resources
Class ResourcePackManager
java.lang.Object
stawa.vitalstrike.resources.ResourcePackManager
Manages the custom resource pack functionality for the VitalStrike plugin. Handles resource pack
initialization, distribution, and status monitoring.
-
Constructor Summary
ConstructorsConstructorDescriptionResourcePackManager(VitalStrike plugin) Constructs a new ResourcePackManager instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasResourcePack(UUID playerId) Checks if a player has the resource pack loaded.voidonResourcePackStatus(org.bukkit.event.player.PlayerResourcePackStatusEvent event) Handles resource pack status change events from players.voidremovePlayer(UUID playerId) Removes a player from the tracked set of players who have received the resource pack.voidsendResourcePack(org.bukkit.entity.Player player) Sends the resource pack to a specific player if they haven't received it yet.
-
Constructor Details
-
ResourcePackManager
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
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
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
-