Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public boolean reset(boolean force)
  2. {
  3. if (!force && this.counter < 200) return false;
  4.  
  5. ThreadUtils.runAsync(() ->
  6. {
  7. for (Region region : this.regions)
  8. {
  9. World world = WorldUtils.getWorld(region.getWorld());
  10.  
  11. if (world == null) continue;
  12.  
  13. Shape shape = region.getShape();
  14.  
  15. for (Vector vector : shape)
  16. {
  17. MaterialData data = RandomUtils.randomValue(this.types, this.totalWeight);
  18.  
  19. this.change.addBlock(LocationUtils.getLocation(world, vector), data);
  20. }
  21.  
  22. this.change.run();
  23.  
  24. this.change.clear();
  25.  
  26. for (Player player : PlayerUtils.getOnlinePlayers())
  27. {
  28. if (!world.equals(player.getWorld())) continue;
  29.  
  30. if (!shape.containsPoint(player.getLocation())) continue;
  31.  
  32. ThreadUtils.run(() -> player.teleport(player.getLocation().setY(shape.getMaxPoint().getIntY() + 3)));
  33. }
  34. }
  35.  
  36. this.counter = 0;
  37. });
  38.  
  39. return true;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement