mirror of
https://github.com/Phoenix616/RandomTeleport.git
synced 2024-11-22 10:36:00 +01:00
Add initiator to targets if it's an entity and no target was found
This happens when the player runs the command without a target argument or when using the API methods
This commit is contained in:
parent
24e92041c1
commit
6b98efb1e4
@ -259,6 +259,9 @@ public class RandomSearcher {
|
||||
*/
|
||||
public CompletableFuture<Location> search() {
|
||||
plugin.getRunningSearchers().put(uniqueId, this);
|
||||
if (targets.isEmpty() && initiator instanceof Entity) {
|
||||
targets.add((Entity) initiator);
|
||||
}
|
||||
future = new CompletableFuture<>();
|
||||
plugin.getServer().getScheduler().runTask(plugin, () -> checkRandom(future));
|
||||
future.whenComplete((l, e) -> plugin.getRunningSearchers().remove(uniqueId));
|
||||
|
Loading…
Reference in New Issue
Block a user