As a learning step on my way to building a custom ship mod, I am trying to get working a wand item that deletes a block and replaces it with an entity that looks and feels exactly like the block.
Seems reasonably straightforward, and it mostly works, but when my renderer tries to access the blockId of the deleted block (which I store in the new entity) it is rendering, the code fails (so currently the best I can do is render all the entities as the same arbitrary block type...)
This is because the default entity constructor, Entity(World) is called (not by me!) by cpw.mods.fml.client.FMLClientHandler.spawnEntityIntoClientWorld() at some point after my world.spawnEntityInWorld( entity ) call, and before the renderer starts rendering, which resets the blockId stored in the entity to 0 before the renderer can use it.
I assume this all happens because of something I've done wrong somewhere...
Is it related to something happening on the client side that shouldn't be happening?
Is it anything to do with how/where I have registered my entity/renderer, etc?
What can I do to stop this extra call to the default constructor of my entity?
My wand item that turns a block to an entity:
My entity that looks and feels like a block:
My renderer for the entity:
And just in case, here is my mod class, and client proxy (my common proxy has nothing happening in it):