SHARE
TWEET

Untitled

a guest Feb 20th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class RBank {
  2.     public static boolean isRlyOpen(){
  3.         if(!Bank.isOpen()) return false;
  4.  
  5.         Time.sleepUntil(()-> !Bank.isEmpty(), 200);
  6.         return true;
  7.     }
  8.  
  9.     public static boolean checkedWithdraw(Predicate<? super Item> predicate, Integer amount){
  10.         if(!Bank.contains(item -> predicate.test(item) && item.getStackSize() > 0)){
  11.             if(isRlyOpen()){
  12.                 throw new NotInBankException(predicate instanceof Labeled ? ((Labeled) predicate) : Labeled.UNKNOWN);
  13.             }
  14.  
  15.             return false;
  16.         }
  17.  
  18.         return amount == null ? Bank.withdrawAll(predicate) : Bank.withdraw(predicate, amount);
  19.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top