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.
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:
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.