diff --git a/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java b/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java index 4304b1e9..d4438e51 100644 --- a/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java +++ b/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java @@ -172,6 +172,20 @@ public interface ProxiedPlayer extends Connection, CommandSender */ void sendTitle(Title title); + /** + * Gets whether this player is using a FML client. + *
+ * This method is only reliable if BungeeCord links Minecraft 1.8 servers
+ * together, as Bungee can pick up whether a user is a Forge user with the
+ * initial handshake. If this is used for a 1.7 network, this might return
+ * false
even if the user is a FML user, as Bungee can only
+ * determine this information if a handshake successfully completes.
+ *
true
if it is known that the user is using a FML
+ * client, false
otherwise.
+ */
+ boolean isForgeUser();
+
/**
* Gets this player's Forge Mod List, if the player has sent this
* information during the lifetime of their connection to Bungee. There is
@@ -181,7 +195,8 @@ public interface ProxiedPlayer extends Connection, CommandSender
* * Consumers of this API should be aware that an empty mod list does * not indicate that a user is not a Forge user, and so should not - * use this API to check for this - there is no way to tell this reliably. + * use this API to check for this. See the {@link #isForgeUser() + * isForgeUser} method instead. *
** Calling this when handling a @@ -189,7 +204,7 @@ public interface ProxiedPlayer extends Connection, CommandSender * place to do so as this event occurs after a FML handshake has completed, * if any has occurred. *
- * + * * @return A {@link Map} of mods, where the key is the name of the mod, and * the value is the version. Returns an empty list if the FML handshake has * not occurred for this {@link ProxiedPlayer} yet. diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index 936e6845..4a85f4eb 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -519,6 +519,12 @@ public final class UserConnection implements ProxiedPlayer return ( locale == null && settings != null ) ? locale = Locale.forLanguageTag( settings.getLocale().replaceAll( "_", "-" ) ) : locale; } + @Override + public boolean isForgeUser() + { + return forgeClientHandler.isForgeUser(); + } + @Override public Map