mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-27 23:46:00 +00:00
Turned ClientCommand into an enum
Turned DataReq into an enum Fixed clean up of Swing table (reverse index) When /opis is used, the client requests a full set of data to populate the tables.
This commit is contained in:
1 parent
59d3092131
commit
87b8f3f787
14 files changed
+148
-85
No files matched your search
@@ -7,30 +7,31 @@ import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import mcp.mobius.opis.network.Packets;
|
||||
import mcp.mobius.opis.network.enums.ClientCommand;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
|
||||
public class Packet_ClientCommand {
|
||||
|
||||
public byte header;
|
||||
public byte cmd;
|
||||
public byte header;
|
||||
public ClientCommand cmd;
|
||||
|
||||
public Packet_ClientCommand(Packet250CustomPayload packet) {
|
||||
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
|
||||
try{
|
||||
this.header = inputStream.readByte();
|
||||
this.cmd = inputStream.readByte();
|
||||
this.cmd = ClientCommand.values()[inputStream.readInt()];
|
||||
} catch (IOException e){}
|
||||
|
||||
}
|
||||
|
||||
public static Packet250CustomPayload create(byte cmd){
|
||||
public static Packet250CustomPayload create(ClientCommand cmd){
|
||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(1);
|
||||
DataOutputStream outputStream = new DataOutputStream(bos);
|
||||
|
||||
try{
|
||||
outputStream.writeByte(Packets.CLIENT_CMD);
|
||||
outputStream.writeByte(cmd);
|
||||
outputStream.writeInt(cmd.ordinal());
|
||||
}catch(IOException e){}
|
||||
|
||||
packet.channel = "Opis";
|
||||
|
||||
Reference in new issue
Block a user