Class ShopPlotUtil
java.lang.Object
com.palmergames.bukkit.towny.utils.ShopPlotUtil
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 aTownBlock
is a shop plot.static boolean
isShopPlot
(org.bukkit.Location location) Use this to determine if aLocation
is a shop plot.
-
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 thedoesPlayerHaveAbilityToEditShopPlot(Player, Location)
test.- Parameters:
player
- -Player
to testlocation
- -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 thedoesPlayerOwnShopPlot(Player, Location)
test.- Parameters:
player
- -Player
to testlocation
- -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 aLocation
is a shop plot.- Parameters:
location
- -Location
to be tested for shop plot type.- Returns:
- true if the location is a shop plot.
-
isShopPlot
Use this to determine if aTownBlock
is a shop plot.- Parameters:
townblock
- -TownBlock
to be tested for shop type.- Returns:
- true if the townblock is a shop plot.
-