Skip to content

Commit

Permalink
adding simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanV2 authored Nov 19, 2024
1 parent 55a6073 commit cd08804
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Lib/Diagnostics/BehaviorPack/Item/components/diagnose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ const component_test: Record<string, ComponentCheck> = {
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) {
Expand Down

0 comments on commit cd08804

Please sign in to comment.