Refactor Velocity networking to be closer to vanilla#1672
Refactor Velocity networking to be closer to vanilla#1672
Conversation
proxy/src/main/java/com/velocitypowered/proxy/command/builtin/VelocityCommand.java
Outdated
Show resolved
Hide resolved
| public UUID getUuid() { | ||
| return uuid; | ||
| } | ||
|
|
||
| public int getAction() { | ||
| return action; | ||
| } |
There was a problem hiding this comment.
Why keeping both getter types is necessary?
There was a problem hiding this comment.
Because the AI (Claude) wanted to make sure the code compiled and it sometimes chose to amend the existing code and sometimes add in getters. I didn't steer it in that direction.
Again, while it's redundant, it's a nit that someone else can fix.
| import org.checkerframework.checker.nullness.qual.Nullable; | ||
|
|
||
| public class DisconnectPacket implements MinecraftPacket { | ||
| public final class DisconnectPacket implements MinecraftPacket { |
There was a problem hiding this comment.
Why some classes like this one aren't records? It has public constructor, all final fields and record style getters, so I can't think of a reason
There was a problem hiding this comment.
I don't think it's worth converting every class to a record, it just wastes time. This feels like a very unimportant nit.
f572af1 to
f390682
Compare
| int expectedMinLen = packet.decodeExpectedMinLength(buf, direction, registry.version); | ||
| int expectedMaxLen = packet.decodeExpectedMaxLength(buf, direction, registry.version); | ||
| private void doLengthSanityChecks(ByteBuf buf, | ||
| com.velocitypowered.proxy.protocol.PacketCodec<? extends MinecraftPacket> codec) |
|
It seems like this PR ( Velocity/proxy/build.gradle.kts Line 85 in 8f65a81 latest.log - https://pastes.dev/92K4RMv1gM - https://mclo.gs/zdPdSDr |
…locity#1672) version might change depending on when Velocity PR is merged
…locity#1672) -> all packets now use record style getters -> all packets now use factory methods instead of constructors -> some constructors have been split up -> VPacketEvents-API is no longer included -> abstract packets removed -> no more decoded boolean feat: move to gradle chore: removed negative time handling from time update packet constructor
…locity#1672) -> all packets now use record style getters -> all packets now use factory methods instead of constructors -> some constructors have been split up -> VPacketEvents-API is no longer included -> abstract packets removed -> no more decoded boolean feat: move to gradle chore: removed negative time handling from time update packet constructor
…locity#1672) -> all packets now use record style getters -> all packets now use factory methods instead of constructors -> some constructors have been split up -> VPacketEvents-API is no longer included -> abstract packets removed -> no more decoded boolean feat: move to gradle chore: removed negative time handling from time update packet constructor
…locity#1672) -> all packets now use record style getters -> all packets now use factory methods instead of constructors -> some constructors have been split up -> VPacketEvents-API is no longer included -> abstract packets removed -> no more decoded boolean feat: move to gradle chore: removed negative time handling from time update packet constructor
This is a really large PR, so review carefully.
This PR refactors Velocity's internal networking to use immutable(-ish) packets and splits encoding/decoding into separate codecs. This refactor isn't fully complete but there's enough to start doing more work on this.