Hey everyone!
I've come across an interesting use case of the custom items I am creating for my mod. The item is simple, and has no real complicated code. All I need, is each instance of the item to have a special array of different values sent for it to store given to it by what creates it.
Below are code snippets showing the default implementation. The names have been generalized for easy of readability.
ObjectHolder:
The item class:
Registry:
Renderer:
Entity that 'spawns'/drops the item
Now obviously the main issues, is that the item instantiated in MobItems, is the one and only instance, so obviously whenever I try to call the "setDifferences" method, it overrides what is in use.
I can very easily circumvent this, by creating a new instance of the object(using the same registry names) when the entity calls "dropItem", passing it through the new item that I have called setDifferences.
This works. However the result is obviously an object that is a purpleblack box because the renderer doesn't have THAT specific object registered.
So my question is how can I possible have the spawning of new items done in a fashion were I can treat them all as their own individual objects and set their own variables?
If anyone has some ideas or possibly even separate implementations, I'm all ears. :)