Skip to content

26.1 support#24

Open
pianoman911 wants to merge 2 commits intomasterfrom
feat/26.1-support
Open

26.1 support#24
pianoman911 wants to merge 2 commits intomasterfrom
feat/26.1-support

Conversation

@pianoman911
Copy link
Copy Markdown
Member

Fully tested

@pianoman911 pianoman911 requested a review from booky10 April 5, 2026 15:33
@pianoman911 pianoman911 self-assigned this Apr 5, 2026
Comment on lines +27 to +53
@Override
public boolean acceptInboundMessage(Object msg) {
return msg instanceof ServerboundInteractPacket || msg instanceof ServerboundSwingPacket;
}

@Override
protected void decode(ChannelHandlerContext ctx, Packet<?> msg, List<Object> out) {
PassthroughMode passthroughMode = null;
if (msg instanceof ServerboundInteractPacket interact) {
int entityId = interact.entityId();
Vec3 pos = interact.location();

passthroughMode = this.bridge.handleInteract(this.player, entityId, pos.x, pos.y, pos.z);
} else if (msg instanceof ServerboundSwingPacket) {
passthroughMode = this.bridge.handleSwing(this.player);
if (passthroughMode == PassthroughMode.ONLY_ANIMATION) {
ClientboundAnimatePacket animatePacket = new ClientboundAnimatePacket(((CraftPlayer) this.player).getHandle(),
ClientboundAnimatePacket.SWING_MAIN_HAND);
this.player.getTrackedBy().forEach(player -> ((CraftPlayer) player).getHandle().connection.send(animatePacket));
}
}
if (passthroughMode != null && passthroughMode != PassthroughMode.ALL) {
return;
}

out.add(msg);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ServerboundAttackPacket should probably be handled now, like before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants