From cd0880407a31db2e86c50267c1698bf3f958cd32 Mon Sep 17 00:00:00 2001 From: Daan Verstraten Date: Tue, 19 Nov 2024 09:05:45 +0100 Subject: [PATCH] adding simplification --- .../BehaviorPack/Item/components/diagnose.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Lib/Diagnostics/BehaviorPack/Item/components/diagnose.ts b/src/Lib/Diagnostics/BehaviorPack/Item/components/diagnose.ts index f466de6..ef02b49 100644 --- a/src/Lib/Diagnostics/BehaviorPack/Item/components/diagnose.ts +++ b/src/Lib/Diagnostics/BehaviorPack/Item/components/diagnose.ts @@ -47,21 +47,21 @@ const component_test: Record = { saddle: deprecated_component(), "minecraft:entity_placer": (name, component, context, diagnoser) => { if (Array.isArray(component.dispense_on)) - component.dispense_on.forEach((block: string) => { - if (typeof block == 'object' && 'name' in block) behaviorpack_check_blockid((block as { name: string }).name, diagnoser) + component.dispense_on.forEach((block: string | { name: string }) => { + if (typeof block == 'object' && 'name' in block) behaviorpack_check_blockid(block.name, diagnoser) else if (typeof block == 'string') behaviorpack_check_blockid(block, diagnoser); }); if (Array.isArray(component.use_on)) - component.use_on.forEach((block: string) => { - if (typeof block == 'object' && 'name' in block) behaviorpack_check_blockid((block as { name: string }).name, diagnoser) + component.use_on.forEach((block: string | { name: string }) => { + if (typeof block == 'object' && 'name' in block) behaviorpack_check_blockid(block.name, diagnoser) else if (typeof block == 'string') behaviorpack_check_blockid(block, diagnoser); }); if (component.entity) behaviorpack_entityid_diagnose(component.entity, diagnoser); }, "minecraft:block_placer": (name, component, context, diagnoser) => { if (Array.isArray(component.use_on)) - component.use_on.forEach((block: string) => { - if (typeof block == 'object' && 'name' in block) behaviorpack_check_blockid((block as { name: string }).name, diagnoser) + component.use_on.forEach((block: string | { name: string }) => { + if (typeof block == 'object' && 'name' in block) behaviorpack_check_blockid(block.name, diagnoser) else if (typeof block == 'string') behaviorpack_check_blockid(block, diagnoser); }); if (component.block) {