Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String worldName = event.getPlayer().getLocation().getWorld();
- Location l = event.getPlayer().getLocation().clone();
- l.setY(0); //For having cylinder instead of sphere
- int radius = -1;
- if(cfg.contains("megachat.radiusworlds."+worldName))
- radius = cfg.getInt("megachat.radiusworlds."+worldName);
- for(Player p : Bukkit.getOnlinePlayers()) {
- Location l2 = p.getLocation().clone();
- l2.setY(0);
- boolean pass = true;
- if(radius >= 0 && l.distance(l2) > radius) pass = false;
- if(pass) {
- //sending message
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement