Skip to content

onItemRelease not working with PaginatedView #26

@devnatan

Description

@devnatan

The check is only being applied to View items, which have been statically defined so it'll not work with items set in context.

https://github.com/DevNatan/inventory-framework/blob/2e09622589c0ae27fc2d31b0dacc2e0d2a2517c2/src/main/java/me/saiintbrisson/minecraft/ViewListener.java#L138

Reproducible code:

slot(1, new ItemStack(Material.REDSTONE));
context.slot(2, new ItemStack(Material.DIAMOND));

...

@Override
protected void onItemRelease(ViewSlotContext from, ViewSlotContext to) {
    from.getPlayer().sendMessage("Item released");
}

Hold and release the REDSTONE, will work fine, prints "Item released".
Hold and release the DIAMOND, nothing happens.

Also, it won't work with PaginatedViewContext as these contexts don't store item information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions