Skip to content

Commit 8fbf47f

Browse files
backport entity metadata
1 parent 6155f96 commit 8fbf47f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+6691
-7470
lines changed

data/pc/1.10-pre1/proto.yml

Lines changed: 34 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -59,65 +59,40 @@
5959
}
6060
]
6161
]
62-
entityMetadataItem: $compareTo ?
63-
if 0: i8
64-
if 1: varint
65-
if 2: f32
66-
if 3: string
67-
if 4: string
68-
if 5: slot
69-
if 6: bool
70-
if 7:
71-
pitch: f32
72-
yaw: f32
73-
roll: f32
74-
if 8: position
75-
if 9: [
76-
"option",
77-
"position"
78-
]
79-
if 10: varint
80-
if 11: [
81-
"option",
82-
"UUID"
83-
]
84-
if 12: varint
85-
entityMetadata: [
86-
"entityMetadataLoop",
87-
{
88-
"endVal": 255,
89-
"type": [
90-
"container",
91-
[
92-
{
93-
"anon": true,
94-
"type": [
95-
"container",
96-
[
97-
{
98-
"name": "key",
99-
"type": "u8"
100-
},
101-
{
102-
"name": "type",
103-
"type": "i8"
104-
}
105-
]
106-
]
107-
},
108-
{
109-
"name": "value",
110-
"type": [
111-
"entityMetadataItem",
112-
{
113-
"compareTo": "type"
114-
}
115-
]
116-
}
117-
]
118-
]
119-
}
120-
]
62+
entityMetadataEntry:
63+
key: u8
64+
type: varint =>
65+
- byte
66+
- int
67+
- float
68+
- string
69+
- component
70+
- item_stack
71+
- boolean
72+
- rotations
73+
- block_pos
74+
- optional_block_pos
75+
- direction
76+
- optional_uuid
77+
- block_state
78+
value: type ?
79+
if byte: i8
80+
if int: varint
81+
if float: f32
82+
if string: string
83+
if component: string
84+
if item_stack: slot
85+
if boolean: bool
86+
if rotations:
87+
pitch: f32
88+
yaw: f32
89+
roll: f32
90+
if block_pos: position
91+
if optional_block_pos: ["option", "position"]
92+
if direction: varint
93+
if optional_uuid: ["option", "UUID"]
94+
if block_state: varint
95+
entityMetadata: ["entityMetadataLoop", { "endVal": 255, "type": "entityMetadataEntry" }]
12196

12297
^handshaking.toClient.types:
12398
packet:

data/pc/1.10-pre1/protocol.json

