mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-26 18:39:44 -05:00
Update PlayerListener.java
Former-commit-id: f101b9e341c23c65594fdcbc3fd5e1c54221aeb7 [formerly 41aa571cb0beea6f134a7171792a072cd055979c] Former-commit-id: fe66427d468f9708388faf21394302ff29702a62
This commit is contained in:
1 parent
94da73ccb3
commit
2473bdba80
1 file changed
+5
-2
@@ -86,7 +86,10 @@ public class PlayerListener implements Listener {
|
||||
MsgUtil.sendShopInfo(p, shop);
|
||||
shop.setSignText();
|
||||
if (shop.isSelling()) {
|
||||
p.sendMessage(MsgUtil.getMessage("how-many-buy", p));
|
||||
double price = shop.getPrice();
|
||||
double money = plugin.getEconomy().getBalance(p.getUniqueId());
|
||||
int itemAmount = (int) Math.floor(money / price);
|
||||
p.sendMessage(MsgUtil.getMessage("how-many-buy", p, "" + itemAmount));
|
||||
} else {
|
||||
int items = Util.countItems(p.getInventory(), shop.getItem());
|
||||
p.sendMessage(MsgUtil.getMessage("how-many-sell", p, "" + items));
|
||||
@@ -292,4 +295,4 @@ public class PlayerListener implements Listener {
|
||||
e.setCancelled(true);
|
||||
Util.debugLog("Disallow " + e.getPlayer().getName() + " dye the shop sign.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user