@@ -534,9 +575,7 @@ function ListBody({ type: outerType, node, makeEdit, ctx }: ListBodyProps) {
return <>>
}
const type = (node.typeDef?.kind === 'list' || node.typeDef?.kind === 'byte_array' || node.typeDef?.kind === 'int_array' || node.typeDef?.kind === 'long_array') ? node.typeDef : outerType
- const fixedRange = type.lengthRange?.min !== undefined && type.lengthRange.min === type.lengthRange.max
-
- const canAdd = !fixedRange && (type.lengthRange?.max ?? Infinity) > (node?.children?.length ?? 0)
+ const canAdd = (type.lengthRange?.max ?? Infinity) > (node?.children?.length ?? 0)
const onRemoveItem = useCallback((index: number) => {
makeEdit(() => {
@@ -616,19 +655,17 @@ function ListBody({ type: outerType, node, makeEdit, ctx }: ListBodyProps) {
return
@@ -853,6 +890,7 @@ function getCategory(type: McdocType) {
case '::java::data::loot::LootCondition':
case '::java::data::worldgen::dimension::biome_source::BiomeSource':
case '::java::data::worldgen::processor_list::ProcessorRule':
+ case '::java::data::worldgen::feature::placement::PlacementModifier':
return 'predicate'
case '::java::data::loot::LootFunction':
case '::java::data::worldgen::density_function::CubicSpline':
diff --git a/src/app/components/previews/Decorator.ts b/src/app/components/previews/Decorator.ts
index f65b4c78..f3a37820 100644
--- a/src/app/components/previews/Decorator.ts
+++ b/src/app/components/previews/Decorator.ts
@@ -62,7 +62,9 @@ function decorateY(pos: BlockPos, y: number): BlockPos[] {
}
export function sampleInt(value: any, ctx: PlacementContext): number {
- if (typeof value === 'number') {
+ if (value === undefined) {
+ return 0
+ } else if (typeof value === 'number') {
return value
} else if (value.base) {
return value.base ?? 1 + ctx.nextInt(1 + (value.spread ?? 0))