3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-24 15:20:35 +01:00

Complete tab-complete support back to Minecraft 1.8.

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-08-09 10:14:44 -04:00
Ursprung 9a36bd6cae
Commit 2e1de306fb
2 geänderte Dateien mit 13 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -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,

Datei anzeigen

@ -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);