mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 14:38:53 +00:00
Don't cache any homes if cache size is <= 0
This commit is contained in:
1 parent
f4a6873ed0
commit
f506f0fd00
1 file changed
+4
-1
@@ -98,8 +98,11 @@ public abstract class RandomTeleportEngine {
|
||||
* @since 3.0
|
||||
*/
|
||||
private void populateCache(@NotNull World world, final int cacheSize) {
|
||||
if (cacheSize <= 0) {
|
||||
return;
|
||||
}
|
||||
CompletableFuture.runAsync(() -> {
|
||||
final int amountToPopulate = Math.max(1, cacheSize) - cachedPositions.get(world).size();
|
||||
final int amountToPopulate = cacheSize - cachedPositions.get(world).size();
|
||||
final Location originLocation = new Location(0, 0, 0, world);
|
||||
for (int i = 0; i < amountToPopulate; i++) {
|
||||
generateRandomLocation(originLocation)
|
||||
|
||||
Reference in new issue
Block a user