Skip to content

Commit

Permalink
feat(velocity): disable netty injection when packetevents is in use
Browse files Browse the repository at this point in the history
  • Loading branch information
diogotcorreia committed Feb 14, 2025
1 parent dfffff1 commit 231240e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ public void refreshAll() {
}

public void injectNettyPipeline() {
if (Triton.get().getConfig().isUsePacketEvents()) {
// PacketEvents handler covers all packets translated by Velocity,
// so no need to inject ourselves into netty anymore.
Triton.get().getLogger().logDebug("Skipped injecting into netty pipeline for player %1 because PacketEvents is in use", getUUID());
return;
}
ConnectedPlayer connectedPlayer = (ConnectedPlayer) this.parent;
connectedPlayer.getConnection().getChannel().pipeline()
.addAfter(Connections.MINECRAFT_ENCODER, "triton-custom-encoder", new VelocityNettyEncoder(this));
Expand Down

0 comments on commit 231240e

Please sign in to comment.