Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean doBanking(BankItem... bis) {
- if (!Bank.isOpen())
- Bank.open();
- UberBanking.depositAllExcept(bis);
- for (BankItem bi : bis) {
- if ((!UberInventory.contains(bi.getId()) && !UberInventory.contains(bi.getName())) || bi.inventoryCount() != bi.getQuantity()) {
- if (bi.getId() != -1)
- UberBanking.makeInventoryCount(bi.getId(), bi.getQuantity());
- else
- UberBanking.makeInventoryCount(bi.getName(), bi.getQuantity());
- }
- }
- boolean close = true;
- for (BankItem bi : bis) {
- if (bi.getId() != -1) {
- if (!UberInventory.contains(bi.getId()))
- close = false;
- }
- else if (!UberInventory.contains(bi.getName()))
- close = false;
- if(bi.inventoryCount() != bi.getQuantity())
- close = false;
- }
- int count = 0;
- for(BankItem bi : bis)
- count += bi.getQuantity();
- if (Inventory.getCount(true) != count)
- close = false;
- if (close) {
- Bank.close();
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement