Class GraveProtectionRole

java.lang.Object
dev.cwhead.GravesX.graveutils.GraveProtectionRole

public class GraveProtectionRole extends Object
Utility class for determining a player's role relative to a grave.

Supports both Java and Bedrock players via Floodgate/Floodgate UUID normalization. Provides methods to get the player's role as an enum for internal plugin logic or API usage.

  • Constructor Details

    • GraveProtectionRole

      public GraveProtectionRole(Graves plugin)
      Constructs a new GraveProtectionRole utility with the plugin instance.
      Parameters:
      plugin - the main Graves plugin instance
  • Method Details

    • getRole

      public GraveProtectionRole.GraveRole getRole(Grave grave, UUID playerId)
      Determines the role of a player for a given grave, using their normalized UUID.

      This method handles Floodgate UUID normalization if required. The role can be OWNER, KILLER, OTHER, MISSING_OWNER, or MISSING_OTHER.

      Parameters:
      grave - the grave to check
      playerId - the normalized UUID of the player
      Returns:
      the GraveProtectionRole.GraveRole representing the player's role relative to the grave
    • getRole

      public GraveProtectionRole.GraveRole getRole(org.bukkit.entity.Player player, Grave grave)
      Convenience method to determine a player's role relative to a grave.

      Automatically normalizes the player's UUID if Floodgate is present.

      Parameters:
      player - the player to check
      grave - the grave to check
      Returns:
      the GraveProtectionRole.GraveRole representing the player's role relative to the grave