Skip to content

Commit 20dd5c1

Browse files
committed
Updates according to pmmp/PocketMine-MP@82c4166
New features: - flattenedProperties permits flattening without using remappedStates (more compact) - flatten rules can now work with TAG_Byte and TAG_Int properties - schema generator can now create flatten rules when multiple flatten values map to the same ID (as in the case of default for stonebrick) This change requires changes to BlockStateUpgrader. See the linked commit for more details.
1 parent 9d82aae commit 20dd5c1

14 files changed

+509
-1153
lines changed

nbt_upgrade_schema/0171_1.19.60_to_1.19.70.26_beta.json

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@
33
"maxVersionMinor": 19,
44
"maxVersionPatch": 70,
55
"maxVersionRevision": 15,
6-
"remappedStates": {
7-
"minecraft:wool": [
8-
{
9-
"oldState": null,
10-
"newFlattenedName": {
11-
"prefix": "minecraft:",
12-
"flattenedProperty": "color",
13-
"suffix": "_wool",
14-
"flattenedValueRemaps": {
15-
"silver": "light_gray"
16-
}
17-
},
18-
"newState": null
6+
"flattenedProperties": {
7+
"minecraft:wool": {
8+
"prefix": "minecraft:",
9+
"flattenedProperty": "color",
10+
"suffix": "_wool",
11+
"flattenedValueRemaps": {
12+
"silver": "light_gray"
1913
}
20-
]
14+
}
2115
}
2216
}

nbt_upgrade_schema/0181_1.19.70_to_1.19.80.24_beta.json

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,21 @@
33
"maxVersionMinor": 19,
44
"maxVersionPatch": 80,
55
"maxVersionRevision": 11,
6-
"remappedStates": {
7-
"minecraft:fence": [
8-
{
9-
"oldState": null,
10-
"newFlattenedName": {
11-
"prefix": "minecraft:",
12-
"flattenedProperty": "wood_type",
13-
"suffix": "_fence"
14-
},
15-
"newState": null
16-
}
17-
],
18-
"minecraft:log": [
19-
{
20-
"oldState": null,
21-
"newFlattenedName": {
22-
"prefix": "minecraft:",
23-
"flattenedProperty": "old_log_type",
24-
"suffix": "_log"
25-
},
26-
"newState": null,
27-
"copiedState": [
28-
"pillar_axis"
29-
]
30-
}
31-
],
32-
"minecraft:log2": [
33-
{
34-
"oldState": null,
35-
"newFlattenedName": {
36-
"prefix": "minecraft:",
37-
"flattenedProperty": "new_log_type",
38-
"suffix": "_log"
39-
},
40-
"newState": null,
41-
"copiedState": [
42-
"pillar_axis"
43-
]
44-
}
45-
]
6+
"flattenedProperties": {
7+
"minecraft:fence": {
8+
"prefix": "minecraft:",
9+
"flattenedProperty": "wood_type",
10+
"suffix": "_fence"
11+
},
12+
"minecraft:log": {
13+
"prefix": "minecraft:",
14+
"flattenedProperty": "old_log_type",
15+
"suffix": "_log"
16+
},
17+
"minecraft:log2": {
18+
"prefix": "minecraft:",
19+
"flattenedProperty": "new_log_type",
20+
"suffix": "_log"
21+
}
4622
}
4723
}

nbt_upgrade_schema/0191_1.19.80.24_beta_to_1.20.0.23_beta.json

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,17 @@
100100
}
101101
]
102102
},
103-
"remappedStates": {
104-
"minecraft:carpet": [
105-
{
106-
"oldState": null,
107-
"newFlattenedName": {
108-
"prefix": "minecraft:",
109-
"flattenedProperty": "color",
110-
"suffix": "_carpet",
111-
"flattenedValueRemaps": {
112-
"silver": "light_gray"
113-
}
114-
},
115-
"newState": null
103+
"flattenedProperties": {
104+
"minecraft:carpet": {
105+
"prefix": "minecraft:",
106+
"flattenedProperty": "color",
107+
"suffix": "_carpet",
108+
"flattenedValueRemaps": {
109+
"silver": "light_gray"
116110
}
117-
],
111+
}
112+
},
113+
"remappedStates": {
118114
"minecraft:coral": [
119115
{
120116
"oldState": {

nbt_upgrade_schema/0201_1.20.0.23_beta_to_1.20.10.24_beta.json

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -65,34 +65,22 @@
6565
}
6666
]
6767
},
68-
"remappedStates": {
69-
"minecraft:concrete": [
70-
{
71-
"oldState": null,
72-
"newFlattenedName": {
73-
"prefix": "minecraft:",
74-
"flattenedProperty": "color",
75-
"suffix": "_concrete",
76-
"flattenedValueRemaps": {
77-
"silver": "light_gray"
78-
}
79-
},
80-
"newState": null
68+
"flattenedProperties": {
69+
"minecraft:concrete": {
70+
"prefix": "minecraft:",
71+
"flattenedProperty": "color",
72+
"suffix": "_concrete",
73+
"flattenedValueRemaps": {
74+
"silver": "light_gray"
8175
}
82-
],
83-
"minecraft:shulker_box": [
84-
{
85-
"oldState": null,
86-
"newFlattenedName": {
87-
"prefix": "minecraft:",
88-
"flattenedProperty": "color",
89-
"suffix": "_shulker_box",
90-
"flattenedValueRemaps": {
91-
"silver": "light_gray"
92-
}
93-
},
94-
"newState": null
76+
},
77+
"minecraft:shulker_box": {
78+
"prefix": "minecraft:",
79+
"flattenedProperty": "color",
80+
"suffix": "_shulker_box",
81+
"flattenedValueRemaps": {
82+
"silver": "light_gray"
9583
}
96-
]
84+
}
9785
}
9886
}

nbt_upgrade_schema/0211_1.20.10.24_beta_to_1.20.20.23_beta.json

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -425,34 +425,22 @@
425425
}
426426
]
427427
},
428-
"remappedStates": {
429-
"minecraft:stained_glass": [
430-
{
431-
"oldState": null,
432-
"newFlattenedName": {
433-
"prefix": "minecraft:",
434-
"flattenedProperty": "color",
435-
"suffix": "_stained_glass",
436-
"flattenedValueRemaps": {
437-
"silver": "light_gray"
438-
}
439-
},
440-
"newState": null
428+
"flattenedProperties": {
429+
"minecraft:stained_glass": {
430+
"prefix": "minecraft:",
431+
"flattenedProperty": "color",
432+
"suffix": "_stained_glass",
433+
"flattenedValueRemaps": {
434+
"silver": "light_gray"
441435
}
442-
],
443-
"minecraft:stained_glass_pane": [
444-
{
445-
"oldState": null,
446-
"newFlattenedName": {
447-
"prefix": "minecraft:",
448-
"flattenedProperty": "color",
449-
"suffix": "_stained_glass_pane",
450-
"flattenedValueRemaps": {
451-
"silver": "light_gray"
452-
}
453-
},
454-
"newState": null
436+
},
437+
"minecraft:stained_glass_pane": {
438+
"prefix": "minecraft:",
439+
"flattenedProperty": "color",
440+
"suffix": "_stained_glass_pane",
441+
"flattenedValueRemaps": {
442+
"silver": "light_gray"
455443
}
456-
]
444+
}
457445
}
458446
}

nbt_upgrade_schema/0221_1.20.20.23_beta_to_1.20.30.22_beta.json

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -207,34 +207,22 @@
207207
}
208208
]
209209
},
210-
"remappedStates": {
211-
"minecraft:concrete_powder": [
212-
{
213-
"oldState": null,
214-
"newFlattenedName": {
215-
"prefix": "minecraft:",
216-
"flattenedProperty": "color",
217-
"suffix": "_concrete_powder",
218-
"flattenedValueRemaps": {
219-
"silver": "light_gray"
220-
}
221-
},
222-
"newState": null
210+
"flattenedProperties": {
211+
"minecraft:concrete_powder": {
212+
"prefix": "minecraft:",
213+
"flattenedProperty": "color",
214+
"suffix": "_concrete_powder",
215+
"flattenedValueRemaps": {
216+
"silver": "light_gray"
223217
}
224-
],
225-
"minecraft:stained_hardened_clay": [
226-
{
227-
"oldState": null,
228-
"newFlattenedName": {
229-
"prefix": "minecraft:",
230-
"flattenedProperty": "color",
231-
"suffix": "_terracotta",
232-
"flattenedValueRemaps": {
233-
"silver": "light_gray"
234-
}
235-
},
236-
"newState": null
218+
},
219+
"minecraft:stained_hardened_clay": {
220+
"prefix": "minecraft:",
221+
"flattenedProperty": "color",
222+
"suffix": "_terracotta",
223+
"flattenedValueRemaps": {
224+
"silver": "light_gray"
237225
}
238-
]
226+
}
239227
}
240228
}

nbt_upgrade_schema/0241_1.20.40.24_beta_to_1.20.50.23_beta.json

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,21 @@
33
"maxVersionMinor": 20,
44
"maxVersionPatch": 50,
55
"maxVersionRevision": 1,
6-
"remappedStates": {
7-
"minecraft:planks": [
8-
{
9-
"oldState": null,
10-
"newFlattenedName": {
11-
"prefix": "minecraft:",
12-
"flattenedProperty": "wood_type",
13-
"suffix": "_planks"
14-
},
15-
"newState": null
6+
"flattenedProperties": {
7+
"minecraft:planks": {
8+
"prefix": "minecraft:",
9+
"flattenedProperty": "wood_type",
10+
"suffix": "_planks"
11+
},
12+
"minecraft:stone": {
13+
"prefix": "minecraft:",
14+
"flattenedProperty": "stone_type",
15+
"suffix": "",
16+
"flattenedValueRemaps": {
17+
"andesite_smooth": "polished_andesite",
18+
"diorite_smooth": "polished_diorite",
19+
"granite_smooth": "polished_granite"
1620
}
17-
],
18-
"minecraft:stone": [
19-
{
20-
"oldState": null,
21-
"newFlattenedName": {
22-
"prefix": "minecraft:",
23-
"flattenedProperty": "stone_type",
24-
"suffix": "",
25-
"flattenedValueRemaps": {
26-
"andesite_smooth": "polished_andesite",
27-
"diorite_smooth": "polished_diorite",
28-
"granite_smooth": "polished_granite"
29-
}
30-
},
31-
"newState": null
32-
}
33-
]
21+
}
3422
}
3523
}

nbt_upgrade_schema/0251_1.20.50.23_beta_to_1.20.60.26_beta.json

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,22 @@
33
"maxVersionMinor": 20,
44
"maxVersionPatch": 60,
55
"maxVersionRevision": 1,
6-
"remappedStates": {
7-
"minecraft:hard_stained_glass": [
8-
{
9-
"oldState": null,
10-
"newFlattenedName": {
11-
"prefix": "minecraft:hard_",
12-
"flattenedProperty": "color",
13-
"suffix": "_stained_glass",
14-
"flattenedValueRemaps": {
15-
"silver": "light_gray"
16-
}
17-
},
18-
"newState": null
6+
"flattenedProperties": {
7+
"minecraft:hard_stained_glass": {
8+
"prefix": "minecraft:hard_",
9+
"flattenedProperty": "color",
10+
"suffix": "_stained_glass",
11+
"flattenedValueRemaps": {
12+
"silver": "light_gray"
1913
}
20-
],
21-
"minecraft:hard_stained_glass_pane": [
22-
{
23-
"oldState": null,
24-
"newFlattenedName": {
25-
"prefix": "minecraft:hard_",
26-
"flattenedProperty": "color",
27-
"suffix": "_stained_glass_pane",
28-
"flattenedValueRemaps": {
29-
"silver": "light_gray"
30-
}
31-
},
32-
"newState": null
14+
},
15+
"minecraft:hard_stained_glass_pane": {
16+
"prefix": "minecraft:hard_",
17+
"flattenedProperty": "color",
18+
"suffix": "_stained_glass_pane",
19+
"flattenedValueRemaps": {
20+
"silver": "light_gray"
3321
}
34-
]
22+
}
3523
}
3624
}

0 commit comments

Comments
 (0)