mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-04 23:48:42 +01:00
Fixed old API (deprecated) not being initialized
This commit is contained in:
parent
1185aa05f2
commit
a6a16764dc
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.djrapitops.plan;
|
||||
|
||||
import com.djrapitops.plan.api.PlanAPI;
|
||||
import com.djrapitops.plan.capability.CapabilityServiceImplementation;
|
||||
import com.djrapitops.plan.delivery.DeliveryUtilities;
|
||||
import com.djrapitops.plan.delivery.export.ExportSystem;
|
||||
@ -96,7 +97,8 @@ public class PlanSystem implements SubSystem {
|
||||
ExtensionServiceImplementation extensionService,
|
||||
QueryServiceImplementation queryService,
|
||||
SettingsServiceImplementation settingsService,
|
||||
ErrorHandler errorHandler
|
||||
ErrorHandler errorHandler,
|
||||
PlanAPI.PlanAPIHolder apiHolder
|
||||
) {
|
||||
this.files = files;
|
||||
this.configSystem = configSystem;
|
||||
|
@ -19,7 +19,13 @@ package com.djrapitops.plan.api;
|
||||
import com.djrapitops.plan.api.data.PlayerContainer;
|
||||
import com.djrapitops.plan.api.data.ServerContainer;
|
||||
import com.djrapitops.plan.data.plugin.PluginData;
|
||||
import com.djrapitops.plan.identification.UUIDUtility;
|
||||
import com.djrapitops.plan.storage.database.DBSystem;
|
||||
import com.djrapitops.plugin.logging.console.PluginLogger;
|
||||
import com.djrapitops.plugin.logging.error.ErrorHandler;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
@ -39,6 +45,7 @@ public interface PlanAPI {
|
||||
.orElseThrow(() -> new IllegalStateException("PlanAPI has not been initialised yet."));
|
||||
}
|
||||
|
||||
@Singleton
|
||||
class PlanAPIHolder {
|
||||
static PlanAPI API;
|
||||
|
||||
@ -46,8 +53,14 @@ public interface PlanAPI {
|
||||
PlanAPIHolder.API = api;
|
||||
}
|
||||
|
||||
private PlanAPIHolder() {
|
||||
/* Static variable holder */
|
||||
@Inject
|
||||
public PlanAPIHolder(
|
||||
DBSystem dbSystem,
|
||||
UUIDUtility uuidUtility,
|
||||
PluginLogger logger,
|
||||
ErrorHandler errorHandler
|
||||
) {
|
||||
set(new CommonAPI(dbSystem, uuidUtility, logger, errorHandler));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user