Error trying to cancel ClickInventoryEvent

public void onItemCraft(ClickInventoryEvent event, @First Player player, @Getter("getTargetInventory") Inventory inventory) {
    if (inventory.getArchetype() == InventoryArchetypes.WORKBENCH || inventory.getArchetype() == InventoryArchetypes.ANVIL) {
        event.getTransactions().forEach(slotTransaction -> {
            if(slotTransaction.getOriginal().get(Keys.ITEM_LORE).isPresent()) {
                event.setCancelled(true);
            }
        });
    }
}

So I was using this code to block placing items in a workbench or anvil if it had lore, just to stop people from renaming or editing special items. Well the workbench part works just fine, but whenever I try the same item in an anvil the item just disappears and I get the following error.

https://pastebin.com/LHXpmCJf

This only happens when I cancel the event, as I can do anything else to the item just fine.

Please make it an issue on GitHub.

I’ll look into it.

As this was closed on github, I’ll mention it here. I updated to the latest version of spongeforge (3355) and it is still giving the same error.

You can respond to closed issues as well. https://github.com/SpongePowered/SpongeCommon/issues/2022
I don’t follow everything in the forums and noticed your response just now.

Anyways I’ll need an updated error log for latest.

I’ve updated the issue on github.