Search in sources :

Example 1 with CombinedInvWrapper

use of net.minecraftforge.items.wrapper.CombinedInvWrapper in project RecurrentComplex by Ivorforce.

the class ItemHandlers method complete.

public static CombinedInvWrapper complete(ICapabilityProvider provider) {
    List<IItemHandlerModifiable> handlers = new ArrayList<>();
    Arrays.stream(EnumFacing.VALUES).forEach(f -> {
        if (provider.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, f)) {
            IItemHandler capability = provider.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, f);
            if (capability instanceof IItemHandlerModifiable)
                handlers.add((IItemHandlerModifiable) capability);
        }
    });
    return new CombinedInvWrapper(handlers.toArray(new IItemHandlerModifiable[0]));
}
Also used : IItemHandlerModifiable(net.minecraftforge.items.IItemHandlerModifiable) CombinedInvWrapper(net.minecraftforge.items.wrapper.CombinedInvWrapper) IItemHandler(net.minecraftforge.items.IItemHandler) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 IItemHandler (net.minecraftforge.items.IItemHandler)1 IItemHandlerModifiable (net.minecraftforge.items.IItemHandlerModifiable)1 CombinedInvWrapper (net.minecraftforge.items.wrapper.CombinedInvWrapper)1