Plotz API

Jan 8, 2015
Plotz API
  • Basic API functions

    Using the API:
    Getting a plot by a location

    Code (Text):
    Plotz.getPlotByLocation(Location)
    Setting a plot owner
    Code (Text):
    Plotz.getPlotByLocation(Player).setOwner(Player.getUniqueId)
    Adding a command
    Code (Text):
    Plotz.addCommand(String[], PCommand)
    Example plugin: Plotz Greetings (Source included with jar)

    Plotz (me.kyle.plotz.api.Plotz)


    /**
    * Gets the plot the player is on
    *
    * @param player the player
    * @return - Plot player is on, null if not on plot
    */
    public static Plot getPlotByLocation(Player player)


    /**
    * Gets the plot the player is on
    *
    * @param location the location
    * @return - Plot player is on, null if not on plot
    */
    public static Plot getPlotByLocation(Location location)


    /**
    * Adds a sub command
    *
    * @param aliases - Array of acceptable subcommands
    * @param command - PCommand instance
    */
    public static void addCommand(String[] aliases, PCommand command)


    /**
    * Removes a sub command
    *
    * @param subcommand - the command to be removed
    */
    @Deprecated
    public static void removeCommand(String subcommand)


    /**
    * Removes all matching sub commands
    *
    * @param subcommand - the label to search
    */
    @Deprecated
    public static void removeCommands(String subcommand)


    /**
    * Get the plugin version as in the plugin.yml
    * @return - plugin version
    */
    public static double getPluginVersion()


    /**
    * Get the latest version of the plugin
    *
    * @return - latest version
    */
    public static double getLatestVersion()


    /**
    * Checks if a player is on a plot
    *
    * @param p the p
    * @return - if the player is on a plot
    */
    public static boolean isOnPlot(Player p)


    /**
    * Checks if a location is on a plot
    *
    * @param l the l
    * @return - if the location is on a plot
    */
    public static boolean isOnPlot(Location l)


    /**
    * Gets the lang string.
    *
    * @param key - the key in the lang.yml configuration
    * @return - Value
    */
    public static String getLangString(String key)


    /**
    * Get the plugin prefix
    *
    * @return - plugin prefix
    */
    public static String getPrefix()


    /**
    * Get all plots a player owns
    *
    * @param player - UUID of plot owner
    * @param world - World name
    */
    public static List<Plot> getAllPlots(UUID player, String world)


    /**
    * Sets the handler for permission checks for this plugin
    *
    * @param handler - Permissions handler object, returns true if the player has the permission
    * and false if the player does not have the permission
    */
    public static void setPermissionsHandler(PermissionsHandler handler)


    Plot (me.kyle.plotz.obj.Plot)

    /**
    * Resets the expiration time for this plot
    */
    public void resetExpireTime()


    /**
    * Remove a plot admin
    */
    public void removeAdmin(UUID id)


    /**
    * Get the expiration date of this plot
    * Returns 0 if expiration date is not set
    * @return - returns the long time that the plot will expire
    */
    public long getExpirationDate()


    /**
    * Returns when the plot was last walked on
    * @return
    */
    public long getLastSeen()


    /**
    * Set when the plot was last used
    * @param lastSeen
    */
    public void setLastSeen(long lastSeen)


    /**
    * Bump the last seen time
    */
    public void bumpLastSeen()


    /**
    * Returns if the plot is set to expire or if the plot is ignoring the expire time
    * This also will return true if the plot cleaner is disabled as the default value is true
    * @return
    */
    public boolean isExpire()


    /**
    * Sets if the plot will expire or not
    * @param expire
    */
    public void setExpire(boolean expire)


    /**
    * Get the time left until the plot expires
    * Returns 2^61-1 if the expiration date is not set
    * @return - time in ms until plot expires
    */
    public long getTimeLeft()


    /**
    * Get all plot options
    * @return - plot options (String name, Object value)
    */
    public HashMap<String, Object> getOptions()


    /**
    * Set plot options
    * @param options - plot options, (String, Object)
    */
    public void setOptions(HashMap<String, Object> options)


    /**
    * Get a list of plot admins
    * Any changes to this list are not saved
    * Use setAdmins instead
    * @return
    */
    @SuppressWarnings("unchecked")
    public List<UUID> getAdmins()


    /**
    * Set plot admins
    * @return
    */
    @SuppressWarnings("unchecked")
    public void setAdmins(List<UUID> ids)


    /**
    * Check if plot options contains key
    * @param key - Name
    * @return boolean
    */
    public boolean contains(String key)


    /**
    * Get plot option
    * @param name - key of option
    * @return - value of option
    */
    public <T> T get(String name)


    /**
    * Set an entry in the plot options
    * @param key
    * @param value
    */
    public void set(String key, Object value)


    /**
    * Remove a key from the plot options
    * @param key - The key to remove
    */
    public void remove(String key)


    /**
    * Get custom name of plot
    * @return - name of plot
    */
    public String getName()


    /**
    * Set custom name of plot
    * @param name
    */
    public void setName(String name)


    /**
    * Get the plot home number relitive to the owner
    * @return
    */
    public int getHomeNumber()


    /**
    * Gets the maximum bid for this plot
    * @return - Bid object
    */
    public Bid getMaxBid()


    /**
    * Can players pvp on this plot
    * @return
    */
    public boolean isPvp()


    /**
    * Get plot comments
    * @return
    */
    public HashMap<UUID, String> getComments()


    /**
    * Set plot comments
    * @param comments
    */
    public void setComments(HashMap<UUID, String> comments)


    /**
    * Get plot world
    * @return
    */
    public World getWorld()


    /**
    * Get plot max point
    * @return
    */
    public Location getMax()


    /**
    * Get plot min point
    * @return
    */
    public Location getMin()


    /**
    * Plot IDX
    * @return
    */
    public int getIdX()


    /**
    * Plot IDZ
    * @return
    */
    public int getIdZ()


    /**
    * Plot owner UUID
    * @return
    */
    public UUID getOwner()


    /**
    * Plot owner name
    * @return
    */
    public String getOwnerName()


    /**
    * Set plot owner
    * @param owner
    */
    public void setOwner(UUID owner)


    /**
    * Get allowed UUIDs
    * @return
    */
    public List<UUID> getAllowed()


    /**
    * Set allowed UUIDs
    * @return
    */
    public void setAllowed(List<UUID> allowed)


    /**
    * Get denied UUIDs
    * @return
    */
    public List<UUID> getDenied()


    /**
    * Set denied UUIDs
    * @return
    */
    public void setDenied(List<UUID> denied)


    /**
    * Get plot biome name
    * @return
    */
    public String getBiome()


    /**
    * Is plot marked as done
    * @return
    */
    public boolean isDone()


    /**
    * Set done
    * @param done
    */
    public void setDone(boolean done)


    /**
    * Is plot claimable
    * @return
    */
    public boolean isClaimable()


    /**
    * Is player allowed
    * @param p
    * @return
    */
    public boolean isAllowed(Player p)


    /**
    * Get plotmap
    * @return
    */
    public PlotMap getMap()


    /**
    * Get all blocks in plot
    * @return
    */
    public List<Block> getAllBlocks()


    /**
    * Get all connected plots
    * @return
    */
    public List<Plot> getConnectedPlots()


    /**
    * Check if point is inside plot
    * @param l
    * @return
    */
    public boolean isInsidePlot(Location l)


    /**
    * Set plot border
    * @param m
    */
    public void setBorder(Material m)


    /**
    * Set plot border with data
    * @param m
    * @param b
    */
    public void setBorder(Material m, byte b)


    /**
    * Update plot sign
    */
    public void updateSign()


    /**
    * Get plot sign location
    * @return
    */
    public Location getSignLocation()


    /**
    * Get plot top right location (Facing south)
    * @return
    */
    public Location getTopRight()


    /**
    * Get plot top left location (Facing south)
    * @return
    */
    public Location getTopLeft()


    /**
    * Get plot bottom left location (Facing south)
    * @return
    */
    public Location getBottomLeft()


    /**
    * Get plot bottom right location (Facing south)
    * @return
    */
    public Location getBottomRight()


    /**
    * Update plot links
    */
    public void updateLinkedPlots()


    /**
    * Update worldguard region
    */
    public void updateRegion()


    /**
    * Remove a player from allowed list
    * @param p
    */
    public void removePlayer(Player p)


    /**
    * Get a plot in a relative location
    * @param x
    * @param z
    * @return
    */
    public Plot add(int x, int z)


    /**
    * Get a plot in a relative location
    * @param x
    * @param z
    * @return
    */
    public Plot subtract(int x, int z)


    /**
    * Add walkways around plot
    */
    public void addWalkWays()


    /**
    * Clear the plot
    */
    public void clear()


    /**
    * Save the plot to a database
    * @return
    */
    public boolean save()


    /**
    * Delete the plot
    */
    public void delete()


    /**
    * Get plot home location
    * @return
    */
    public Location getHomeLocation()


    /**
    * Returns if the plot is set to link or not
    * @return
    */
    public boolean isToLink()


    /**
    * Set plot to link
    * @param link
    */
    public void setLink(boolean link)


    /**
    * Get all players on the plot
    * @return
    */
    public List<Player> getPlayersOnPlot()


    /**
    * Is player an admin
    * @param u
    * @return
    */
    public boolean isAdmin(UUID u)


    /**
    * Is player an admin
    * @param u
    * @return
    */
    public boolean isAdmin(Player p)


    /**
    * Is owner
    * @param p
    * @return
    */
    public boolean isOwner(Player p)


    /**
    * Get plot id
    * @return
    */
    public String getId()


    /**
    * Get plot likes
    * @return
    */
    public int getLikes()


    /**
    * get plot in relative direction
    * @param oneDirection
    * @return
    */
    public Plot getByDirection(Direction oneDirection)


    /**
    * Dump all plot data to String
    * @return
    */
    public String getDataDump()


    PlotMap (me.kyle.plotz.obj.PlotMap)

    /**
    * Get the map world
    * @return
    */
    public World getWorld()


    /**
    * Get the world name of the map
    * @return
    */
    public String getWorldName()


    /**
    * Key is specified
    * @param key - Key to value
    * @return
    */
    public boolean containsKey(String key)


    /**
    * Set a key to a value
    * @param name
    * @param value
    */
    public void set(String name, Object value)


    /**
    * Get a generic value
    * @param name (Key)
    * @return value
    */
    public <T> T get(String name)


    /**
    * Get all plots (ID|PLOT) (1:1|Plot)
    * @return
    */
    public Map<String, Plot> getPlots()


    /**
    * Set all plots
    * @param plots
    */
    public void setPlots(Map<String, Plot> plots)


    /**
    * Get all data keys and values
    * @return
    */
    public Map<String, Object> getData()


    /**
    * Check if a plot is saved
    * @param idx
    * @param idz
    * @return
    */
    public boolean containsPlot(int idx, int idz)


    /**
    * Get plot by id
    * @param idx
    * @param idz
    * @return
    */
    public Plot getPlot(int idx, int idz)


    /**
    * Remove a plot from loaded plots
    * @param plot
    */
    public void removePlot(Plot plot)


    /**
    * Remove a plot from loaded plots by id
    * @param plot
    */
    public void removePlot(int idx, int idz)


    /**
    * Add a plot to loaded plots
    * @param plot
    */
    public void addPlot(Plot plot)


    /**
    * Get a plot map by name
    * @param world
    * @return
    */
    public static PlotMap getMap(String world)


    /**
    * Get a plot map by world
    * @param world
    * @return
    */
    public static PlotMap getMap(World world)


    /**
    * Get all plot maps
    * @return
    */
    public static Collection<PlotMap> getMaps()


    PlotzOfflinePlayer (me.kyle.plotz.obj.PlotzOfflinePlayer)

    /**
    * Get UUID
    * @return
    */
    public UUID getUUID()


    /**
    * Get name
    * @return
    */
    public String getName()


    /**
    * Check if online
    * @return
    */
    public boolean isOnline()


    /**
    * Get Bukkit player
    * @return (Possible null)
    */
    public Player getPlayer()


    /**
    * Get player by name
    * @param name
    * @return
    */
    public static PlotzOfflinePlayer getOfflinePlayer(String name)


    /**
    * Get player by UUID
    * @param id
    * @return
    */
    public static PlotzOfflinePlayer getOfflinePlayer(UUID id)




  • Loading...
  • Loading...