mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-24 05:54:29 +00:00
Added skeletton packet for Chunk transfer
This commit is contained in:
1 parent
f3ffbe3256
commit
050bfcaf14
3 files changed
+40
-5
No files matched your search
@@ -1,5 +0,0 @@
|
||||
package mcp.mobius.opis.data.holders;
|
||||
|
||||
public class ChunkData {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package mcp.mobius.opis.network;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
|
||||
public class Packet_Chunks {
|
||||
|
||||
public byte header;
|
||||
|
||||
public Packet_Chunks(Packet250CustomPayload packet) {
|
||||
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
|
||||
|
||||
try{
|
||||
this.header = inputStream.readByte();
|
||||
} catch (IOException e){}
|
||||
}
|
||||
|
||||
public static Packet250CustomPayload create(){
|
||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(1);
|
||||
DataOutputStream outputStream = new DataOutputStream(bos);
|
||||
|
||||
try{
|
||||
outputStream.writeByte(Packets.CHUNKS);
|
||||
}catch(IOException e){}
|
||||
|
||||
packet.channel = "Opis";
|
||||
packet.data = bos.toByteArray();
|
||||
packet.length = bos.size();
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@ public class Packets {
|
||||
public static byte REQ_CHUNKS = 0x03; // C => S //Not used right now
|
||||
public static byte REQ_TICKETS = 0x04; // C => S
|
||||
public static byte TICKETS = 0x05; // S => C
|
||||
public static byte CHUNKS = 0x06; // S => C
|
||||
|
||||
public static byte MEANTIME = 0x10; // S => C
|
||||
public static byte REQ_MEANTIME_IN_DIM = 0x11; // C => S
|
||||
|
||||
Reference in new issue
Block a user