diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index 7821fa89c..b252d5ba3 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -1,34 +1,7 @@ package fr.xephi.authme; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.net.URL; -import java.net.URLConnection; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; -import java.util.logging.Logger; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Server; -import org.bukkit.World; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.plugin.PluginManager; -import org.bukkit.plugin.RegisteredServiceProvider; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.scheduler.BukkitTask; -import org.apache.logging.log4j.LogManager; - -import org.mcstats.Metrics; import com.earth2me.essentials.Essentials; import com.onarandombox.MultiverseCore.MultiverseCore; -import net.milkbowl.vault.permission.Permission; -import net.minelink.ctplus.CombatTagPlus; - import fr.xephi.authme.api.API; import fr.xephi.authme.api.NewAPI; import fr.xephi.authme.cache.auth.PlayerAuth; @@ -49,6 +22,31 @@ import fr.xephi.authme.settings.Messages; import fr.xephi.authme.settings.OtherAccounts; import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.Spawn; +import net.milkbowl.vault.permission.Permission; +import net.minelink.ctplus.CombatTagPlus; +import org.apache.logging.log4j.LogManager; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Server; +import org.bukkit.World; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.plugin.PluginManager; +import org.bukkit.plugin.RegisteredServiceProvider; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitTask; +import org.mcstats.Metrics; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.logging.Logger; public class AuthMe extends JavaPlugin { @@ -74,7 +72,7 @@ public class AuthMe extends JavaPlugin { public Essentials ess; public MultiverseCore multiverse; public CombatTagPlus combatTagPlus; - public AuthMeInventoryListener inventoryProtector; + public AuthMeInventoryPacketAdapter inventoryProtector; // Manager private ModuleManager moduleManager; @@ -478,7 +476,7 @@ public class AuthMe extends JavaPlugin { public void checkProtocolLib() { if (Settings.protectInventoryBeforeLogInEnabled) { if (server.getPluginManager().isPluginEnabled("ProtocolLib")) { - inventoryProtector = new AuthMeInventoryListener(this); + inventoryProtector = new AuthMeInventoryPacketAdapter(this); inventoryProtector.register(); } else { ConsoleLogger.showError("WARNING!!! The protectInventory feature requires ProtocolLib! Disabling it..."); diff --git a/src/main/java/fr/xephi/authme/listener/AuthMeInventoryListener.java b/src/main/java/fr/xephi/authme/listener/AuthMeInventoryPacketAdapter.java similarity index 97% rename from src/main/java/fr/xephi/authme/listener/AuthMeInventoryListener.java rename to src/main/java/fr/xephi/authme/listener/AuthMeInventoryPacketAdapter.java index 08ccacff3..c045a94eb 100644 --- a/src/main/java/fr/xephi/authme/listener/AuthMeInventoryListener.java +++ b/src/main/java/fr/xephi/authme/listener/AuthMeInventoryPacketAdapter.java @@ -34,7 +34,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.logging.Level; -public class AuthMeInventoryListener extends PacketAdapter { +public class AuthMeInventoryPacketAdapter extends PacketAdapter { private static final int PLAYER_INVENTORY = 0; //http://wiki.vg/Inventory#Inventory (0-4 crafting, 5-8 armor, 9-35 main inventory, 36-44 inventory) @@ -42,7 +42,7 @@ public class AuthMeInventoryListener extends PacketAdapter { private static final int PLAYER_CRAFTING_SIZE = 5; private static final int HOTBAR_SIZE = 9; - public AuthMeInventoryListener(AuthMe plugin) { + public AuthMeInventoryPacketAdapter(AuthMe plugin) { super(plugin, PacketType.Play.Server.SET_SLOT, PacketType.Play.Server.WINDOW_ITEMS); }