Hello,
I want to have a block, which will take on a texture of a block which player holds in hand if he right clicks on the block placed in the world. So far I got it to change as I like, but it changes all blocks instead of just the single one I clicked on. I suspect, it's because the blocks in game are all just a single object instance and world just has bunch on references to it.
How can I then change the single blockstate (or rather, it's texture, if it helps) ? Do I need to create some kind of registry, which will remember block positions and their blockstates and load the blockstate based on the block position ? Is there something more optimal, because if I have a arraylist of, let's say, 2k block positions and their block states which I need update every so often, I think it's gonna get slow real quick. Or if this IS the best way, then how can I save the registry, so after server restarts, it's gonna remember them?