Skip to content

Commit

Permalink
Fix finding player network channel with Protocollib and Floodgate
Browse files Browse the repository at this point in the history
This resolves the deleted ProtocolLib method for newer builds, but uses
reflection to find the channel despite the variable name.

Fixes #1216
  • Loading branch information
games647 committed Jul 8, 2024
1 parent 51efb9d commit 4dd6b9a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ private static Channel getChannel(Player player) {
NettyChannelInjector injector = (NettyChannelInjector) Accessors.getMethodAccessorOrNull(
TemporaryPlayerFactory.class, "getInjectorFromPlayer", Player.class
).invoke(null, player);
return injector.getWrappedChannel();
return FuzzyReflection.getFieldValue(injector, Channel.class, true);
}

/**
Expand Down

0 comments on commit 4dd6b9a

Please sign in to comment.