diff --git a/.github/ISSUE_TEMPLATE.MD b/.github/ISSUE_TEMPLATE.MD index 0527d7ffc..c3a5da7a2 100644 --- a/.github/ISSUE_TEMPLATE.MD +++ b/.github/ISSUE_TEMPLATE.MD @@ -21,5 +21,5 @@ This can be found by running `/authme version` ### Error Log: Pastebin/Hastebin/Gist link of the error logo or stacktrace (if any) -### COnfiguration: -Pastebin/Hastebin/Gist link of your config.yml file (remember to delete any sesible data) +### Configuration: +Pastebin/Hastebin/Gist link of your config.yml file (remember to delete any sensible data) diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index 0d994cc75..a81619d9c 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -67,21 +67,21 @@ import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.messaging.Messenger; import org.bukkit.scheduler.BukkitScheduler; +import org.bukkit.scheduler.BukkitWorker; import java.io.File; import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; import java.util.Date; +import java.util.Iterator; import java.util.List; +import java.util.logging.Level; import java.util.logging.Logger; import static fr.xephi.authme.settings.properties.EmailSettings.MAIL_ACCOUNT; import static fr.xephi.authme.settings.properties.EmailSettings.MAIL_PASSWORD; import static fr.xephi.authme.settings.properties.EmailSettings.RECALL_PLAYERS; -import java.util.Iterator; -import java.util.logging.Level; -import org.bukkit.scheduler.BukkitWorker; /** * The AuthMe main class. @@ -114,10 +114,6 @@ public class AuthMe extends JavaPlugin { private BukkitService bukkitService; private AuthMeServiceInitializer initializer; private GeoLiteAPI geoLiteApi; - - /* - * Private instances (mail and ProtocolLib) - */ private SendMailSSL mail; /** diff --git a/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeInventoryPacketAdapter.java b/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeInventoryPacketAdapter.java index 64ad7cf3d..a155538eb 100644 --- a/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeInventoryPacketAdapter.java +++ b/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeInventoryPacketAdapter.java @@ -32,7 +32,7 @@ import java.lang.reflect.InvocationTargetException; import java.util.Arrays; import java.util.logging.Level; -public class AuthMeInventoryPacketAdapter extends PacketAdapter { +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 hotbar, 45 off hand) diff --git a/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeTabCompletePacketAdapter.java b/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeTabCompletePacketAdapter.java index ad4d1e0bf..2aef7d066 100644 --- a/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeTabCompletePacketAdapter.java +++ b/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeTabCompletePacketAdapter.java @@ -6,16 +6,12 @@ import com.comphenix.protocol.events.ListenerPriority; import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketEvent; import com.comphenix.protocol.reflect.FieldAccessException; - import fr.xephi.authme.AuthMe; import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.cache.auth.PlayerCache; -import javax.inject.Inject; +class AuthMeTabCompletePacketAdapter extends PacketAdapter { -public class AuthMeTabCompletePacketAdapter extends PacketAdapter { - - @Inject public AuthMeTabCompletePacketAdapter(AuthMe plugin) { super(plugin, ListenerPriority.NORMAL, PacketType.Play.Client.TAB_COMPLETE); } diff --git a/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeTablistPacketAdapter.java b/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeTablistPacketAdapter.java index a26bec83c..75e06cd57 100644 --- a/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeTablistPacketAdapter.java +++ b/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeTablistPacketAdapter.java @@ -21,7 +21,6 @@ import fr.xephi.authme.util.BukkitService; import org.bukkit.Bukkit; import org.bukkit.entity.Player; -import javax.inject.Inject; import java.lang.reflect.InvocationTargetException; import java.util.Arrays; import java.util.Iterator; @@ -29,12 +28,11 @@ import java.util.List; import java.util.UUID; import java.util.logging.Level; -public class AuthMeTablistPacketAdapter extends PacketAdapter { +class AuthMeTablistPacketAdapter extends PacketAdapter { private final BukkitService bukkitService; private boolean isRegistered; - @Inject public AuthMeTablistPacketAdapter(AuthMe plugin, BukkitService bukkitService) { super(plugin, ListenerPriority.NORMAL, PacketType.Play.Server.PLAYER_INFO); this.bukkitService = bukkitService; diff --git a/src/main/java/fr/xephi/authme/listener/protocollib/ProtocolLibService.java b/src/main/java/fr/xephi/authme/listener/protocollib/ProtocolLibService.java index b1f5573a9..a38595279 100644 --- a/src/main/java/fr/xephi/authme/listener/protocollib/ProtocolLibService.java +++ b/src/main/java/fr/xephi/authme/listener/protocollib/ProtocolLibService.java @@ -104,11 +104,9 @@ public class ProtocolLibService implements SettingsDependent { * @param player The player to send the packet to. */ public void sendInventoryPacket(Player player) { - if (!isEnabled || inventoryPacketAdapter == null) { - return; + if (isEnabled && inventoryPacketAdapter != null) { + inventoryPacketAdapter.sendInventoryPacket(player); } - - inventoryPacketAdapter.sendInventoryPacket(player); } /** @@ -117,11 +115,9 @@ public class ProtocolLibService implements SettingsDependent { * @param player The player to send the packet to. */ public void sendBlankInventoryPacket(Player player) { - if (!isEnabled || inventoryPacketAdapter == null) { - return; + if (isEnabled && inventoryPacketAdapter != null) { + inventoryPacketAdapter.sendBlankInventoryPacket(player); } - - inventoryPacketAdapter.sendBlankInventoryPacket(player); } /** @@ -130,11 +126,9 @@ public class ProtocolLibService implements SettingsDependent { * @param player The player to send the packet to. */ public void sendTabList(Player player) { - if (!isEnabled || tablistPacketAdapter == null) { - return; + if (isEnabled && tablistPacketAdapter != null) { + tablistPacketAdapter.sendTablist(player); } - - tablistPacketAdapter.sendTablist(player); } @Override