diff --git a/src/main/java/de/themoep/entitydetection/EntityDetection.java b/src/main/java/de/themoep/entitydetection/EntityDetection.java index 8038bf1..85432f3 100644 --- a/src/main/java/de/themoep/entitydetection/EntityDetection.java +++ b/src/main/java/de/themoep/entitydetection/EntityDetection.java @@ -80,6 +80,7 @@ public boolean stopSearch(String stopper) { return false; } currentSearch.stop(stopper); + clearCurrentSearch(); return true; } @@ -92,6 +93,10 @@ public void addResult(SearchResult result) { } } + public void clearCurrentSearch() { + currentSearch = null; + } + public EntitySearch getCurrentSearch() { return currentSearch; } diff --git a/src/main/java/de/themoep/entitydetection/searcher/EntitySearch.java b/src/main/java/de/themoep/entitydetection/searcher/EntitySearch.java index 0c54061..cf756ce 100644 --- a/src/main/java/de/themoep/entitydetection/searcher/EntitySearch.java +++ b/src/main/java/de/themoep/entitydetection/searcher/EntitySearch.java @@ -173,5 +173,6 @@ public void run() { plugin.addResult(result); plugin.send(owner, result); running = false; + plugin.clearCurrentSearch(); } }