At first, let me explain why I want to do this.
I want to implement food spoilage mechanics in my mod. In theory, I could have used the Item#onUpdate method, but as far as I am aware, this method gets invoked only when the item is carried by some entity. After a while, I came up with an idea, where all ItemStacks having their item instance of ItemFood would be registered in some sort of registry which would be iterated on every world tick (using TickEvent.WorldTickEvent) and have those stacks updated (possibly calling onUpdate with entity parameter null, I don't know yet).
So, to my problem. To achieve this, I need to modify the bytecode of the ItemStack class (at very least the constructor) to broadcast a custom defined event across forge event bus (this event would be used to register the stack to the tick handler, but this is irrelevant now). I have studied some ASM and java bytecode for last few days, but I can't see how I would register that class loader. I have also read something about coremods, but all these posts were written for 1.6 versions and the moderators were never too much satisfied with the coremod approach.
So, to conclude; Is there any way Forge has those ASM injecting routines handled? If so, can you give me an exaple how to register such class visitor into the forge's framework? Or, if possible, is there a way better approach than that I am suggesting?
Many thanks for all your time in advance.