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
    public LootPoolEntryType getType() {
        return LootPoolEntries.GROUP;
    }
    
    @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 dbg3 = arr[0];
                final ComposableEntryContainer dbg4 = arr[1];
                final ComposableEntryContainer composableEntryContainer;
                final ComposableEntryContainer composableEntryContainer2;
                return (dat, consumer) -> {
                    composableEntryContainer.expand(dat, consumer);
                    composableEntryContainer2.expand(dat, consumer);
                    return true;
                };
            }
            default: {
                int length;
                int i = 0;
                ComposableEntryContainer dbg5;
                return (dat, consumer) -> {
                    for (length = arr.length; i < length; ++i) {
                        dbg5 = arr[i];
                        dbg5.expand(dat, consumer);
                    }
                    return true;
                };
            }
        }
    }
}
