daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Mar 26th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     private static List<Generator> toRepair;
  2.    
  3.     static {
  4.         GeneratorTask.toRepair = new ArrayList<Generator>();
  5.     }
  6.    
  7.     public static void enable() {
  8.         final Iterator<Generator> iterator = null;
  9.         final Iterator<Generator> iterator2 = null;
  10.         Bukkit.getScheduler().runTaskTimerAsynchronously((Plugin)Main.getPlugin(), () -> {
  11.             GeneratorTask.toRepair.clear();
  12.             GeneratorManager.getDestroyed().iterator();
  13.             while (iterator.hasNext()) {
  14.                 Generator generator = iterator.next();
  15.                 if (generator.isDestroyed() && System.currentTimeMillis() >= generator.getDestroyTime()) {
  16.                     GeneratorTask.toRepair.add(generator);
  17.                 }
  18.             }
  19.             Bukkit.getScheduler().runTask((Plugin)Main.getPlugin(), () -> {
  20.                 GeneratorTask.toRepair.iterator();
  21.                 while (iterator2.hasNext()) {
  22.                     Generator gen = iterator2.next();
  23.                     if (!gen.getLoc().getBlock().getType().equals((Object)Material.ENDER_STONE)) {
  24.                         continue;
  25.                     }
  26.                     else {
  27.                         gen.repairGenerator();
  28.                     }
  29.                 }
  30.             });
  31.         }, 10L, 10L);
  32.     }
  33. }
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
 
Top