mirror of
https://github.com/PaperMC/Velocity.git
synced 2024-11-21 03:11:38 +08:00
Complete tab-complete support back to Minecraft 1.8.
This commit is contained in:
parent
9a36bd6cae
commit
2e1de306fb
@ -33,7 +33,10 @@ public enum StateRegistry {
|
||||
PLAY {
|
||||
{
|
||||
SERVERBOUND.register(TabCompleteRequest.class, TabCompleteRequest::new,
|
||||
map(0x01, MINECRAFT_1_12_2),
|
||||
map(0x14, MINECRAFT_1_8),
|
||||
map(0x01, MINECRAFT_1_9),
|
||||
map(0x02, MINECRAFT_1_12),
|
||||
map(0x01, MINECRAFT_1_12_1),
|
||||
map(0x05, MINECRAFT_1_13));
|
||||
SERVERBOUND.register(Chat.class, Chat::new,
|
||||
map(0x01, MINECRAFT_1_8),
|
||||
@ -69,6 +72,8 @@ public enum StateRegistry {
|
||||
map(0x0F, MINECRAFT_1_12),
|
||||
map(0x0E, MINECRAFT_1_13));
|
||||
CLIENTBOUND.register(TabCompleteResponse.class, TabCompleteResponse::new,
|
||||
map(0x3A, MINECRAFT_1_8),
|
||||
map(0x0E, MINECRAFT_1_9),
|
||||
map(0x0E, MINECRAFT_1_12),
|
||||
map(0x10, MINECRAFT_1_13));
|
||||
CLIENTBOUND.register(PluginMessage.class, PluginMessage::new,
|
||||
|
@ -6,6 +6,7 @@ import com.velocitypowered.proxy.protocol.ProtocolUtils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import static com.velocitypowered.proxy.protocol.ProtocolConstants.MINECRAFT_1_13;
|
||||
import static com.velocitypowered.proxy.protocol.ProtocolConstants.MINECRAFT_1_9;
|
||||
|
||||
public class TabCompleteRequest implements MinecraftPacket {
|
||||
private int transactionId;
|
||||
@ -72,7 +73,9 @@ public class TabCompleteRequest implements MinecraftPacket {
|
||||
this.command = ProtocolUtils.readString(buf);
|
||||
} else {
|
||||
this.command = ProtocolUtils.readString(buf);
|
||||
this.assumeCommand = buf.readBoolean();
|
||||
if (protocolVersion >= MINECRAFT_1_9) {
|
||||
this.assumeCommand = buf.readBoolean();
|
||||
}
|
||||
this.hasPosition = buf.readBoolean();
|
||||
if (hasPosition) {
|
||||
this.position = buf.readLong();
|
||||
@ -87,7 +90,9 @@ public class TabCompleteRequest implements MinecraftPacket {
|
||||
ProtocolUtils.writeString(buf, command);
|
||||
} else {
|
||||
ProtocolUtils.writeString(buf, command);
|
||||
buf.writeBoolean(assumeCommand);
|
||||
if (protocolVersion >= MINECRAFT_1_9) {
|
||||
buf.writeBoolean(assumeCommand);
|
||||
}
|
||||
buf.writeBoolean(hasPosition);
|
||||
if (hasPosition) {
|
||||
buf.writeLong(position);
|
||||
|
Loading…
Reference in New Issue
Block a user