#604 - Move ProtocolLib adapters to new package and add ProtocolLibService
This commit is contained in:
@@ -9,6 +9,7 @@ import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.events.ProtectInventoryEvent;
|
||||
import fr.xephi.authme.hooks.PluginHooks;
|
||||
import fr.xephi.authme.listener.protocollib.ProtocolLibService;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.permission.AuthGroupType;
|
||||
import fr.xephi.authme.permission.PlayerStatePermission;
|
||||
@@ -68,6 +69,9 @@ public class AsynchronousJoin implements AsynchronousProcess {
|
||||
@Inject
|
||||
private BukkitService bukkitService;
|
||||
|
||||
@Inject
|
||||
private ProtocolLibService protocolLibService;
|
||||
|
||||
@Inject
|
||||
private LimboPlayerTaskManager limboPlayerTaskManager;
|
||||
|
||||
@@ -126,11 +130,11 @@ public class AsynchronousJoin implements AsynchronousProcess {
|
||||
limboCache.updateLimboPlayer(player);
|
||||
|
||||
// Protect inventory
|
||||
if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN) && plugin.getInventoryProtector() != null) {
|
||||
if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) {
|
||||
ProtectInventoryEvent ev = new ProtectInventoryEvent(player);
|
||||
bukkitService.callEvent(ev);
|
||||
if (ev.isCancelled()) {
|
||||
plugin.getInventoryProtector().sendInventoryPacket(player);
|
||||
protocolLibService.sendInventoryPacket(player);
|
||||
if (!service.getProperty(SecuritySettings.REMOVE_SPAM_FROM_CONSOLE)) {
|
||||
ConsoleLogger.info("ProtectInventoryEvent has been cancelled for " + player.getName() + "...");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user