Skip to content

Commit f678283

Browse files
authored
fix: Add a couple of additional validators (#88)
* fix: Add a couple of additional validators - Add exceptions to vanilla texture override handling - CHKMANIF134 rule regarding MEV must be 1.21.120 for VV (capabilities=pbr) content. - TEXTUREIMAGE462 rule: Ensure mashups have 60% content - Add general robustness when handling user content to ensure arrays are arrays before they are used like arrays - Centralize version checking more to deal with string versions in manifest V3 * fix: Add tests and sample content
1 parent e8d3101 commit f678283

File tree

662 files changed

+58541
-616
lines changed

Some content is hidden

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

662 files changed

+58541
-616
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ jobs:
4343
npm ci
4444
npx gulp package
4545
popd
46+
pushd world
47+
npm ci
48+
npx gulp package
49+
popd
4650
popd
4751
pushd app
4852
npm test

.github/workflows/copilot-setup-steps.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@ jobs:
5656
npm ci
5757
npx gulp package
5858
popd
59+
pushd world
60+
npm ci
61+
npx gulp package
62+
popd
5963
popd

.github/workflows/create-release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ jobs:
5252
npm ci
5353
npx gulp package
5454
popd
55+
pushd world
56+
npm ci
57+
npx gulp package
58+
popd
5559
popd
5660
pushd app
5761
npm test

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
},
6262
"scripts": {
6363
"preparedevenv": "gulp preparedevenv --max_old_space_size=16384",
64-
"preparetest": "cd ../samplecontent/addon && npm ci && npx gulp package && cd ../../app",
64+
"preparetest": "cd ../samplecontent/addon && npm ci && npx gulp package && cd ../world && npm ci && npx gulp package && cd ../../app",
6565
"web": "react-scripts --max_old_space_size=16384 start",
6666
"start": "react-scripts --max_old_space_size=16384 start",
6767
"webbuild": "cross-env CI=true react-scripts --max_old_space_size=16384 build",

app/public/data/forms/block/components.form.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@
77
"description": "Specifies the language file key that maps to what text will be displayed when you hover over the block in your inventory and hotbar. If the string given can not be resolved as a loc string, the raw string given will be displayed. If this component is omitted, the name of the block will be used as the display name.",
88
"dataType": 16
99
},
10+
{
11+
"id": "minecraft:light_dampening",
12+
"title": "Minecraft Light Dampening",
13+
"description": "The amount that light will be dampened when it passes through the block, in a range (0-15). Higher value means the light will be dampened more.",
14+
"dataType": 16
15+
},
16+
{
17+
"id": "minecraft:light_emission",
18+
"title": "Minecraft Light Emission",
19+
"description": "The amount of light this block will emit in a range (0-15). Higher value means more light will be emitted.",
20+
"dataType": 16
21+
},
1022
{
1123
"id": "minecraft:tags",
1224
"title": "Minecraft Tags",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"files":["block_resource_nonvisual.form.json","block_resource_visual.form.json","block_specifier.form.json","blockdefinitiondocument.form.json","blockdescriptorproxy.form.json","blockdescriptorserializer_blockdescriptorproxy.form.json","blockstate_boolean.form.json","blockstate_number.form.json","blockstate_string.form.json","components.form.json","culling_layer.form.json","description.form.json","materialinstanceface.form.json","menu_category.form.json","minecraft_bone_visibility.form.json","minecraft_breathability.form.json","minecraft_collision_box.form.json","minecraft_crafting_table.form.json","minecraft_custom_components.form.json","minecraft_destructible_by_explosion.form.json","minecraft_destructible_by_mining.form.json","minecraft_destruction_particles.form.json","minecraft_display_name.form.json","minecraft_entity_fall_on.form.json","minecraft_flammable.form.json","minecraft_friction.form.json","minecraft_geometry.form.json","minecraft_item_visual.form.json","minecraft_light_dampening.form.json","minecraft_light_emission.form.json","minecraft_liquid_detection.form.json","minecraft_loot.form.json","minecraft_map_color.form.json","minecraft_material_instances.form.json","minecraft_movable.form.json","minecraft_placement_filter.form.json","minecraft_precipitation_interactions.form.json","minecraft_queued_ticking.form.json","minecraft_random_offset.form.json","minecraft_random_ticking.form.json","minecraft_redstone_conductivity.form.json","minecraft_replaceable.form.json","minecraft_selection_box.form.json","minecraft_tick.form.json","minecraft_transformation.form.json","minecraft_unit_cube.form.json","offset_range.form.json","placement_direction.form.json","placement_position.form.json","range.form.json","trait_placement_direction.form.json","trait_placement_position.form.json","traits.form.json","values.form.json"],"folders":[]}
1+
{"files":["block_resource_nonvisual.form.json","block_resource_visual.form.json","block_specifier.form.json","blockdefinitiondocument.form.json","blockdescriptorproxy.form.json","blockdescriptorserializer_blockdescriptorproxy.form.json","blockstate_boolean.form.json","blockstate_number.form.json","blockstate_string.form.json","components.form.json","culling_layer.form.json","description.form.json","materialinstanceface.form.json","menu_category.form.json","minecraft_bone_visibility.form.json","minecraft_breathability.form.json","minecraft_collision_box.form.json","minecraft_crafting_table.form.json","minecraft_custom_components.form.json","minecraft_destructible_by_explosion.form.json","minecraft_destructible_by_mining.form.json","minecraft_destruction_particles.form.json","minecraft_display_name.form.json","minecraft_entity_fall_on.form.json","minecraft_flammable.form.json","minecraft_friction.form.json","minecraft_geometry.form.json","minecraft_item_visual.form.json","minecraft_light_dampening.form.json","minecraft_light_emission.form.json","minecraft_liquid_detection.form.json","minecraft_loot.form.json","minecraft_map_color.form.json","minecraft_material_instances.form.json","minecraft_movable.form.json","minecraft_placement_filter.form.json","minecraft_precipitation_interactions.form.json","minecraft_queued_ticking.form.json","minecraft_random_offset.form.json","minecraft_random_ticking.form.json","minecraft_redstone_conductivity.form.json","minecraft_replaceable.form.json","minecraft_selection_box.form.json","minecraft_tick.form.json","minecraft_transformation.form.json","minecraft_unit_cube.form.json","offset_range.form.json","permutation.form.json","placement_direction.form.json","placement_position.form.json","range.form.json","trait_placement_direction.form.json","trait_placement_position.form.json","traits.form.json","values.form.json"],"folders":[]}

