Hey guys,
Basically I just need help figuring out if a coremod is necessary. In the mod, I need my own version of a chunk, and so I have 2 options of how I could approach the problem.
Option A
The way I was doing it when it was a plugin for bukkit. Because bukkit was server sided, my only option was to create my own class.
When a chunk was loaded for the first time, I'd grab the info from the chunk that I needed to 'link' my class with it (The X/Z/world values) and then add my class into a hashmap that was keyed with a string like so: "world:x:z". From then on, when I needed my class, I'd just search the hashmap with the info from the chunk a player was in.
I could easily do this again, or I could do...
Option B
In which I use ASM to insert the new variables that I want into the chunk class.
Option B seems like it would make things easier and reduce the mods impact (Because I wouldn't be storing a bunch of classes), but I don't know much about coremods, so I come to you guys for an opinion.
Some additional info:
The world is contained. The players can't just run around opening up infinite amounts of chunks, so the hashmap won't grow to an absurd size.
I only need to add 3 or 4 variables, and a few methods to manipulate them.
If done with option A, the hashmap saves to a new file on the server. This wouldn't be needed with option B as it'll be saved by minecraft itself in the region files.
So, what is the best way to deal with it? Is this a good enough reason to modify a base class, or should I keep doing it my old way?
Thank in advance,
Perdog