Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. String worldName = event.getPlayer().getLocation().getWorld();
  2. Location l = event.getPlayer().getLocation().clone();
  3. l.setY(0); //For having cylinder instead of sphere
  4. int radius = -1;
  5. if(cfg.contains("megachat.radiusworlds."+worldName))
  6.     radius = cfg.getInt("megachat.radiusworlds."+worldName);
  7. for(Player p : Bukkit.getOnlinePlayers()) {
  8.     Location l2 = p.getLocation().clone();
  9.     l2.setY(0);
  10.     boolean pass = true;
  11.     if(radius >= 0 && l.distance(l2) > radius) pass = false;
  12.     if(pass) {
  13.         //sending message
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement