Skip to content

Commit

Permalink
* Added the "getInventorySpaceForItem" method to the "Manager" interf…
Browse files Browse the repository at this point in the history
…ace.

* The "save" method in the "Shop" interface no longer requires a statement argument.

Signed-off-by: xzot1k <[email protected]>
  • Loading branch information
XZot1K committed Oct 13, 2020
1 parent 0a31d3a commit 8df9fc6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion API Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
## API-VERSION 1.1.9 ##
## API-VERSION 1.2 ##
9 changes: 9 additions & 0 deletions src/xzot1k/plugins/ds/api/Manager.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ public interface Manager {
*/
void giveItem(Player player, ItemStack itemStack, int amount, int unitCount);

/**
* Obtains available space for a defined item.
*
* @param player The player who's inventory needs to be checked.
* @param itemStack The itemstack to check for.
* @return The total available item amount space.
*/
int getInventorySpaceForItem(Player player, ItemStack itemStack);

/**
* Retrieve a market region, if the passed location is inside it.
*
Expand Down
7 changes: 3 additions & 4 deletions src/xzot1k/plugins/ds/api/objects/Shop.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.bukkit.inventory.ItemStack;
import xzot1k.plugins.ds.api.events.EconomyCallType;

import java.sql.Statement;
import java.util.List;
import java.util.UUID;

Expand Down Expand Up @@ -56,10 +55,9 @@ public interface Shop {
/**
* Saves the shop to the database.
*
* @param async Whether it should be saved on the main thread or not.
* @param statement The database statement to use.
* @param async Whether it should be saved on the main thread or not.
*/
void save(boolean async, Statement statement);
void save(boolean async);

/**
* Runs all commands given to the shop.
Expand Down Expand Up @@ -280,6 +278,7 @@ public interface Shop {

/**
* Gets a list of all players who are editing the shop.
*
* @return The list of player UUIDs who are editing the shop.
*/
List<UUID> getCurrentEditors();
Expand Down

0 comments on commit 8df9fc6

Please sign in to comment.