public class ShopUtils extends Object
Modifier and Type | Method and Description |
---|---|
void |
addShop(Shop shop,
boolean addToDatabase)
Add a shop
|
void |
addShop(Shop shop,
boolean addToDatabase,
Callback callback)
Add a shop
|
Shop |
getShop(org.bukkit.Location location)
Get the shop at a given location
|
int |
getShopAmount(org.bukkit.OfflinePlayer p)
Get the amount of shops of a player
|
int |
getShopLimit(org.bukkit.entity.Player p)
Get the shop limits of a player
|
Shop[] |
getShops()
Get all Shops
|
boolean |
isShop(org.bukkit.Location location)
Checks whether there is a shop at a given location
|
void |
reloadShops(boolean reloadConfig,
boolean showConsoleMessages,
Callback callback)
Reload the shops
|
void |
removeShop(Shop shop,
boolean removeFromDatabase)
Remove a shop
|
void |
removeShop(Shop shop,
boolean removeFromDatabase,
Callback callback)
Remove a shop
|
void |
updateShop(Shop shop,
org.bukkit.entity.Player player)
Update hologram and item of the shop for a player based on their distance to each other
|
void |
updateShops(org.bukkit.entity.Player player)
Update hologram and item of all shops for a player
|
void |
updateShops(org.bukkit.entity.Player player,
boolean force)
Update hologram and item of all shops for a player
|
public ShopUtils(ShopChest plugin)
public Shop getShop(org.bukkit.Location location)
location
- Location of the shoppublic boolean isShop(org.bukkit.Location location)
location
- Location to checkpublic Shop[] getShops()
public void addShop(Shop shop, boolean addToDatabase, Callback callback)
shop
- Shop to addaddToDatabase
- Whether the shop should also be added to the databasecallback
- Callback that - if succeeded - returns the ID the shop had or was given (as int
)public void addShop(Shop shop, boolean addToDatabase)
shop
- Shop to addaddToDatabase
- Whether the shop should also be added to the databasepublic void removeShop(Shop shop, boolean removeFromDatabase, Callback callback)
shop
- Shop to removeremoveFromDatabase
- Whether the shop should also be removed from the databasecallback
- Callback that - if succeeded - returns nullpublic void removeShop(Shop shop, boolean removeFromDatabase)
shop
- Shop to removeremoveFromDatabase
- Whether the shop should also be removed from the databasepublic int getShopLimit(org.bukkit.entity.Player p)
p
- Player, whose shop limits should be returnedpublic int getShopAmount(org.bukkit.OfflinePlayer p)
p
- Player, whose shops should be countedConfig.exclude_admin_shops
is true, admin shops won't be counted)public void reloadShops(boolean reloadConfig, boolean showConsoleMessages, Callback callback)
reloadConfig
- Whether the configuration should also be reloadedshowConsoleMessages
- Whether messages about the language file should be shown in the consolecallback
- Callback that - if succeeded - returns the amount of shops that were reloaded (as int
)public void updateShops(org.bukkit.entity.Player player)
player
- Player to show the updatespublic void updateShops(org.bukkit.entity.Player player, boolean force)
player
- Player to show the updatesforce
- Whether update should be forced even if player has not movedpublic void updateShop(Shop shop, org.bukkit.entity.Player player)
shop
- Shop to updateplayer
- Player to show the updateCopyright © 2017. All rights reserved.