mirror of https://github.com/Minestom/Minestom.git
parent
e5ac2f835e
commit
7e6933d7b1
|
@ -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";
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue