Skip to content

Commit

Permalink
* Added the "updateAllBaseBlockAccess" method to the "DataPack" objec…
Browse files Browse the repository at this point in the history
…t interface.

* Added the "canEdit" check method to the "Shop" object interface.
* Added the "getCurrencyBalance" method to the "Manager" interface.
* Added the "getShopById" method to the "Manager" interface.
* The "save" method in the "Shop" object interface now requires an SQL statement to reduce the creation of too many statements in a short period of time.
* Fixed the "DisplayShopsAPI" interface as it was set as package private.

Signed-off-by: XZot1K <[email protected]>
  • Loading branch information
XZot1K committed Sep 2, 2020
1 parent fb323a4 commit 0ecbb4e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 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.2 ##
## API-VERSION 1.1.3 ##
4 changes: 2 additions & 2 deletions DisplayShopsAPI.iml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<orderEntry type="module-library" scope="PROVIDED">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../Dependencies/Server Jars/1.16.2.jar!/" />
<root url="jar://$MODULE_DIR$/../../../Dependencies/Server Jars/1.16.2 - Paper.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../../../Dependencies/Server Jars/1.16.2.jar!/" />
<root url="jar://$MODULE_DIR$/../../../Dependencies/Server Jars/1.16.2 - Paper.jar!/" />
</SOURCES>
</library>
</orderEntry>
Expand Down
10 changes: 9 additions & 1 deletion src/xzot1k/plugins/ds/api/Manager.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,18 @@ public interface Manager {
/**
* Generates a new ID suited for a new display shop.
*
* @return a long value for the id.
* @return a long value for the ID.
*/
UUID generateNewId();

/**
* Attempts to get a shop object from the shop map by its ID.
*
* @param shopId The ID to get the shop from
* @return the shop object.
*/
Shop getShopById(UUID shopId);

/**
* Get a shop from the passed chest if possible.
*
Expand Down
7 changes: 7 additions & 0 deletions src/xzot1k/plugins/ds/api/objects/DataPack.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ public interface DataPack {
*/
void toggleBBMLock(String unlockId);

/**
* Updates all base-block data to either locked aside the default or unlock all.
*
* @param unlockAll Whether or not to unlock all materials.
*/
void updateAllBaseBlockAccess(boolean unlockAll);

/**
* Obtains a full string of cooldowns applied to the player.
*
Expand Down
6 changes: 4 additions & 2 deletions src/xzot1k/plugins/ds/api/objects/Shop.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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 @@ -50,9 +51,10 @@ public interface Shop {
/**
* Saves the shop to the database.
*
* @param async Whether it should be saved on the main thread or not.
* @param async Whether it should be saved on the main thread or not.
* @param statement The database statement to use.
*/
void save(boolean async);
void save(boolean async, Statement statement);

/**
* Runs all commands given to the shop.
Expand Down

0 comments on commit 0ecbb4e

Please sign in to comment.