#432 Create custom dependency injector
This commit is contained in:
@@ -3,6 +3,7 @@ package fr.xephi.authme.process;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.hooks.PluginHooks;
|
||||
import fr.xephi.authme.process.email.AsyncAddEmail;
|
||||
import fr.xephi.authme.process.email.AsyncChangeEmail;
|
||||
import fr.xephi.authme.process.join.AsynchronousJoin;
|
||||
@@ -14,23 +15,26 @@ import fr.xephi.authme.process.unregister.AsynchronousUnregister;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class Management {
|
||||
|
||||
private final AuthMe plugin;
|
||||
private final BukkitScheduler sched;
|
||||
private final ProcessService processService;
|
||||
private final DataSource dataSource;
|
||||
private final PlayerCache playerCache;
|
||||
@Inject
|
||||
private AuthMe plugin;
|
||||
@Inject
|
||||
private BukkitScheduler sched;
|
||||
@Inject
|
||||
private ProcessService processService;
|
||||
@Inject
|
||||
private DataSource dataSource;
|
||||
@Inject
|
||||
private PlayerCache playerCache;
|
||||
@Inject
|
||||
private PluginHooks pluginHooks;
|
||||
|
||||
public Management(AuthMe plugin, ProcessService processService, DataSource dataSource, PlayerCache playerCache) {
|
||||
this.plugin = plugin;
|
||||
this.sched = this.plugin.getServer().getScheduler();
|
||||
this.processService = processService;
|
||||
this.dataSource = dataSource;
|
||||
this.playerCache = playerCache;
|
||||
}
|
||||
Management() { }
|
||||
|
||||
public void performLogin(final Player player, final String password, final boolean forceLogin) {
|
||||
runTask(new AsynchronousLogin(player, password, forceLogin, plugin, dataSource, processService));
|
||||
@@ -49,7 +53,7 @@ public class Management {
|
||||
}
|
||||
|
||||
public void performJoin(final Player player) {
|
||||
runTask(new AsynchronousJoin(player, plugin, dataSource, playerCache, processService));
|
||||
runTask(new AsynchronousJoin(player, plugin, dataSource, playerCache, pluginHooks, processService));
|
||||
}
|
||||
|
||||
public void performQuit(final Player player, final boolean isKick) {
|
||||
|
||||
Reference in New Issue
Block a user