Class RegionManager

java.lang.Object
com.plotsquared.core.util.RegionManager

public abstract class RegionManager extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • getRegion

      public static com.sk89q.worldedit.math.BlockVector2 getRegion(Location location)
    • countEntities

      public abstract int[] countEntities(Plot plot)
      0 = Entity 1 = Animal 2 = Monster 3 = Mob 4 = Boat 5 = Misc
      Parameters:
      plot - plot
      Returns:
      array of counts of entity types
    • deleteRegionFiles

      public void deleteRegionFiles(String world, Collection<com.sk89q.worldedit.math.BlockVector2> chunks, Runnable whenDone)
    • setCuboids

      public boolean setCuboids(@NonNull PlotArea area, @NonNull Set<com.sk89q.worldedit.regions.CuboidRegion> regions, @NonNull com.sk89q.worldedit.function.pattern.Pattern blocks, int minY, int maxY, @Nullable PlotPlayer<?> actor, @Nullable QueueCoordinator queue)
      Set a number of cuboids to a certain block between two y values.
      Parameters:
      area - plot area
      regions - cuboid regions
      blocks - pattern
      minY - y to set from
      maxY - y to set to
      actor - the actor associated with the cuboid set
      queue - Nullable QueueCoordinator. If null, creates own queue and enqueues, otherwise writes to the queue but does not enqueue.
      Returns:
      true if not enqueued, otherwise whether the created queue enqueued.
    • notifyClear

      public boolean notifyClear(PlotManager manager)
      Notify any plugins that may want to modify clear behaviour that a clear is occuring
      Parameters:
      manager - plot manager
      Returns:
      true if the notified will accept the clear task
    • handleClear

      public abstract boolean handleClear(@NonNull Plot plot, @Nullable Runnable whenDone, @NonNull PlotManager manager, @Nullable PlotPlayer<?> actor)
      Only called when notifyClear(PlotManager) returns true in specific PlotManagers
      Parameters:
      plot - plot
      whenDone - task to run when complete
      manager - plot manager
      actor - the player running the clear
      Returns:
      true if the clear worked. False if someone went wrong so P2 can then handle the clear
    • copyRegion

      public boolean copyRegion(@NonNull Location pos1, @NonNull Location pos2, @NonNull Location newPos, @Nullable PlotPlayer<?> actor, @NonNull Runnable whenDone)
      Copy a region to a new location (in the same world)
      Parameters:
      pos1 - position 1
      pos2 - position 2
      newPos - position to move pos1 to
      actor - the actor associated with the region copy
      whenDone - task to run when complete
      Returns:
      success or not
    • regenerateRegion

      public abstract boolean regenerateRegion(Location pos1, Location pos2, boolean ignoreAugment, Runnable whenDone)
      Assumptions:
      - pos1 and pos2 are in the same plot
      It can be harmful to the world if parameters outside this scope are provided
      Parameters:
      pos1 - position 1
      pos2 - position 2
      ignoreAugment - if to bypass synchronisation ish thing
      whenDone - task to run when regeneration completed
      Returns:
      success or not
    • clearAllEntities

      public abstract void clearAllEntities(Location pos1, Location pos2)
    • swap

      public void swap(Location pos1, Location pos2, Location swapPos, @Nullable PlotPlayer<?> actor, Runnable whenDone)
      Swap two regions within the same world
      Parameters:
      pos1 - position 1
      pos2 - position 2
      swapPos - position to swap with
      actor - the actor associated with the region copy
      whenDone - task to run when complete
    • setBiome

      public void setBiome(com.sk89q.worldedit.regions.CuboidRegion region, int extendBiome, com.sk89q.worldedit.world.biome.BiomeType biome, String world, Runnable whenDone)