use of net.minecraft.world.level.block.entity.BarrelBlockEntity in project Create by Creators-of-Create.
the class MountedStorage method canUseAsStorage.
public static boolean canUseAsStorage(BlockEntity te) {
if (te == null)
return false;
if (te instanceof MechanicalCrafterTileEntity)
return false;
if (AllTileEntities.CREATIVE_CRATE.is(te))
return true;
if (te instanceof ShulkerBoxBlockEntity)
return true;
if (te instanceof ChestBlockEntity)
return true;
if (te instanceof BarrelBlockEntity)
return true;
if (te instanceof ItemVaultTileEntity)
return true;
LazyOptional<IItemHandler> capability = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY);
IItemHandler handler = capability.orElse(null);
return handler instanceof ItemStackHandler && !(handler instanceof ProcessingInventory);
}
Aggregations