Skip to content

Commit

Permalink
Support Velocity 1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ARTI5T committed Apr 29, 2024
1 parent c075c54 commit 1c11a37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package work.art1st.proxiedproxy.platform.velocity.connection;

import com.velocitypowered.api.network.HandshakeIntent;
import com.velocitypowered.api.network.ProtocolVersion;
import com.velocitypowered.api.proxy.server.RegisteredServer;
import com.velocitypowered.api.proxy.server.ServerPing;
Expand Down Expand Up @@ -34,7 +35,7 @@ public class VPingSessionHandler implements MinecraftSessionHandler {

public void activated() {
HandshakePacket handshake = new HandshakePacket();
handshake.setNextStatus(1);
handshake.setIntent(HandshakeIntent.STATUS);
handshake.setServerAddress(vHost);
handshake.setPort(this.server.getServerInfo().getAddress().getPort());
handshake.setProtocolVersion(this.version);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package work.art1st.proxiedproxy.platform.velocity.packet;

import com.velocitypowered.api.network.HandshakeIntent;
import com.velocitypowered.api.network.ProtocolVersion;
import com.velocitypowered.proxy.protocol.ProtocolUtils;
import com.velocitypowered.proxy.protocol.packet.HandshakePacket;
Expand All @@ -18,6 +19,6 @@ public void decode(ByteBuf buf, ProtocolUtils.Direction direction, ProtocolVersi
this.setProtocolVersion(ProtocolVersion.getProtocolVersion(realProtocolVersion));
this.setServerAddress(ProtocolUtils.readString(buf, MAXIMUM_HOSTNAME_LENGTH));
this.setPort(buf.readUnsignedShort());
this.setNextStatus(ProtocolUtils.readVarInt(buf));
this.setIntent(HandshakeIntent.getById(ProtocolUtils.readVarInt(buf)));
}
}

0 comments on commit 1c11a37

Please sign in to comment.