Fix another all bug

Former-commit-id: e13e76b3edab6cd1da28a7a10ba323899c523162 [formerly 81e91807ebf6dfd1223a10b878e8f691a6bc3a00]
Former-commit-id: 2a4655e7558058a4651826bd91dad8712598e7b8
This commit is contained in:
Ghost_chu committed 2019-11-15 21:02:56 +08:00
1 parent 21df3b3d57
commit 850853a565
1 file changed
+4 -2
@@ -437,9 +437,11 @@ public class ShopManager {
} catch (NumberFormatException e) {
if (message.equalsIgnoreCase(plugin.getConfig().getString("shop.word-for-trade-all-items", "all"))) {
if(!shop.isUnlimited()){
amount = Util.countItems(((ContainerShop) shop).getInventory(), shop.getItem());
int shopHaveItems = Util.countItems(((ContainerShop) shop).getInventory(), shop.getItem());
int invHaveSpaces = Util.countSpace(p.getInventory(), shop.getItem());
amount = Math.min(shopHaveItems,invHaveSpaces);
}else{
amount = Util.countSpace(p.getInventory(), shop.getItem());
amount = Util.countItems(p.getInventory(), shop.getItem());
}
} else {