Skip to content

Commit 72c5906

Browse files
Merge pull request #19 from pixeils/master
Update to 1.17.1
2 parents a31ea18 + ddff866 commit 72c5906

14 files changed

+258
-37
lines changed

protocol.json

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,163 @@
11
{
2+
"756": {
3+
"Clientbound": {
4+
"0": "Spawn Entity",
5+
"1": "Spawn Experience Orb",
6+
"2": "Spawn Living Entity",
7+
"3": "Spawn Painting",
8+
"4": "Spawn Player",
9+
"5": "Sculk Vibration Signal",
10+
"6": "Entity Animation (clientbound)",
11+
"7": "Statistics",
12+
"8": "Acknowledge Player Digging",
13+
"9": "Block Break Animation",
14+
"10": "Block Entity Data",
15+
"11": "Block Action",
16+
"12": "Block Change",
17+
"13": "Boss Bar",
18+
"14": "Server Difficulty",
19+
"15": "Chat Message (clientbound)",
20+
"16": "Clear Titles",
21+
"17": "Tab-Complete (clientbound)",
22+
"18": "Declare Commands",
23+
"19": "Close Window (clientbound)",
24+
"20": "Window Items",
25+
"21": "Window Property",
26+
"22": "Set Slot",
27+
"23": "Set Cooldown",
28+
"24": "Plugin Message (clientbound)",
29+
"25": "Named Sound Effect",
30+
"26": "Disconnect (play)",
31+
"27": "Entity Status",
32+
"28": "Explosion",
33+
"29": "Unload Chunk",
34+
"30": "Change Game State",
35+
"31": "Open Horse Window",
36+
"32": "Initialize World Border",
37+
"33": "Keep Alive (clientbound)",
38+
"34": "Chunk Data",
39+
"35": "Effect",
40+
"36": "Particle",
41+
"37": "Update Light",
42+
"38": "Join Game",
43+
"39": "Map Data",
44+
"40": "Trade List",
45+
"41": "Entity Position",
46+
"42": "Entity Position and Rotation",
47+
"43": "Entity Rotation",
48+
"44": "Vehicle Move (clientbound)",
49+
"45": "Open Book",
50+
"46": "Open Window",
51+
"47": "Open Sign Editor",
52+
"48": "Ping",
53+
"49": "Craft Recipe Response",
54+
"50": "Player Abilities (clientbound)",
55+
"51": "End Combat Event",
56+
"52": "Enter Combat Event",
57+
"53": "Death Combat Event",
58+
59+
"54": "Player Info",
60+
"55": "Face Player",
61+
"56": "Player Position And Look (clientbound)",
62+
"57": "Unlock Recipes",
63+
"58": "Destroy Entities",
64+
"59": "Remove Entity Effect",
65+
"60": "Resource Pack Send",
66+
"61": "Respawn",
67+
"62": "Entity Head Look",
68+
"63": "Multi Block Change",
69+
"64": "Select Advancement Tab",
70+
"65": "Action Bar",
71+
"66": "World Border Center",
72+
"67": "World Border Lerp Size",
73+
"68": "World Border Size",
74+
"69": "World Border Warning Delay",
75+
"70": "World Border Warning Reach",
76+
"71": "Camera",
77+
"72": "Held Item Change (clientbound)",
78+
"73": "Update View Position",
79+
"74": "Update View Distance",
80+
"75": "Spawn Position",
81+
"76": "Display Scoreboard",
82+
"77": "Entity Metadata",
83+
"78": "Attach Entity",
84+
"79": "Entity Velocity",
85+
"80": "Entity Equipment",
86+
"81": "Set Experience",
87+
"82": "Update Health",
88+
"83": "Scoreboard Objective",
89+
"84": "Set Passengers",
90+
"85": "Teams",
91+
"86": "Update Score",
92+
"87": "Set Title SubTitle",
93+
"88": "Time Update",
94+
"89": "Set Title Text",
95+
"90": "Set Title Times",
96+
"91": "Entity Sound Effect",
97+
"92": "Sound Effect",
98+
"93": "Stop Sound",
99+
"94": "Player List Header And Footer",
100+
"95": "NBT Query Response",
101+
"96": "Collect Item",
102+
"97": "Entity Teleport",
103+
"98": "Advancements",
104+
"99": "Entity Properties",
105+
"100": "Entity Effect",
106+
"101": "Declare Recipes",
107+
"102": "Tags"
108+
},
109+
"Serverbound": {
110+
"Teleport Confirm": 0,
111+
"Query Block NBT": 1,
112+
"Set Difficulty": 2,
113+
"Chat Message (serverbound)": 3,
114+
"Client Status": 4,
115+
"Client Settings": 5,
116+
"Tab-Complete (serverbound)": 6,
117+
"Click Window Button": 7,
118+
"Click Window": 8,
119+
"Close Window (serverbound)": 9,
120+
"Plugin Message (serverbound)": 10,
121+
"Edit Book": 11,
122+
"Query Entity NBT": 12,
123+
"Interact Entity": 13,
124+
"Generate Structure": 14,
125+
"Keep Alive (serverbound)": 15,
126+
"Lock Difficulty": 16,
127+
"Player Position": 17,
128+
"Player Position And Rotation (serverbound)": 18,
129+
"Player Rotation": 19,
130+
"Player Movement": 20,
131+
"Vehicle Move (serverbound)": 21,
132+
"Steer Boat": 22,
133+
"Pick Item": 23,
134+
"Craft Recipe Request": 24,
135+
"Player Abilities (serverbound)": 25,
136+
"Player Digging": 26,
137+
"Entity Action": 27,
138+
"Steer Vehicle": 28,
139+
"Pong": 29,
140+
"Set Recipe Book State": 30,
141+
"Set Displayed Recipe": 31,
142+
"Name Item": 32,
143+
"Resource Pack Status": 33,
144+
"Advancement Tab": 34,
145+
"Select Trade": 35,
146+
"Set Beacon Effect": 36,
147+
"Held Item Change (serverbound)": 37,
148+
"Update Command Block": 38,
149+
"Update Command Block Minecart": 39,
150+
"Creative Inventory Action": 40,
151+
"Update Jigsaw Block": 41,
152+
"Update Structure Block": 42,
153+
"Update Sign": 43,
154+
"Animation (serverbound)": 44,
155+
"Spectate": 45,
156+
"Player Block Placement": 46,
157+
"Use Item": 47
158+
}
159+
},
160+
2161
"754": {
3162
"Clientbound": {
4163
"0": "Spawn Entity",

readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ PCRC currently supports connecting to vanilla Minecraft server. Supports version
3636
- 1.16.1
3737
- 1.16.2
3838
- 1.16.3
39-
39+
- 1.16.4
40+
- 1.17.1
4041
## Advantage
4142

4243
- Can be hosted server side for 24/7 recording

utils/constant.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
MinimumLegalFileSize = 10 * BytePerKB
1414
RecordingFilePath = 'temp_recording/'
1515
RecordingStorageFolder = 'PCRC_recordings/'
16-
ALLOWED_VERSIONS = ['1.12', '1.12.2', '1.14.4', '1.15.2', '1.16.1', '1.16.2', '1.16.3', '1.16.4']
16+
ALLOWED_VERSIONS = ['1.12', '1.12.2', '1.14.4', '1.15.2', '1.16.1', '1.16.2', '1.16.3', '1.16.4', '1.17.1']
1717
Map_VersionToProtocol = pycraft.SUPPORTED_MINECRAFT_VERSIONS
1818
Map_ProtocolToVersion = {}
1919
for item in Map_VersionToProtocol.items():
@@ -28,6 +28,7 @@
2828
'1.16.2': 35,
2929
'1.16.3': 35,
3030
'1.16.4': 35,
31+
'1.17.1': 41,
3132
}
3233
EntityTypeBat = {
3334
'1.12': 65,
@@ -38,6 +39,7 @@
3839
'1.16.2': 3,
3940
'1.16.3': 3,
4041
'1.16.4': 3,
42+
'1.17.1': 4,
4143
}
4244
EntityTypePhantom = {
4345
'1.12': -1,
@@ -48,6 +50,7 @@
4850
'1.16.2': 58,
4951
'1.16.3': 58,
5052
'1.16.4': 58,
53+
'1.17.1': 63,
5154
}
5255

5356
FILE_FORMAT_VERSION_DICT = {
@@ -59,9 +62,11 @@
5962
'1.16.2': '14',
6063
'1.16.3': '14',
6164
'1.16.4': '14',
65+
'1.17.1': '14',
6266
}
6367

6468

69+
6570
IMPORTANT_PACKETS = [
6671
'Player Info'
6772
]
@@ -86,7 +91,9 @@
8691
'Camera',
8792
'Player Abilities (clientbound)',
8893
'Title',
94+
'Sculk Vibration Signal',
8995
'unknown'
96+
9097
]
9198

9299
# List of packets that are not neccesary for a normal replay but still get recorded

utils/pycraft/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@
271271
'1.16.4-pre2': 1073741826,
272272
'1.16.4-rc1': 1073741827,
273273
'1.16.4': 754,
274+
'1.17.1': 756,
274275
}
275276

