Pick a random location in this radius
()
| 244 | * Pick a random location in this radius |
| 245 | */ |
| 246 | public Location random() { |
| 247 | Random r = new Random(); |
| 248 | double x = radius * ((r.nextDouble() - 0.5) * 2); |
| 249 | double y = radius * ((r.nextDouble() - 0.5) * 2); |
| 250 | double z = radius * ((r.nextDouble() - 0.5) * 2); |
| 251 | |
| 252 | return location.clone().add(x, y, z); |
| 253 | } |
| 254 | } |