Fix compatibility issues
This commit is contained in:
@@ -24,7 +24,6 @@ import org.bukkit.scheduler.BukkitTask;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
import org.mcstats.Metrics;
|
||||
import com.comphenix.protocol.ProtocolLibrary;
|
||||
import com.earth2me.essentials.Essentials;
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
@@ -474,7 +473,7 @@ public class AuthMe extends JavaPlugin {
|
||||
if (Settings.protectInventoryBeforeLogInEnabled) {
|
||||
if (server.getPluginManager().isPluginEnabled("ProtocolLib")) {
|
||||
inventoryProtector = new AuthMeInventoryListener(this);
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(inventoryProtector);
|
||||
inventoryProtector.register();
|
||||
} else {
|
||||
ConsoleLogger.showError("WARNING!!! The protectInventory feature requires ProtocolLib! Disabling it...");
|
||||
Settings.protectInventoryBeforeLogInEnabled = false;
|
||||
|
||||
@@ -60,6 +60,10 @@ public class AuthMeInventoryListener extends PacketAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
public void register() {
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(this);
|
||||
}
|
||||
|
||||
public void sendInventoryPacket(Player player) {
|
||||
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
|
||||
PacketContainer inventoryPacket = protocolManager.createPacket(PacketType.Play.Server.WINDOW_ITEMS);
|
||||
|
||||
Reference in New Issue
Block a user