Class PlotAPI

java.lang.Object
com.plotsquared.core.PlotAPI

public class PlotAPI extends Object
PlotSquared API.

Useful classes:

  • Constructor Details

    • PlotAPI

      public PlotAPI()
  • Method Details

    • getAllPlots

      public @NonNull Set<@NonNull Plot> getAllPlots()
      Gets all plots.
      Returns:
      all plots
    • getPlayerPlots

      public @NonNull Set<@NonNull Plot> getPlayerPlots(@NonNull PlotPlayer<?> player)
      Gets all plots for a player.
      Parameters:
      player - Player, whose plots to search for
      Returns:
      all plots that a player owns
    • addPlotArea

      public void addPlotArea(@NonNull PlotArea plotArea)
      Adds a plot world.
      Parameters:
      plotArea - Plot World Object
      See Also:
      PlotSquared.addPlotArea(PlotArea)
    • getChunkManager

      public @NonNull ChunkManager getChunkManager()
      ChunkManager class contains several useful methods.
      • Chunk deletion
      • Moving or copying regions
      • Plot swapping
      • Entity Tracking
      • Region Regeneration
      Returns:
      ChunkManager
      See Also:
      ChunkManager
    • getBlockQueue

      public @NonNull GlobalBlockQueue getBlockQueue()
      Gets the block/biome set queue
      Returns:
      GlobalBlockQueue.IMP
    • getSchematicHandler

      public @NonNull SchematicHandler getSchematicHandler()
      SchematicHandler class contains methods related to pasting, reading and writing schematics.
      Returns:
      SchematicHandler
      See Also:
      SchematicHandler
    • getPlotAreas

      public @NonNull Set<@NonNull PlotArea> getPlotAreas(@Nullable String world)
      Gets a list of PlotAreas in the world.
      Parameters:
      world - The world to check for plot areas
      Returns:
      A set of PlotAreas
    • sendConsoleMessage

      public void sendConsoleMessage(@NonNull String message, @NonNull net.kyori.adventure.text.minimessage.Template @NonNull ... replacements)
      Send a message to the console. The message supports color codes.
      Parameters:
      message - the message
      replacements - Variable replacements
    • sendConsoleMessage

      public void sendConsoleMessage(@NonNull Caption caption, @NonNull net.kyori.adventure.text.minimessage.Template @NonNull ... replacements)
      Sends a message to the console.
      Parameters:
      caption - the message
      replacements - Variable replacements
    • getPlotSquared

      public @NonNull PlotSquared getPlotSquared()
      Gets the PlotSquared class.
      Returns:
      PlotSquared Class
      See Also:
      PlotSquared
    • wrapPlayer

      public @Nullable PlotPlayer<?> wrapPlayer(@NonNull UUID uuid)
      Gets the PlotPlayer for a UUID.

      Please note that PlotSquared can be configured to provide different UUIDs than Bukkit

      Parameters:
      uuid - the uuid of the player to wrap
      Returns:
      a PlotPlayer
    • wrapPlayer

      public @Nullable PlotPlayer<?> wrapPlayer(@NonNull String player)
      Gets the PlotPlayer for a username.
      Parameters:
      player - the player to wrap
      Returns:
      a PlotPlayer
    • registerListener

      public void registerListener(@NonNull Object listener)
      Registers a listener for PlotSquared Events
      Parameters:
      listener - the listener class to register
      See Also:
      EventDispatcher.registerListener(Object)