#421 Create PluginHooks
- PluginHooks manages third-party plugins and allows to perform actions and queries on them, instead of public fields on the AuthMe main class
This commit is contained in:
@@ -2,6 +2,7 @@ package fr.xephi.authme.process;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.cache.IpAddressManager;
|
||||
import fr.xephi.authme.hooks.PluginHooks;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.security.PasswordSecurity;
|
||||
@@ -22,14 +23,16 @@ public class ProcessService {
|
||||
private final AuthMe authMe;
|
||||
private final IpAddressManager ipAddressManager;
|
||||
private final PasswordSecurity passwordSecurity;
|
||||
private final PluginHooks pluginHooks;
|
||||
|
||||
public ProcessService(NewSetting settings, Messages messages, AuthMe authMe, IpAddressManager ipAddressManager,
|
||||
PasswordSecurity passwordSecurity) {
|
||||
PasswordSecurity passwordSecurity, PluginHooks pluginHooks) {
|
||||
this.settings = settings;
|
||||
this.messages = messages;
|
||||
this.authMe = authMe;
|
||||
this.ipAddressManager = ipAddressManager;
|
||||
this.passwordSecurity = passwordSecurity;
|
||||
this.pluginHooks = pluginHooks;
|
||||
}
|
||||
|
||||
public <T> T getProperty(Property<T> property) {
|
||||
@@ -84,4 +87,8 @@ public class ProcessService {
|
||||
return passwordSecurity.computeHash(password, username);
|
||||
}
|
||||
|
||||
public PluginHooks getPluginHooks() {
|
||||
return pluginHooks;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ public class AsynchronousJoin implements Process {
|
||||
return;
|
||||
}
|
||||
|
||||
if (plugin.ess != null && service.getProperty(HooksSettings.DISABLE_SOCIAL_SPY)) {
|
||||
plugin.ess.getUser(player).setSocialSpyEnabled(false);
|
||||
if (service.getProperty(HooksSettings.DISABLE_SOCIAL_SPY)) {
|
||||
service.getPluginHooks().setEssentialsSocialSpyStatus(player, false);
|
||||
}
|
||||
|
||||
final String ip = service.getIpAddressManager().getPlayerIp(player);
|
||||
|
||||
Reference in New Issue
Block a user