java.lang.Object
tfagaming.projects.minecraft.homestead.tools.minecraft.players.PlayerUtility

public final class PlayerUtility extends Object
  • Field Details

    • RENT_FLAGS_SET

      public static final Set<Long> RENT_FLAGS_SET
    • WAR_FLAGS_SET

      public static final Set<Long> WAR_FLAGS_SET
  • Method Details

    • sendMessageRegionEnter

      public static void sendMessageRegionEnter(org.bukkit.entity.Player player, Placeholder placeholder)
    • sendMessageRegionExit

      public static void sendMessageRegionExit(org.bukkit.entity.Player player, Placeholder placeholder)
    • teleportPlayerToChunkSafely

      public static void teleportPlayerToChunkSafely(org.bukkit.entity.Player player, RegionChunk chunk, @Nullable @Nullable Runnable after)
      Teleport a player to a chunk safely, thread-safe for Folia.
    • teleportPlayerToChunk

      public static void teleportPlayerToChunk(org.bukkit.entity.Player player, org.bukkit.Chunk chunk)
    • teleportPlayer

      public static void teleportPlayer(org.bukkit.entity.Player player, org.bukkit.Location location)
    • isOperator

      public static boolean isOperator(org.bukkit.entity.Player player)
    • isOperator

      public static boolean isOperator(org.bukkit.OfflinePlayer player)
    • hasPermissionFlag

      public static boolean hasPermissionFlag(long regionId, org.bukkit.entity.Player player, long flag, boolean notify)
      Checks whether the given player has the specified player flag in the target region. If the player lacks the permission, a cooldown-gated info message is sent, except for the TAKE_FALL_DAMAGE flag where no message is shown.

      Resolution order:
      1. If the player is the active renter of the region, permissions are granted for all flags except PVP.
      2. Otherwise, if the player is a member, the member flags are used.
      3. Otherwise, the region's global player flags are used.

      Parameters:
      regionId - The region ID
      player - The player to fetch
      flag - The PlayerFlags bit to fetch
      Returns:
      true If the action is allowed; false otherwise
    • hasPermissionFlag

      public static boolean hasPermissionFlag(long regionId, long subAreaId, org.bukkit.entity.Player player, long flag, boolean notify)
    • hasControlRegionPermissionFlag

      public static boolean hasControlRegionPermissionFlag(long regionId, org.bukkit.entity.Player player, long flag)
    • getPlayerGroup

      public static String getPlayerGroup(org.bukkit.OfflinePlayer player)