diff --git a/src/app/schema/renderHtml.tsx b/src/app/schema/renderHtml.tsx index 2c268d54..36c66d85 100644 --- a/src/app/schema/renderHtml.tsx +++ b/src/app/schema/renderHtml.tsx @@ -16,6 +16,7 @@ import { deepClone, deepEqual, generateColor, generateUUID, hexId, hexToRgb, isO import { ModelWrapper } from './ModelWrapper.js' const selectRegistries = ['loot_table.type', 'loot_entry.type', 'function.function', 'condition.condition', 'criterion.trigger', 'recipe.type', 'dimension.generator.type', 'dimension.generator.biome_source.type', 'dimension.generator.biome_source.preset', 'carver.type', 'feature.type', 'decorator.type', 'feature.tree.minimum_size.type', 'block_state_provider.type', 'trunk_placer.type', 'foliage_placer.type', 'tree_decorator.type', 'int_provider.type', 'float_provider.type', 'height_provider.type', 'structure_feature.type', 'surface_builder.type', 'processor.processor_type', 'rule_test.predicate_type', 'pos_rule_test.predicate_type', 'template_element.element_type', 'block_placer.type', 'block_predicate.type', 'material_rule.type', 'material_condition.type', 'structure_placement.type', 'density_function.type', 'root_placer.type', 'entity.type_specific.cat.variant', 'entity.type_specific.frog.variant', 'rule_block_entity_modifier.type', 'pool_alias_binding.type', 'lithostitched.worldgen_modifier.type', 'lithostitched.modifier_predicate.type', 'ohthetreesyoullgrow.configured_feature.type'] +const datalistEnums = ['item_stack.components', 'function.set_components.components'] const hiddenFields = ['number_provider.type', 'score_provider.type', 'nbt_provider.type', 'int_provider.type', 'float_provider.type', 'height_provider.type'] const flattenedFields = ['feature.config', 'decorator.config', 'int_provider.value', 'float_provider.value', 'block_state_provider.simple_state_provider.state', 'block_state_provider.rotated_block_provider.state', 'block_state_provider.weighted_state_provider.entries.entry.data', 'rule_test.block_state', 'structure_feature.config', 'surface_builder.config', 'template_pool.elements.entry.element', 'decorator.block_survives_filter.state', 'material_rule.block.result_state'] const inlineFields = ['loot_entry.type', 'function.function', 'condition.condition', 'criterion.trigger', 'dimension.generator.type', 'dimension.generator.biome_source.type', 'feature.type', 'decorator.type', 'block_state_provider.type', 'feature.tree.minimum_size.type', 'trunk_placer.type', 'foliage_placer.type', 'tree_decorator.type', 'block_placer.type', 'rule_test.predicate_type', 'processor.processor_type', 'template_element.element_type', 'nbt_operation.op', 'number_provider.value', 'score_provider.name', 'score_provider.target', 'nbt_provider.source', 'nbt_provider.target', 'generator_biome.biome', 'block_predicate.type', 'material_rule.type', 'material_condition.type', 'density_function.type', 'root_placer.type', 'entity.type_specific.type', 'glyph_provider.type', 'sprite_source.type', 'rule_block_entity_modifier.type', 'immersive_weathering.area_condition.type', 'immersive_weathering.block_growth.growth_for_face.entry.direction', 'immersive_weathering.position_test.predicate_type', 'pool_alias_binding.type', 'item_stack.id', 'data_component.banner_patterns.entry.pattern', 'data_component.container.entry.slot', 'map_decoration.type', 'suspicious_stew_effect_instance.id'] @@ -201,7 +202,7 @@ const renderHtml: RenderHook = { map({ children, keys, config }, path, value, lang, version, states, ctx) { const { expand, collapse, isToggled } = useToggles() - const keyPath = new ModelPath(keysModel, new Path([hashString(path.toString())])) + const keyPath = new ModelPath(keysModel, new Path([hashString(path.toString())], path.contextArr)) const onAdd = () => { const key = keyPath.get() if (path.model.get(path.push(key)) === undefined) { @@ -447,7 +448,7 @@ function StringSuffix({ path, getValues, config, node, value, lang, version, sta if (nbtFields.includes(context)) { return - } else if ((isEnum(config) && !config.additional) || selectRegistries.includes(context)) { + } else if ((isEnum(config) && !config.additional && !datalistEnums.includes(context)) || selectRegistries.includes(context)) { let childPath = new Path([]) if (isEnum(config) && typeof config.enum === 'string') { childPath = childPath.contextPush(config.enum)