MinecraftDev icon indicating copy to clipboard operation
MinecraftDev copied to clipboard

Warn about mutable state on Item or Block classes

Open williewillus opened this issue 2 years ago • 0 comments

This idea came out of BlanketCon where TerrariaMod had an absolute ton of Items that would mutate state directly on the Item instance, which is incorrect as it globally affects all stacks of that item.

I'm thinking of a lint that fires on any instance-fields that are not final on an Item or Block class. Such state is often indicative of incorrect design, where the modder should really be storing state on the item stack instead.

williewillus avatar Jun 15 '22 02:06 williewillus