mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-24 17:39:52 -05:00
Fix unlimited shop
Former-commit-id: 52ff55c030d5398c2b28c06dc90e4ad447777012 [formerly f3af8b15d0c7d690d69287a40199dc87a3728729] Former-commit-id: 3390084be8bef8701478e1629b5d6051c2f45ad3
This commit is contained in:
1 parent
f4a9d3c615
commit
20737004ab
2 files changed
+6
-10
No files matched your search
@@ -371,6 +371,8 @@ public class ShopManager {
|
||||
@SuppressWarnings("deprecation")
|
||||
private void actionBuy(Player p, HashMap<UUID, Info> actions2, Info info, String message, Shop shop, int amount) {
|
||||
int space = shop.getRemainingSpace();
|
||||
if(space == -1)
|
||||
space=10000;
|
||||
if (space < amount) {
|
||||
p.sendMessage(MsgUtil.getMessage("shop-has-no-space", "" + space, shop.getDataName()));
|
||||
return;
|
||||
@@ -434,15 +436,7 @@ public class ShopManager {
|
||||
shop.setSignText(); // Update the signs count
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
private void actionSell(Player p, HashMap<UUID, Info> actions2, Info info, String message, Shop shop2, int amount2) {
|
||||
int amount = 0;
|
||||
try {
|
||||
amount = Integer.parseInt(message);
|
||||
} catch (NumberFormatException e) {
|
||||
p.sendMessage(MsgUtil.getMessage("shop-purchase-cancelled"));
|
||||
return;
|
||||
}
|
||||
// Get the shop they interacted with
|
||||
private void actionSell(Player p, HashMap<UUID, Info> actions2, Info info, String message, Shop shop2, int amount) {
|
||||
Shop shop = plugin.getShopManager().getShop(info.getLocation());
|
||||
// It's not valid anymore
|
||||
if (shop == null || Util.canBeShop(info.getLocation().getBlock()) == false) {
|
||||
@@ -454,6 +448,8 @@ public class ShopManager {
|
||||
return;
|
||||
}
|
||||
int stock = shop.getRemainingStock();
|
||||
if(stock==-1)
|
||||
stock=10000;
|
||||
if (stock < amount) {
|
||||
p.sendMessage(MsgUtil.getMessage("shop-stock-too-low", "" + shop.getRemainingStock(), shop.getDataName()));
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user