-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMinecraftNetwork.bt
54 lines (50 loc) · 1.36 KB
/
MinecraftNetwork.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//------------------------------------------------
//--- 010 Editor v10.0 Binary Template
//
// File: MinecraftNetwork
// Authors: MrNikes
// Version: 0.0.1
// Purpose: Minecraft Network Protocol
// Category: Misc
// File Mask:
// ID Bytes:
// History:
// 0.1 2022-09-10 MrNikes: Added read chunk packet
//------------------------------------------------
#include "MinecraftBufferCommon.bt"
#include "MinecraftNBT.bt"
#include "mcproto/JoinGame.bt"
#include "mcproto/MapChunk.bt"
#include "mcproto/Login.bt"
local uint protocol = 760;
BigEndian();
typedef struct(uint proto, uint64 packetId) {
local int protocol = proto;
local uint64 id = packetId;
switch (protocol) {
case 758:
switch (id) {
case 0x22:
ChunkDataMessage data(protocol);
break;
case 0x26: // 38
JoinGameMessage data(protocol);
break;
}
break;
case 760:
switch (id) {
case 0x1f:
ChunkDataMessage data(protocol);
break;
case 0x25:
LoginMessage data(protocol);
break;
}
break;
}
} Message;
struct Packet {
VarType PacketId;
Message Data(protocol, PacketId.value);
} file;