Skip to content

Commit 4dd6b9a

Browse files
author
games647
committed
Fix finding player network channel with Protocollib and Floodgate
This resolves the deleted ProtocolLib method for newer builds, but uses reflection to find the channel despite the variable name. Fixes #1216
1 parent 51efb9d commit 4dd6b9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ProtocolLibListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ private static Channel getChannel(Player player) {
304304
NettyChannelInjector injector = (NettyChannelInjector) Accessors.getMethodAccessorOrNull(
305305
TemporaryPlayerFactory.class, "getInjectorFromPlayer", Player.class
306306
).invoke(null, player);
307-
return injector.getWrappedChannel();
307+
return FuzzyReflection.getFieldValue(injector, Channel.class, true);
308308
}
309309

310310
/**

0 commit comments

Comments
 (0)