Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void clearPlayers(MEMine mine) {
- Location pos1 = mine.getLocation("pos1");
- Location pos2 = mine.getLocation("pos2");
- World world = pos1.getWorld();
- int min_x = Math.min(pos1.getBlockX(), pos2.getBlockX());
- int min_y = Math.min(pos1.getBlockY(), pos2.getBlockY());
- int min_z = Math.min(pos1.getBlockZ(), pos2.getBlockZ());
- int max_x = Math.max(pos1.getBlockX(), pos2.getBlockX());
- int max_y = Math.max(pos1.getBlockY(), pos2.getBlockY());
- int max_z = Math.max(pos1.getBlockZ(), pos2.getBlockZ());
- Location loc;
- for (Player player : Bukkit.getOnlinePlayers()) {
- loc = player.getLocation();
- if (loc.getBlockX() >= min_x && loc.getBlockX() <= max_x && loc.getBlockY() >= min_y - 1
- && loc.getBlockY() <= max_y && loc.getBlockZ() >= min_z && loc.getBlockZ() <= max_z) {
- if (mine.hasSafeLocation())
- player.teleport(mine.getSafeLocation());
- else {
- loc.setY(max_y + 1);
- player.teleport(loc);
- }
- player.sendMessage(Messages.MINE_RESET.getResult().replace("%mine%", mine.getName()));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement