Class ChunkParticlesSpawner

java.lang.Object
tfagaming.projects.minecraft.homestead.borders.ChunkParticlesSpawner

public class ChunkParticlesSpawner extends Object
Handles particle spawning around claimed region chunks for a specific player.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChunkParticlesSpawner(org.bukkit.entity.Player player)
    Creates a new ChunkParticlesSpawner for the given player.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    cancelTask(org.bukkit.entity.Player player)
    Cancels the active particle task for the given player, if any.
    static void
    cancelTask(TaskHandle task, org.bukkit.entity.Player player)
    Cancels the given task and removes it from the tracking map.
    static boolean
    isTaskRunning(org.bukkit.entity.Player player)
    Returns true if a particle task is currently running for the given player, otherwise false.
    void
    Re-fetches all regions from RegionManager and spawns border particles for each one.
    void
    Spawns border particles around the chunk boundaries of the given region.
    void
    Starts the repeating task that drives particle spawning.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ChunkParticlesSpawner

      public ChunkParticlesSpawner(org.bukkit.entity.Player player)
      Creates a new ChunkParticlesSpawner for the given player.
      Parameters:
      player - The player to show region borders for
  • Method Details

    • cancelTask

      public static void cancelTask(TaskHandle task, org.bukkit.entity.Player player)
      Cancels the given task and removes it from the tracking map.
      Parameters:
      task - The task handle to cancel
      player - The player associated with the task
    • cancelTask

      public static void cancelTask(org.bukkit.entity.Player player)
      Cancels the active particle task for the given player, if any.
      Parameters:
      player - The player whose task should be cancelled
    • isTaskRunning

      public static boolean isTaskRunning(org.bukkit.entity.Player player)
      Returns true if a particle task is currently running for the given player, otherwise false.
      Parameters:
      player - The player to check
    • spawnParticles

      public void spawnParticles()
      Re-fetches all regions from RegionManager and spawns border particles for each one.
    • spawnParticlesForRegion

      public void spawnParticlesForRegion(Region region)
      Spawns border particles around the chunk boundaries of the given region.
      Parameters:
      region - The region whose chunk borders should be visualised
    • startRepeatingEffect

      public void startRepeatingEffect()
      Starts the repeating task that drives particle spawning.