Open appgurueu opened 2 years ago
The confusion here is likely to stem from the fact that ItemStack
is a mutable reference type, yet all functions & callbacks using ItemStack
s pass them "by value", copying them (constrast this with e.g. vectors which are mutable but only provide methods that return copies, thus making it apparent that you have to feed the vector back in using some setter). I wonder whether such a note would suit the ItemStack
doc well?
on_use
etc. Include a note that prevents people from making the common mistake of trying to modify the inventory before/instead of returning the itemstack they want to be set.