Skip to content

Commit

Permalink
Removed redundant AtomicBoolean variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
larryTheCoder committed Jul 4, 2020
1 parent daa1dde commit e61fee6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/larryTheCoder/ASkyBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import com.larryTheCoder.island.GridManager;
import com.larryTheCoder.island.IslandManager;
import com.larryTheCoder.island.TeleportLogic;
import com.larryTheCoder.island.TopTen;
import com.larryTheCoder.listener.ChatHandler;
import com.larryTheCoder.listener.IslandListener;
import com.larryTheCoder.listener.LavaCheck;
Expand Down Expand Up @@ -158,12 +159,11 @@ public void onDisable() {
Utils.send("&7Saving all island framework...");

saveLevel(true);
getFastCache().shutdownCache();
getDatabase().shutdownDB();
getMessages().saveMessages();
LavaCheck.clearStats();
getLevelCalcThread().shutdown();
//TopTen.topTenSave();
TopTen.topTenSave();
}

Utils.send("&cASkyBlock has been successfully disabled. Goodbye!");
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/com/larryTheCoder/cache/FastCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import java.sql.Timestamp;
import java.time.Instant;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;

import static com.larryTheCoder.database.TableSet.*;
Expand All @@ -60,18 +59,12 @@ public class FastCache {
private final List<FastCacheData> dataCache = new ArrayList<>();
private final List<String> uniqueId = new ArrayList<>();

private final AtomicBoolean isRunning = new AtomicBoolean(false);

public FastCache(ASkyBlock plugin) {
this.plugin = plugin;

this.loadFastCache();
}

public void shutdownCache() {
isRunning.compareAndSet(true, false);
}

private void addAllCacheData(List<FastCacheData> list) {
dataCache.addAll(list);
}
Expand Down Expand Up @@ -146,8 +139,6 @@ public void onCompletion(Exception err) {
Utils.sendDebug(String.format("Loaded %s cache data.", dataCache.size()));

ASkyBlock.get().getFastCache().addAllCacheData(dataCache);

isRunning.compareAndSet(false, true);
}
});
}
Expand Down

0 comments on commit e61fee6

Please sign in to comment.