276277
# Those Minecraft versions supported by pyCraft which are "release" versions,

utils/pycraft/networking/packets/clientbound/play/__init__.py

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def get_packets(context):
4444
RespawnPacket,
4545
PluginMessagePacket,
4646
PlayerListHeaderAndFooterPacket,
47-
EntityLookPacket
47+
EntityLookPacket,
48+
ResourcePackSendPacket
4849
}
4950
if context.protocol_version <= 47:
5051
packets |= {
@@ -64,7 +65,8 @@ def get_packets(context):
6465
class KeepAlivePacket(AbstractKeepAlivePacket):
6566
@staticmethod
6667
def get_id(context):
67-
return 0x1F if context.protocol_version >= 741 else \
68+
return 0x21 if context.protocol_version >= 756 else \
69+
0x1F if context.protocol_version >= 741 else \
6870
0x20 if context.protocol_version >= 721 else \
6971
0x21 if context.protocol_version >= 550 else \
7072
0x20 if context.protocol_version >= 471 else \
@@ -79,7 +81,8 @@ def get_id(context):
7981
class ServerDifficultyPacket(Packet):
8082
@staticmethod
8183
def get_id(context):
82-
return 0x0D if context.protocol_version >= 721 else \
84+
return 0x0E if context.protocol_version >= 756 else \
85+
0x0D if context.protocol_version >= 721 else \
8386
0x0E if context.protocol_version >= 550 else \
8487
0x0D if context.protocol_version >= 332 else \
8588
0x0E if context.protocol_version >= 318 else \
@@ -99,7 +102,8 @@ def get_id(context):
99102
class ChatMessagePacket(Packet):
100103
@staticmethod
101104
def get_id(context):
102-
return 0x0E if context.protocol_version >= 721 else \
105+
return 0x0F if context.protocol_version >= 756 else \
106+
0x0E if context.protocol_version >= 721 else \
103107
0x0F if context.protocol_version >= 550 else \
104108
0x0E if context.protocol_version >= 343 else \
105109
0x0F if context.protocol_version >= 332 else \
@@ -123,7 +127,8 @@ class Position(Enum):
123127
class DisconnectPacket(Packet):
124128
@staticmethod
125129
def get_id(context):
126-
return 0x19 if context.protocol_version >= 741 else \
130+
return 0x1A if context.protocol_version >= 756 else \
131+
0x19 if context.protocol_version >= 741 else \
127132
0x1A if context.protocol_version >= 721 else \
128133
0x1B if context.protocol_version >= 550 else \
129134
0x1A if context.protocol_version >= 471 else \
@@ -141,10 +146,10 @@ def get_id(context):
141146

142147
class SetCompressionPacket(Packet):
143148
# Note: removed between protocol versions 47 and 107.
144-
id = 0x46
145-
packet_name = "set compression"
146-
definition = [
147-
{'threshold': VarInt}]
149+
@staticmethod
150+
def get_id(context):
151+
return 0x03 if context.protocol_version(756) else \
152+
0x46
148153

149154

150155
class SpawnPlayerPacket(Packet):
@@ -186,7 +191,8 @@ def get_id(context):
186191
class EntityVelocityPacket(Packet):
187192
@staticmethod
188193
def get_id(context):
189-
return 0x46 if context.protocol_version >= 721 else \
194+
return 0x4F if context.protocol_version >= 756 else \
195+
0x46 if context.protocol_version >= 721 else \
190196
0x47 if context.protocol_version >= 707 else \
191197
0x46 if context.protocol_version >= 550 else \
192198
0x45 if context.protocol_version >= 471 else \
@@ -214,7 +220,8 @@ def get_id(context):
214220
class EntityPositionDeltaPacket(Packet):
215221
@staticmethod
216222
def get_id(context):
217-
return 0x27 if context.protocol_version >= 741 else \
223+
return 0x29 if context.protocol_version >= 756 else \
224+
0x27 if context.protocol_version >= 741 else \
218225
0x28 if context.protocol_version >= 721 else \
219226
0x29 if context.protocol_version >= 550 else \
220227
0x28 if context.protocol_version >= 389 else \
@@ -253,7 +260,8 @@ def get_definition(context):
253260
class TimeUpdatePacket(Packet):
254261
@staticmethod
255262
def get_id(context):
256-
return 0x4E if context.protocol_version >= 721 else \
263+
return 0x58 if context.protocol_version >= 756 else \
264+
0x4E if context.protocol_version >= 721 else \
257265
0x4F if context.protocol_version >= 550 else \
258266
0x4E if context.protocol_version >= 471 else \
259267
0x4A if context.protocol_version >= 461 else \
@@ -277,7 +285,8 @@ def get_id(context):
277285
class UpdateHealthPacket(Packet):
278286
@staticmethod
279287
def get_id(context):
280-
return 0x49 if context.protocol_version >= 721 else \
288+
return 0x52 if context.protocol_version >= 756 else \
289+
0x49 if context.protocol_version >= 721 else \
281290
0x4A if context.protocol_version >= 707 else \
282291
0x49 if context.protocol_version >= 550 else \
283292
0x48 if context.protocol_version >= 471 else \
@@ -304,7 +313,8 @@ def get_id(context):
304313
class PluginMessagePacket(AbstractPluginMessagePacket):
305314
@staticmethod
306315
def get_id(context):
307-
return 0x17 if context.protocol_version >= 741 else \
316+
return 0x18 if context.protocol_version >= 756 else \
317+
0x17 if context.protocol_version >= 741 else \
308318
0x18 if context.protocol_version >= 721 else \
309319
0x19 if context.protocol_version >= 550 else \
310320
0x18 if context.protocol_version >= 471 else \
@@ -318,7 +328,8 @@ def get_id(context):
318328
class PlayerListHeaderAndFooterPacket(Packet):
319329
@staticmethod
320330
def get_id(context):
321-
return 0x53 if context.protocol_version >= 721 else \
331+
return 0x5E if context.protocol_version >= 756 else \
332+
0x53 if context.protocol_version >= 721 else \
322333
0x54 if context.protocol_version >= 550 else \
323334
0x53 if context.protocol_version >= 471 else \
324335
0x5F if context.protocol_version >= 461 else \
@@ -340,7 +351,8 @@ def get_id(context):
340351
class EntityLookPacket(Packet):
341352
@staticmethod
342353
def get_id(context):
343-
return 0x29 if context.protocol_version >= 741 else \
354+
return 0x2B if context.protocol_version >= 756 else \
355+
0x29 if context.protocol_version >= 741 else \
344356
0x2A if context.protocol_version >= 721 else \
345357
0x2B if context.protocol_version >= 550 else \
346358
0x2A if context.protocol_version >= 389 else \
@@ -357,3 +369,15 @@ def get_id(context):
357369
{'pitch': Angle},
358370
{'on_ground': Boolean}
359371
]
372+
373+
class ResourcePackSendPacket(Packet):
374+
@staticmethod
375+
def get_id(context):
376+
return 0x3C if context.protocol_version >= 756 else \
377+
0x38
378+
379+
packet_name = "resource pack send"
380+
definition = [
381+
{"url": String},
382+
{"hash": String}
383+
]

0 commit comments

Comments
 (0)