Skip to content

Commit

Permalink
Added API: FindEmptySlot
Browse files Browse the repository at this point in the history
  • Loading branch information
7sat committed Mar 29, 2022
1 parent 42a7ade commit 8069bfd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.sat7</groupId>
<artifactId>DynamicShop</artifactId>
<version>3.6.2</version>
<version>3.6.3</version>
<packaging>jar</packaging>

<name>DynamicShop</name>
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/me/sat7/dynamicshop/DynaShopAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -415,4 +415,15 @@ public static double QuickSell(Player player, ItemStack itemStack)

return Sell.quickSellItem(player, itemStack, ret[0], Integer.parseInt(ret[1]), true, -1);
}

/**
* Search for empty slots in a specific shop.
*
* @param shopName shop name
* @return Returns the index of an empty slot. (first slot only). Returns -1 if there is no empty slot.
*/
public static int FindEmptySlot(String shopName)
{
return ShopUtil.findEmptyShopSlot(shopName, 0, false);
}
}
2 changes: 0 additions & 2 deletions src/main/java/me/sat7/dynamicshop/utilities/ShopUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public static void ReloadAllShop()
// 상점에서 빈 슬롯 찾기
public static int findEmptyShopSlot(String shopName, int startIdx, boolean addPage)
{
ArrayList<Integer> banList = new ArrayList<>();

CustomConfig data = shopConfigFiles.get(shopName);
if(data == null)
return -1;
Expand Down

0 comments on commit 8069bfd

Please sign in to comment.