inventory-framework icon indicating copy to clipboard operation
inventory-framework copied to clipboard

Find a better way to check this "noneMatch" to remove isContainedWithin from bui...

Open github-actions[bot] opened this issue 1 year ago • 0 comments

since slot can be re-defined on render and this interceptor runs before it

https://github.com/DevNatan/inventory-framework/blob/df2f99a173653836bdae94434af7f0ebafb3e417/inventory-framework-core/src/main/java/me/devnatan/inventoryframework/pipeline/AvailableSlotInterceptor.java#L115


        if (context.getContainer().hasItem(slot)) return false;

        // we need to check component factories since components don't have been yet rendered
        // TODO Find a better way to check this "noneMatch" to remove isContainedWithin from builder
        //      since slot can be re-defined on render and this interceptor runs before it
        return context.getComponentFactories().stream()
                .filter(componentFactory -> componentFactory instanceof ItemComponentBuilder)
                .map(componentFactory -> (ItemComponentBuilder<?, ?>) componentFactory)

github-actions[bot] avatar Nov 24 '23 15:11 github-actions[bot]