#604 - Move ProtocolLib adapters to new package and add ProtocolLibService

This commit is contained in:
Gnat008
2016-06-27 15:38:43 -04:00
parent 1361174892
commit 23836cda6a
10 changed files with 188 additions and 109 deletions
@@ -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() + "...");
}