Bungeecord support added x4
This commit is contained in:
parent
b5c97995e9
commit
4293752e41
@ -58,16 +58,14 @@ public class XCraft extends Plugin implements Listener {
|
|||||||
try {
|
try {
|
||||||
PendingConnection connection = event.getConnection();
|
PendingConnection connection = event.getConnection();
|
||||||
|
|
||||||
// Ensure we are dealing with InitialHandler
|
if (!connection.getClass().getName().equals("net.md_5.bungee.connection.InitialHandler")) return;
|
||||||
if (!connection.getClass().getName().equals("net.md_5.bungee.connection.InitialHandler")) {
|
if( !server.getSessionValue(connection.getUniqueId().toString()) ) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Class<?> initialHandlerClass = connection.getClass();
|
Class<?> initialHandlerClass = connection.getClass();
|
||||||
|
|
||||||
Field onlineModeField = initialHandlerClass.getDeclaredField("onlineMode");
|
Field onlineModeField = initialHandlerClass.getDeclaredField("onlineMode");
|
||||||
onlineModeField.setAccessible(true);
|
onlineModeField.setAccessible(true);
|
||||||
onlineModeField.set(connection, false); // Disable Mojang auth
|
onlineModeField.set(connection, false);
|
||||||
|
|
||||||
getLogger().info("Bypassed Mojang authentication for " + connection.getName());
|
getLogger().info("Bypassed Mojang authentication for " + connection.getName());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user