public class ParcelItem extends Item implements ICapabilityProvider {
LazyOptional<ItemStackHandler> inventoryHandler = LazyOptional.of(this);
public ParcelItem(Properties properties) {
super(properties);
}
@Override
public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
return inventoryHandler.cast();
}
return null;
}
}
Alright, i will make sure to use that instead, although, this is currently what I have. From the docs i understand i have to use a lazy optional and use the IItemHandler(im guessing replacing it with ItemStackHandler is fine consider it uses IItemHandler as a base). I thought i could pass the class as the supplier though but it seems i was mistaken. What exactly am i supposed to pass to it? Am i even supposed to do it like this?