Class ShopPlotUtil

java.lang.Object
com.palmergames.bukkit.towny.utils.ShopPlotUtil

public class ShopPlotUtil extends Object
A util for Shop Plugin Developers to use, given the player and location, the Util will return true if the player should be able to create a shop at the given location.
Author:
LlmDl
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    doesPlayerHaveAbilityToEditShopPlot(org.bukkit.entity.Player player, org.bukkit.Location location)
    This tests if a player has the ability to build at the location, as well as the plot being a shop plot type.
    static boolean
    doesPlayerOwnShopPlot(org.bukkit.entity.Player player, org.bukkit.Location location)
    This tests that the player owns the plot at the location in question personally, as well as the plot being a shop plot type.
    static boolean
    isShopPlot(TownBlock townblock)
    Use this to determine if a TownBlock is a shop plot.
    static boolean
    isShopPlot(org.bukkit.Location location)
    Use this to determine if a Location is a shop plot.

    Methods inherited from class java.lang.Object

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

    • ShopPlotUtil

      public ShopPlotUtil()
  • Method Details

    • doesPlayerOwnShopPlot

      public static boolean doesPlayerOwnShopPlot(org.bukkit.entity.Player player, org.bukkit.Location location)
      This tests that the player owns the plot at the location in question personally, as well as the plot being a shop plot type. This is a simpler, probably more likely scenario than the doesPlayerHaveAbilityToEditShopPlot(Player, Location) test.
      Parameters:
      player - - Player to test
      location - - Location to test at
      Returns:
      true if the player owns the plot, and it is a Shop plot
    • doesPlayerHaveAbilityToEditShopPlot

      public static boolean doesPlayerHaveAbilityToEditShopPlot(org.bukkit.entity.Player player, org.bukkit.Location location)
      This tests if a player has the ability to build at the location, as well as the plot being a shop plot type. This would be used for plots that are not personally owned by the player, a public shop space in a town. This is a more complicated, but more permissive test than the doesPlayerOwnShopPlot(Player, Location) test.
      Parameters:
      player - - Player to test
      location - - Location to test at
      Returns:
      true if the player can build and the plot is a shop
    • isShopPlot

      public static boolean isShopPlot(org.bukkit.Location location)
      Use this to determine if a Location is a shop plot.
      Parameters:
      location - - Location to be tested for shop plot type.
      Returns:
      true if the location is a shop plot.
    • isShopPlot

      public static boolean isShopPlot(TownBlock townblock)
      Use this to determine if a TownBlock is a shop plot.
      Parameters:
      townblock - - TownBlock to be tested for shop type.
      Returns:
      true if the townblock is a shop plot.