Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean reset(boolean force)
- {
- if (!force && this.counter < 200) return false;
- ThreadUtils.runAsync(() ->
- {
- for (Region region : this.regions)
- {
- World world = WorldUtils.getWorld(region.getWorld());
- if (world == null) continue;
- Shape shape = region.getShape();
- for (Vector vector : shape)
- {
- MaterialData data = RandomUtils.randomValue(this.types, this.totalWeight);
- this.change.addBlock(LocationUtils.getLocation(world, vector), data);
- }
- this.change.run();
- this.change.clear();
- for (Player player : PlayerUtils.getOnlinePlayers())
- {
- if (!world.equals(player.getWorld())) continue;
- if (!shape.containsPoint(player.getLocation())) continue;
- ThreadUtils.run(() -> player.teleport(player.getLocation().setY(shape.getMaxPoint().getIntY() + 3)));
- }
- }
- this.counter = 0;
- });
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement