Skip to content

Commit

Permalink
• API Changes •
Browse files Browse the repository at this point in the history
* Added the "getBlockedItemId" method to the "DisplayShopsAPI" interface.

* All time stamp related methods involving shops directly were converted to long variables versus string.

• Plugin Changes •

* Added the "no-hand-item", "item-blocked", "item-unblocked", and "item-not-blocked" messages to the "lang.yml".

* Added the "show-admin-shops" option to the "menus.yml" under the "shop-visit-menu" section.

* Added the "/ds [block|unblock]" commands for blocking/un-blocking items from being sold (Uses the "displayshops.block" permission node).

* Dynamic prices now only update after a transaction is complete.

* The "displayshops.clear" permission node now is a child under the "displayshops.*" permission node.

* Fixed an issue where translating dynamic prices would incorrectly calculate.

Signed-off-by: Jeremiah Osborne <[email protected]>
  • Loading branch information
XZot1K committed Aug 7, 2021
1 parent 86d75a1 commit ef249fd
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 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.3.3 ##
## API-VERSION 1.3.4 ##
4 changes: 4 additions & 0 deletions lang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ rentable-interact: "&cThis shop is within a market region by the name of &e{id}&
rentable-shop-delete: "&cYou are unable to delete a shop contained within a market region."
region-location-fail: "&cThere was no region found at your location."
region-limit-exceeded: "&cYou may not rent any more regions at this time (Limit exceeded)."
no-hand-item: "&cThe item in hand is either invalid or already blocked."
item-blocked: "&aThe item in hand was blocked from being sold in all future shops."
item-unblocked: "&aThe item in hand was un-blocked and can now be sold in all shops."
item-not-blocked: "&cThe item in hand is not currently blocked from being sold in shops."

## Hook Messages ##
towny-no-access: "&cYou do not have access to this shop plot."
Expand Down
4 changes: 3 additions & 1 deletion menus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ decorative-items:
- ""
- "&7I am just providing some simple information!"


# This is the base block selection menu which adjusts its size based on available materials for selection and
# allows selection which will adjust their shop's base block to the selected material.
base-block-menu:
Expand Down Expand Up @@ -181,6 +180,9 @@ shop-visit-menu:
# (Note: This MUST be divisible by 9 and less than or equal to 54)
size: 36

# Determines if admin shops will be shown or not.
show-admin-shops: true

# These are the formats that replace the {type} placeholder.
type-admin: "&cAdmin"
type-normal: "&bPlayer"
Expand Down
9 changes: 9 additions & 0 deletions src/xzot1k/plugins/ds/DisplayShopsAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import xzot1k.plugins.ds.api.Manager;
import xzot1k.plugins.ds.api.handlers.DisplayPacket;
import xzot1k.plugins.ds.api.objects.Shop;
Expand Down Expand Up @@ -41,6 +42,14 @@ public interface DisplayShopsAPI {

// custom configurations

/**
* Gets the id associated to the item in the blocked-items.yml.
*
* @param itemStack The item to check the id for.
* @return The id associated to the item in the blocked-items.yml (returns -1 if invalid).
*/
long getBlockedItemId(ItemStack itemStack);

/**
* Reloads all configs associated with DisplayShops.
*/
Expand Down
12 changes: 6 additions & 6 deletions src/xzot1k/plugins/ds/api/objects/Shop.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,17 @@ public interface Shop {

void setTradeItem(ItemStack tradeItem);

String getChangeTimeStamp();
long getChangeTimeStamp();

void setChangeTimeStamp(String changeTimeStamp);
void setChangeTimeStamp(long changeTimeStamp);

String getLastBuyTimeStamp();
long getLastBuyTimeStamp();

void setLastBuyTimeStamp(String buyTimeStamp);
void setLastBuyTimeStamp(long buyTimeStamp);

String getLastSellTimeStamp();
long getLastSellTimeStamp();

void setLastSellTimeStamp(String sellTimeStamp);
void setLastSellTimeStamp(long sellTimeStamp);

int getSellLimit();

Expand Down

0 comments on commit ef249fd

Please sign in to comment.