mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-02-15 20:12:13 +01:00
Replace some debug info with the actual cause
This commit is contained in:
parent
e34105e754
commit
015a6067fd
@ -582,36 +582,27 @@ public class ChannelInjector extends ByteToMessageDecoder implements Injector {
|
|||||||
* @param packet - the packet.
|
* @param packet - the packet.
|
||||||
*/
|
*/
|
||||||
protected void handleLogin(Class<?> packetClass, Object packet) {
|
protected void handleLogin(Class<?> packetClass, Object packet) {
|
||||||
try {
|
// Try to find the login packet class
|
||||||
Class<?> loginClass = PACKET_LOGIN_CLIENT;
|
if (PACKET_LOGIN_CLIENT == null) {
|
||||||
FieldAccessor loginClient = LOGIN_GAME_PROFILE;
|
PACKET_LOGIN_CLIENT = PacketType.Login.Client.START.getPacketClass();
|
||||||
|
|
||||||
// Initialize packet class and login
|
|
||||||
if (loginClass == null) {
|
|
||||||
loginClass = PacketType.Login.Client.START.getPacketClass();
|
|
||||||
PACKET_LOGIN_CLIENT = loginClass;
|
|
||||||
}
|
}
|
||||||
if (loginClient == null) {
|
|
||||||
loginClient = Accessors.getFieldAccessor(PACKET_LOGIN_CLIENT, MinecraftReflection.getGameProfileClass(), true);
|
// If we can't, there's an issue
|
||||||
LOGIN_GAME_PROFILE = loginClient;
|
if (PACKET_LOGIN_CLIENT == null) {
|
||||||
|
throw new IllegalStateException("Failed to obtain login start packet. Did you build Spigot with BuildTools?");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LOGIN_GAME_PROFILE == null) {
|
||||||
|
LOGIN_GAME_PROFILE = Accessors.getFieldAccessor(PACKET_LOGIN_CLIENT, MinecraftReflection.getGameProfileClass(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if we are dealing with the login packet
|
// See if we are dealing with the login packet
|
||||||
if (loginClass.equals(packetClass)) {
|
if (PACKET_LOGIN_CLIENT.equals(packetClass)) {
|
||||||
// GameProfile profile = (GameProfile) loginClient.get(packet);
|
WrappedGameProfile profile = WrappedGameProfile.fromHandle(LOGIN_GAME_PROFILE.get(packet));
|
||||||
WrappedGameProfile profile = WrappedGameProfile.fromHandle(loginClient.get(packet));
|
|
||||||
|
|
||||||
// Save the channel injector
|
// Save the channel injector
|
||||||
factory.cacheInjector(profile.getName(), this);
|
factory.cacheInjector(profile.getName(), this);
|
||||||
}
|
}
|
||||||
} catch (IllegalArgumentException ex) { // Thrown by FuzzyReflection#getFields()
|
|
||||||
System.err.println(String.format("[ProtocolLib] Encountered NPE in handleLogin(%s, %s)", packetClass, packet));
|
|
||||||
System.err.println("PACKET_LOGIN_CLIENT = " + PACKET_LOGIN_CLIENT);
|
|
||||||
System.err.println("LOGIN_GAME_PROFILE = " + LOGIN_GAME_PROFILE);
|
|
||||||
System.err.println("GameProfile class = " + MinecraftReflection.getGameProfileClass());
|
|
||||||
System.err.println("Provide this information in a new or existing issue");
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user