The class is a custom slot (extends Slot), part of the custom gui.
I guess it's from the client side...
And yes, the entity is handling the inventory.
The customSlot class declaration is in the custom block container.
And moving the 'if' statement doesn't help, has the same effect.
However, when the player level is about 8, it works perfectly,
but when the player level is 2 or 3, it doesn't decrement the stack in slot 0.