Stacking bug fix and performance improvements

Fixed food not stacking properly
Reduced CPU load on client side