filter npcs in same world only for near command. fixes #69
This commit is contained in:
parent
f812c77cc9
commit
fbc3be6259
@ -25,6 +25,7 @@ public class NearCommand implements CommandHandler {
|
|||||||
double radius = Math.pow(raw, 2);
|
double radius = Math.pow(raw, 2);
|
||||||
|
|
||||||
String npcs = npcRegistry.getAllModifiable().stream()
|
String npcs = npcRegistry.getAllModifiable().stream()
|
||||||
|
.filter(entry -> entry.getNpc().getWorld().equals(player.getWorld()))
|
||||||
.filter(entry -> entry.getNpc().getBukkitLocation().distanceSquared(player.getLocation()) < radius)
|
.filter(entry -> entry.getNpc().getBukkitLocation().distanceSquared(player.getLocation()) < radius)
|
||||||
.map(NpcEntryImpl::getId)
|
.map(NpcEntryImpl::getId)
|
||||||
.collect(Collectors.joining(", "));
|
.collect(Collectors.joining(", "));
|
||||||
|
Loading…
Reference in New Issue
Block a user