mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2024-12-24 18:17:41 +01:00
Using Config and Database API naming
This commit is contained in:
parent
c3f8879a8a
commit
d70a4bf9b7
@ -17,7 +17,7 @@ import bentobox.addon.level.listeners.NewIslandListener;
|
||||
import world.bentobox.bentobox.api.addons.Addon;
|
||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
import world.bentobox.bentobox.database.BBDatabase;
|
||||
import world.bentobox.bentobox.database.Database;
|
||||
import world.bentobox.bentobox.database.objects.Island;
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ public class Level extends Addon {
|
||||
private Settings settings;
|
||||
|
||||
// Database handler for level data
|
||||
private BBDatabase<LevelsData> handler;
|
||||
private Database<LevelsData> handler;
|
||||
|
||||
// A cache of island levels.
|
||||
private Map<UUID, LevelsData> levelsCache;
|
||||
@ -112,7 +112,7 @@ public class Level extends Addon {
|
||||
// Get the BSkyBlock database
|
||||
// Set up the database handler to store and retrieve Island classes
|
||||
// Note that these are saved by the BSkyBlock database
|
||||
handler = new BBDatabase<>(this, LevelsData.class);
|
||||
handler = new Database<>(this, LevelsData.class);
|
||||
// Initialize the cache
|
||||
levelsCache = new HashMap<>();
|
||||
// Load the calculator
|
||||
@ -191,7 +191,7 @@ public class Level extends Addon {
|
||||
}
|
||||
|
||||
|
||||
public BBDatabase<LevelsData> getHandler() {
|
||||
public Database<LevelsData> getHandler() {
|
||||
return handler;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ import world.bentobox.bentobox.api.panels.PanelItem;
|
||||
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
|
||||
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
import world.bentobox.bentobox.database.BBDatabase;
|
||||
import world.bentobox.bentobox.database.Database;
|
||||
|
||||
/**
|
||||
* Handles all Top Ten List functions
|
||||
@ -34,13 +34,13 @@ public class TopTen implements Listener {
|
||||
private Map<World,TopTenData> topTenList;
|
||||
private final int[] SLOTS = new int[] {4, 12, 14, 19, 20, 21, 22, 23, 24, 25};
|
||||
private final boolean DEBUG = false;
|
||||
private BBDatabase<TopTenData> handler;
|
||||
private Database<TopTenData> handler;
|
||||
|
||||
public TopTen(Level addon) {
|
||||
this.addon = addon;
|
||||
// Set up the database handler to store and retrieve the TopTenList class
|
||||
// Note that these are saved in the BSkyBlock database
|
||||
handler = new BBDatabase<>(addon, TopTenData.class);
|
||||
handler = new Database<>(addon, TopTenData.class);
|
||||
loadTopTen();
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ public class TopTen implements Listener {
|
||||
*/
|
||||
public void create(String permPrefix) {
|
||||
// Obtain all the levels for each known player
|
||||
BBDatabase<LevelsData> levelHandler = addon.getHandler();
|
||||
Database<LevelsData> levelHandler = addon.getHandler();
|
||||
long index = 0;
|
||||
for (LevelsData lv : levelHandler.loadObjects()) {
|
||||
if (index++ % 1000 == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user