Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ public class ZStorageManager extends ZUtils implements StorageManager {

private final IStorage iStorage;
private final EssentialsPlugin plugin;
private final StorageType storageType;

public ZStorageManager(EssentialsPlugin plugin) {
this.plugin = plugin;
StorageType storageType = plugin.getConfiguration().getStorageType();
this.iStorage = switch (storageType) {
case HIKARICP, SQLITE, MYSQL, MARIADB -> new SqlStorage(plugin, storageType);
this.storageType = plugin.getConfiguration().getStorageType();
this.iStorage = switch (this.storageType) {
case HIKARICP, SQLITE, MYSQL, MARIADB -> new SqlStorage(plugin, this.storageType);
default -> new JsonStorage(plugin);
};
}
Expand All @@ -56,7 +57,7 @@ public IStorage getStorage() {

@Override
public StorageType getType() {
return this.plugin.getStorageManager().getType();
return this.storageType;
}

@EventHandler(priority = EventPriority.HIGHEST)
Expand Down
Loading