Optimizing with stacking restrictions

This code sample describes how the engine behaves depending on the stacking restrictions. The stacking restrictions are part of the options/stackingOptions.

With the stacking restrictions, it is possible to allow or forbid items to be stacked on top of others, using directly the itemId.
The following code sample shows the different stacking restrictions, that you could apply with only 3 different types of item.