Make sure the found chunk stays loaded
This is done by adding a plugin chunk ticket and removing it once our logic is done
This commit is contained in:
parent
548d873790
commit
11cbc0abb8
|
@ -455,6 +455,8 @@ public class RandomSearcher {
|
|||
checkRandom(future);
|
||||
return false;
|
||||
}
|
||||
c.addPluginChunkTicket(plugin);
|
||||
try {
|
||||
int indexOffset = random.nextInt(RANDOM_LIST.size());
|
||||
Location foundLoc = null;
|
||||
for (int i = 0; i < RANDOM_LIST.size(); i++) {
|
||||
|
@ -490,6 +492,9 @@ public class RandomSearcher {
|
|||
checkRandom(future);
|
||||
}
|
||||
return false;
|
||||
} finally {
|
||||
c.removePluginChunkTicket(plugin);
|
||||
}
|
||||
}).exceptionally(future::completeExceptionally);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue