Fixed ServerboundChatCommandPacket

This commit is contained in:
LOOHP 2024-05-27 23:24:55 +01:00
parent af380214ef
commit dfbbc49f67
1 changed files with 2 additions and 32 deletions

View File

@ -19,56 +19,26 @@
package com.loohp.limbo.network.protocol.packets; package com.loohp.limbo.network.protocol.packets;
import com.loohp.limbo.utils.ArgumentSignatures;
import com.loohp.limbo.utils.DataTypeIO; import com.loohp.limbo.utils.DataTypeIO;
import com.loohp.limbo.utils.LastSeenMessages;
import java.io.DataInputStream; import java.io.DataInputStream;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.time.Instant;
public class ServerboundChatCommandPacket extends PacketIn { public class ServerboundChatCommandPacket extends PacketIn {
private String command; private final String command;
private Instant time;
private long salt;
private ArgumentSignatures argumentSignatures;
private LastSeenMessages.b lastSeenMessages;
public ServerboundChatCommandPacket(String command, Instant time, long salt, ArgumentSignatures argumentSignatures, LastSeenMessages.b lastSeenMessages) { public ServerboundChatCommandPacket(String command) {
this.command = command; this.command = command;
this.time = time;
this.salt = salt;
this.argumentSignatures = argumentSignatures;
this.lastSeenMessages = lastSeenMessages;
} }
public ServerboundChatCommandPacket(DataInputStream in) throws IOException { public ServerboundChatCommandPacket(DataInputStream in) throws IOException {
this.command = DataTypeIO.readString(in, StandardCharsets.UTF_8); this.command = DataTypeIO.readString(in, StandardCharsets.UTF_8);
this.time = Instant.ofEpochMilli(in.readLong());
this.salt = in.readLong();
this.argumentSignatures = new ArgumentSignatures(in);
this.lastSeenMessages = new LastSeenMessages.b(in);
} }
public String getCommand() { public String getCommand() {
return command; return command;
} }
public Instant getTime() {
return time;
}
public long getSalt() {
return salt;
}
public ArgumentSignatures getArgumentSignatures() {
return argumentSignatures;
}
public LastSeenMessages.b getLastSeenMessages() {
return lastSeenMessages;
}
} }