Lines changed: 77 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -88,83 +88,90 @@
8888
}
8989
]
9090
],
91-
"entityMetadataItem": [
92-
"switch",
93-
{
94-
"compareTo": "$compareTo",
95-
"fields": {
96-
"0": "i8",
97-
"1": "varint",
98-
"2": "f32",
99-
"3": "string",
100-
"4": "string",
101-
"5": "slot",
102-
"6": "bool",
103-
"7": [
104-
"container",
105-
[
106-
{
107-
"name": "pitch",
108-
"type": "f32"
109-
},
110-
{
111-
"name": "yaw",
112-
"type": "f32"
113-
},
114-
{
115-
"name": "roll",
116-
"type": "f32"
91+
"entityMetadataEntry": [
92+
"container",
93+
[
94+
{
95+
"name": "key",
96+
"type": "u8"
97+
},
98+
{
99+
"name": "type",
100+
"type": [
101+
"mapper",
102+
{
103+
"type": "varint",
104+
"mappings": {
105+
"0": "byte",
106+
"1": "int",
107+
"2": "float",
108+
"3": "string",
109+
"4": "component",
110+
"5": "item_stack",
111+
"6": "boolean",
112+
"7": "rotations",
113+
"8": "block_pos",
114+
"9": "optional_block_pos",
115+
"10": "direction",
116+
"11": "optional_uuid",
117+
"12": "block_state"
117118
}
118-
]
119-
],
120-
"8": "position",
121-
"9": [
122-
"option",
123-
"position"
124-
],
125-
"10": "varint",
126-
"11": [
127-
"option",
128-
"UUID"
129-
],
130-
"12": "varint"
119+
}
120+
]
121+
},
122+
{
123+
"name": "value",
124+
"type": [
125+
"switch",
126+
{
127+
"compareTo": "type",
128+
"fields": {
129+
"byte": "i8",
130+
"int": "varint",
131+
"float": "f32",
132+
"string": "string",
133+
"component": "string",
134+
"item_stack": "slot",
135+
"boolean": "bool",
136+
"rotations": [
137+
"container",
138+
[
139+
{
140+
"name": "pitch",
141+
"type": "f32"
142+
},
143+
{
144+
"name": "yaw",
145+
"type": "f32"
146+
},
147+
{
148+
"name": "roll",
149+
"type": "f32"
150+
}
151+
]
152+
],
153+
"block_pos": "position",
154+
"optional_block_pos": [
155+
"option",
156+
"position"
157+
],
158+
"direction": "varint",
159+
"optional_uuid": [
160+
"option",
161+
"UUID"
162+
],
163+
"block_state": "varint"
164+
}
165+
}
166+
]
131167
}
132-
}
168+
]
133169
],
134170
"entityMetadata": [
135171
"entityMetadataLoop",
136172
{
137173
"endVal": 255,
138-
"type": [
139-
"container",
140-
[
141-
{
142-
"anon": true,
143-
"type": [
144-
"container",
145-
[
146-
{
147-
"name": "key",
148-
"type": "u8"
149-
},
150-
{
151-
"name": "type",
152-
"type": "i8"
153-
}
154-
]
155-
]
156-
},
157-
{
158-
"name": "value",
159-
"type": [
160-
"entityMetadataItem",
161-
{
162-
"compareTo": "type"
163-
}
164-
]
165-
}
166-
]
167-
]
174+
"type": "entityMetadataEntry"
168175
}
169176
]
170177
},

data/pc/1.10/proto.yml

Lines changed: 34 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -59,65 +59,40 @@
5959
}
6060
]
6161
]
62-
entityMetadataItem: $compareTo ?
63-
if 0: i8
64-
if 1: varint
65-
if 2: f32
66-
if 3: string
67-
if 4: string
68-
if 5: slot
69-
if 6: bool
70-
if 7:
71-
pitch: f32
72-
yaw: f32
73-
roll: f32
74-
if 8: position
75-
if 9: [
76-
"option",
77-
"position"
78-
]
79-
if 10: varint
80-
if 11: [
81-
"option",
82-
"UUID"
83-
]
84-
if 12: varint
85-
entityMetadata: [
86-
"entityMetadataLoop",
87-
{
88-
"endVal": 255,
89-
"type": [
90-
"container",
91-
[
92-
{
93-
"anon": true,
94-
"type": [
95-
"container",
96-
[
97-
{
98-
"name": "key",
99-
"type": "u8"
100-
},
101-
{
102-
"name": "type",
103-
"type": "i8"
104-
}
105-
]
106-
]
107-
},
108-
{
109-
"name": "value",
110-
"type": [
111-
"entityMetadataItem",
112-
{
113-
"compareTo": "type"
114-
}
115-
]
116-
}
117-
]
118-
]
119-
}
120-
]
62+
entityMetadataEntry:
63+
key: u8
64+
type: varint =>
65+
- byte
66+
- int
67+
- float
68+
- string
69+
- component
70+
- item_stack
71+
- boolean
72+
- rotations
73+
- block_pos
74+
- optional_block_pos
75+
- direction
76+
- optional_uuid
77+
- block_state
78+
value: type ?
79+
if byte: i8
80+
if int: varint
81+
if float: f32
82+
if string: string
83+
if component: string
84+
if item_stack: slot
85+
if boolean: bool
86+
if rotations:
87+
pitch: f32
88+
yaw: f32
89+
roll: f32
90+
if block_pos: position
91+
if optional_block_pos: ["option", "position"]
92+
if direction: varint
93+
if optional_uuid: ["option", "UUID"]
94+
if block_state: varint
95+
entityMetadata: ["entityMetadataLoop", { "endVal": 255, "type": "entityMetadataEntry" }]
12196

12297
^handshaking.toClient.types:
12398
packet:

0 commit comments

Comments
 (0)