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]));
}
Aggregations