app/public/data/forms/block/minecraft_geometry.form.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@
2222
"content": "geometry.bubble_fish"
2323
}
2424
],
25-
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/die.json": [
26-
{
27-
"path": "/minecraft:block/components/minecraft:geometry/",
28-
"content": "minecraft:geometry.full_block"
29-
}
30-
],
3125
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/green_bubble_fish.json": [
3226
{
3327
"path": "/minecraft:block/components/minecraft:geometry/",
@@ -189,9 +183,7 @@
189183
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/die.json": [
190184
{
191185
"path": "/minecraft:block/components/minecraft:geometry/",
192-
"content": {
193-
"identifier": "minecraft:geometry.full_block"
194-
}
186+
"content": "minecraft:geometry.full_block"
195187
}
196188
],
197189
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/green_bubble_fish.json": [

app/public/data/forms/block/minecraft_item_visual.form.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
"path": "/minecraft:block/components/minecraft:item_visual/",
1212
"content": "geometry.mikeamm_gwve_fabricator_in_hand"
1313
}
14+
],
15+
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/die.json": [
16+
{
17+
"path": "/minecraft:block/components/minecraft:item_visual/",
18+
"content": "minecraft:geometry.full_block"
19+
}
1420
]
1521
}
1622
},
@@ -30,6 +36,17 @@
3036
}
3137
}
3238
}
39+
],
40+
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/die.json": [
41+
{
42+
"path": "/minecraft:block/components/minecraft:item_visual/",
43+
"content": {
44+
"*": {
45+
"texture": "die_red",
46+
"render_method": "opaque"
47+
}
48+
}
49+
}
3350
]
3451
}
3552
}
@@ -68,6 +85,20 @@
6885
}
6986
}
7087
}
88+
],
89+
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/die.json": [
90+
{
91+
"path": "/minecraft:block/components/minecraft:item_visual/",
92+
"content": {
93+
"geometry": "minecraft:geometry.full_block",
94+
"material_instances": {
95+
"*": {
96+
"texture": "die_red",
97+
"render_method": "opaque"
98+
}
99+
}
100+
}
101+
}
71102
]
72103
},
73104
"description": "The description identifier of the geometry and material used to render the item of this block.\nExperimental toggles required: Upcoming Creator Features (in format versions before 1.21.50)",

