Fix missing temp player in pre-join channel injectors (#1535)

Closes #1534
This commit is contained in:
Pasqual Koschmieder 2022-03-12 11:33:24 -08:00 committed by GitHub
parent 0d4e4c818f
commit d361526371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -112,7 +112,14 @@ public class InjectionFactory {
}
} else {
// construct a new injector as it seems like we have none yet
injector = new NettyChannelInjector(this.server, networkManager, channel, listener, this, this.errorReporter);
injector = new NettyChannelInjector(
player,
this.server,
networkManager,
channel,
listener,
this,
this.errorReporter);
this.cacheInjector(player, injector);
}
@ -162,6 +169,7 @@ public class InjectionFactory {
Player temporaryPlayer = playerFactory.createTemporaryPlayer(this.server);
NettyChannelInjector injector = new NettyChannelInjector(
temporaryPlayer,
this.server,
netManager,
channel,

View File

@ -110,6 +110,7 @@ public class NettyChannelInjector implements Injector {
private FieldAccessor protocolAccessor;
public NettyChannelInjector(
Player player,
Server server,
Object netManager,
Channel channel,
@ -119,6 +120,7 @@ public class NettyChannelInjector implements Injector {
) {
// bukkit stuff
this.server = server;
this.resolvedPlayer = player;
// protocol lib stuff
this.errorReporter = errorReporter;