package net.minecraft.world.level.storage.loot.entries;

import java.util.function.Consumer;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition;

public class EntryGroup extends CompositeEntryBase {
    EntryGroup(final LootPoolEntryContainer[] arr, final LootItemCondition[] arr) {
        super(arr, arr);
    }
    
    @Override
    protected ComposableEntryContainer compose(final ComposableEntryContainer[] arr) {
        switch (arr.length) {
            case 0: {
                return EntryGroup.ALWAYS_TRUE;
            }
            case 1: {
                return arr[0];
            }
            case 2: {
                final ComposableEntryContainer csi3 = arr[0];
                final ComposableEntryContainer csi4 = arr[1];
                final ComposableEntryContainer composableEntryContainer;
                final ComposableEntryContainer composableEntryContainer2;
                return (crx, consumer) -> {
                    composableEntryContainer.expand(crx, consumer);
                    composableEntryContainer2.expand(crx, consumer);
                    return true;
                };
            }
            default: {
                int length;
                int i = 0;
                ComposableEntryContainer csi5;
                return (crx, consumer) -> {
                    for (length = arr.length; i < length; ++i) {
                        csi5 = arr[i];
                        csi5.expand(crx, consumer);
                    }
                    return true;
                };
            }
        }
    }
}