app/public/data/forms/block/minecraft_material_instances.form.json

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,14 @@
273273
"path": "/minecraft:block/components/minecraft:material_instances/",
274274
"content": "sushi_side"
275275
}
276+
],
277+
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/die.json": [
278+
{
279+
"path": "/minecraft:block/components/minecraft:material_instances/",
280+
"content": {
281+
"texture": "die_3"
282+
}
283+
}
276284
]
277285
}
278286
},
@@ -298,6 +306,14 @@
298306
"path": "/minecraft:block/components/minecraft:material_instances/",
299307
"content": "sushi_side"
300308
}
309+
],
310+
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/die.json": [
311+
{
312+
"path": "/minecraft:block/components/minecraft:material_instances/",
313+
"content": {
314+
"texture": "die_4"
315+
}
316+
}
301317
]
302318
}
303319
},
@@ -310,7 +326,17 @@
310326
{
311327
"dataType": 2
312328
}
313-
]
329+
],
330+
"samples": {
331+
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/die.json": [
332+
{
333+
"path": "/minecraft:block/components/minecraft:material_instances/",
334+
"content": {
335+
"texture": "die_2"
336+
}
337+
}
338+
]
339+
}
314340
},
315341
{
316342
"id": "west",
@@ -321,7 +347,17 @@
321347
{
322348
"dataType": 2
323349
}
324-
]
350+
],
351+
"samples": {
352+
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/die.json": [
353+
{
354+
"path": "/minecraft:block/components/minecraft:material_instances/",
355+
"content": {
356+
"texture": "die_5"
357+
}
358+
}
359+
]
360+
}
325361
},
326362
{
327363
"id": "up",
@@ -332,7 +368,17 @@
332368
{
333369
"dataType": 2
334370
}
335-
]
371+
],
372+
"samples": {
373+
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/die.json": [
374+
{
375+
"path": "/minecraft:block/components/minecraft:material_instances/",
376+
"content": {
377+
"texture": "die_1"
378+
}
379+
}
380+
]
381+
}
336382
},
337383
{
338384
"id": "down",
@@ -343,7 +389,17 @@
343389
{
344390
"dataType": 2
345391
}
346-
]
392+
],
393+
"samples": {
394+
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/die.json": [
395+
{
396+
"path": "/minecraft:block/components/minecraft:material_instances/",
397+
"content": {
398+
"texture": "die_6"
399+
}
400+
}
401+
]
402+
}
347403
}
348404
],
349405
"description": "The material instances for a block. Maps face or material_instance names in a geometry file to an actual material instance. You can assign a material instance object to any of these faces: \"up\", \"down\", \"north\", \"south\", \"east\", \"west\", or \"*\". You can also give an instance the name of your choosing such as \"my_instance\", and then assign it to a face by doing \"north\":\"my_instance\".",
@@ -505,6 +561,31 @@
505561
}
506562
}
507563
],
564+
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/die.json": [
565+
{
566+
"path": "/minecraft:block/components/minecraft:material_instances/",
567+
"content": {
568+
"north": {
569+
"texture": "die_3"
570+
},
571+
"south": {
572+
"texture": "die_4"
573+
},
574+
"east": {
575+
"texture": "die_2"
576+
},
577+
"west": {
578+
"texture": "die_5"
579+
},
580+
"up": {
581+
"texture": "die_1"
582+
},
583+
"down": {
584+
"texture": "die_6"
585+
}
586+
}
587+
}
588+
],
508589
"/samples/custom_blocks/behavior_packs/custom_blocks/blocks/green_bubble_fish.json": [
509590
{
510591
"path": "/minecraft:block/components/minecraft:material_instances/",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"id": "Permutation",
3+
"fields": [
4+
{
5+
"id": "components",
6+
"title": "Components",
7+
"dataType": 16,
8+
"subFormId": "block_components/components",
9+
"isRequired": true
10+
},
11+
{
12+
"id": "condition",
13+
"title": "Condition",
14+
"dataType": 2,
15+
"isRequired": true
16+
}
17+
],
18+
"title": "Block Permutation"
19+
}

0 commit comments

Comments
 (0)