mirror of
https://gitlab.com/SamB440/rpgregions-2.git
synced 2025-12-30 12:19:16 +00:00
34 lines
1.2 KiB
Java
34 lines
1.2 KiB
Java
package net.islandearth.rpgregions.managers;
|
|
|
|
import net.islandearth.rpgregions.RPGRegions;
|
|
import net.islandearth.rpgregions.api.integrations.IntegrationManager;
|
|
import net.islandearth.rpgregions.api.integrations.IntegrationType;
|
|
import net.islandearth.rpgregions.managers.data.StorageManager;
|
|
import net.islandearth.rpgregions.managers.data.StorageType;
|
|
|
|
public class RPGRegionsManagers {
|
|
|
|
private StorageManager storageManager;
|
|
private IntegrationManager integrationManager;
|
|
|
|
public RPGRegionsManagers(RPGRegions plugin) {
|
|
StorageType.valueOf(plugin.getConfig().getString("settings.storage.mode").toUpperCase())
|
|
.get()
|
|
.ifPresent(storageManager1 -> storageManager = storageManager1);
|
|
if (storageManager == null) throw new IllegalStateException("Could not find StorageManager!");
|
|
|
|
IntegrationType.valueOf(plugin.getConfig().getString("integration").toUpperCase())
|
|
.get()
|
|
.ifPresent(integrationManager1 -> integrationManager = integrationManager1);
|
|
if (integrationManager == null) throw new IllegalStateException("Could not find StorageManager!");
|
|
}
|
|
|
|
public StorageManager getStorageManager() {
|
|
return storageManager;
|
|
}
|
|
|
|
public IntegrationManager getIntegrationManager() {
|
|
return integrationManager;
|
|
}
|
|
}
|