Skip to content

Commit ef249fd

Browse files
committed
• API Changes •
* 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 <jao21d@my.fsu.edu>
1 parent 86d75a1 commit ef249fd

5 files changed

Lines changed: 23 additions & 8 deletions

File tree

API Version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
## API-VERSION 1.3.3 ##
1+
## API-VERSION 1.3.4 ##

lang.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ rentable-interact: "&cThis shop is within a market region by the name of &e{id}&
171171
rentable-shop-delete: "&cYou are unable to delete a shop contained within a market region."
172172
region-location-fail: "&cThere was no region found at your location."
173173
region-limit-exceeded: "&cYou may not rent any more regions at this time (Limit exceeded)."
174+
no-hand-item: "&cThe item in hand is either invalid or already blocked."
175+
item-blocked: "&aThe item in hand was blocked from being sold in all future shops."
176+
item-unblocked: "&aThe item in hand was un-blocked and can now be sold in all shops."
177+
item-not-blocked: "&cThe item in hand is not currently blocked from being sold in shops."
174178

175179
## Hook Messages ##
176180
towny-no-access: "&cYou do not have access to this shop plot."

menus.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ decorative-items:
3131
- ""
3232
- "&7I am just providing some simple information!"
3333

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

183+
# Determines if admin shops will be shown or not.
184+
show-admin-shops: true
185+
184186
# These are the formats that replace the {type} placeholder.
185187
type-admin: "&cAdmin"
186188
type-normal: "&bPlayer"

src/xzot1k/plugins/ds/DisplayShopsAPI.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import org.bukkit.configuration.file.FileConfiguration;
88
import org.bukkit.entity.Player;
9+
import org.bukkit.inventory.ItemStack;
910
import xzot1k.plugins.ds.api.Manager;
1011
import xzot1k.plugins.ds.api.handlers.DisplayPacket;
1112
import xzot1k.plugins.ds.api.objects.Shop;
@@ -41,6 +42,14 @@ public interface DisplayShopsAPI {
4142

4243
// custom configurations
4344

45+
/**
46+
* Gets the id associated to the item in the blocked-items.yml.
47+
*
48+
* @param itemStack The item to check the id for.
49+
* @return The id associated to the item in the blocked-items.yml (returns -1 if invalid).
50+
*/
51+
long getBlockedItemId(ItemStack itemStack);
52+
4453
/**
4554
* Reloads all configs associated with DisplayShops.
4655
*/

src/xzot1k/plugins/ds/api/objects/Shop.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,17 +237,17 @@ public interface Shop {
237237

238238
void setTradeItem(ItemStack tradeItem);
239239

240-
String getChangeTimeStamp();
240+
long getChangeTimeStamp();
241241

242-
void setChangeTimeStamp(String changeTimeStamp);
242+
void setChangeTimeStamp(long changeTimeStamp);
243243

244-
String getLastBuyTimeStamp();
244+
long getLastBuyTimeStamp();
245245

246-
void setLastBuyTimeStamp(String buyTimeStamp);
246+
void setLastBuyTimeStamp(long buyTimeStamp);
247247

248-
String getLastSellTimeStamp();
248+
long getLastSellTimeStamp();
249249

250-
void setLastSellTimeStamp(String sellTimeStamp);
250+
void setLastSellTimeStamp(long sellTimeStamp);
251251

252252
int getSellLimit();
253253

0 commit comments

Comments
 (0)