Archiviert
13
0

Don't update the player instances on the LOGIN packet.

Instead, always check for the presence of NetServerHandler, 
and update then.
Dieser Commit ist enthalten in:
Kristian S. Stangeland 2014-02-21 19:14:58 +01:00
Ursprung eb421dd31e
Commit eb7760236f

Datei anzeigen

@ -588,9 +588,14 @@ public abstract class PlayerInjector implements SocketInjector {
// Hack #1 // Hack #1
if (updateOnLogin) { if (updateOnLogin) {
if (id == Packets.Server.LOGIN) { if (updatedPlayer == null) {
try { try {
updatedPlayer = (Player) MinecraftReflection.getBukkitEntity(getEntityPlayer(getNetHandler())); final Object handler = getNetHandler();
// Is this a net server class?
if (MinecraftReflection.getNetServerHandlerClass().isAssignableFrom(handler.getClass())) {
updatedPlayer = (Player) MinecraftReflection.getBukkitEntity(getEntityPlayer(handler));
}
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
reporter.reportDetailed(this, Report.newBuilder(REPORT_CANNOT_UPDATE_PLAYER).error(e).callerParam(packet)); reporter.reportDetailed(this, Report.newBuilder(REPORT_CANNOT_UPDATE_PLAYER).error(e).callerParam(packet));
} }