1.19.1-pre3

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2022-07-07 05:51:19 +02:00
parent e5ac2f835e
commit 7e6933d7b1
3 changed files with 38 additions and 2 deletions

View File

@ -46,8 +46,8 @@ public final class MinecraftServer {
public final static Logger LOGGER = LoggerFactory.getLogger(MinecraftServer.class);
public static final String VERSION_NAME = "1.19.1";
public static final int PROTOCOL_VERSION = 1073741919;
public static final String VERSION_NAME = "1.19.1-pre3";
public static final int PROTOCOL_VERSION = 1073741920;
// Threads
public static final String THREAD_NAME_BENCHMARK = "Ms-Benchmark";

View File

@ -32,6 +32,7 @@ public final class ServerPacketIdentifier {
public static final int WINDOW_PROPERTY = nextPlayId();
public static final int SET_SLOT = nextPlayId();
public static final int SET_COOLDOWN = nextPlayId();
public static final int CUSTOM_CHAT_COMPLETIONS = nextPlayId();
public static final int PLUGIN_MESSAGE = nextPlayId();
public static final int NAMED_SOUND_EFFECT = nextPlayId();
public static final int DISCONNECT = nextPlayId();

View File

@ -0,0 +1,35 @@
package net.minestom.server.network.packet.server.play;
import net.minestom.server.network.packet.server.ServerPacket;
import net.minestom.server.network.packet.server.ServerPacketIdentifier;
import net.minestom.server.utils.binary.BinaryReader;
import net.minestom.server.utils.binary.BinaryWriter;
import org.jetbrains.annotations.NotNull;
import java.util.List;
public record CustomChatCompletionPacket(@NotNull Action action,
@NotNull List<@NotNull String> entries) implements ServerPacket {
public CustomChatCompletionPacket {
entries = List.copyOf(entries);
}
public CustomChatCompletionPacket(BinaryReader reader) {
this(Action.values()[reader.readVarInt()], reader.readVarIntList(BinaryReader::readSizedString));
}
@Override
public void write(@NotNull BinaryWriter writer) {
writer.writeVarInt(action.ordinal());
writer.writeVarIntList(entries, BinaryWriter::writeSizedString);
}
@Override
public int getId() {
return ServerPacketIdentifier.CUSTOM_CHAT_COMPLETIONS;
}
public enum Action {
ADD, REMOVE, SET
}
}