Feature to log and if necessary reverse player edits on demand.
* Vector playerEdits field in Player object to store all edits made by a player (Unique edit ID, Position, former block type)
* Fourth dimension in blocks array for the ID of the last player to change a block at that location.
Isn't this going to be pretty heavy on memory, especially with a 4th dimension?
I'm not sure how else to do it, but it's a feature that seems to be in some demand. Perhaps make it optional?
It would be a nice feature, however also very heavy on memory.
An alternative, assuming undos would be a not common occurrence, would be to store the 4 dimension on the disk instead of in memory.
There also another alternative maybe. By using some kind of dynamic memory you could just store information about those blocks that actually changed instead of for example all the Z-block. After some time old undos would be removed. (after some days for example)
If I understand correctly, this wouldn't actually be a 4th dimension - it would only be an extra attribute in the 3D array, right? If the players were stored in a file giving each player to log in an ID, then each player could be identified with an Integer. (a HashMap would be created from the file at the beginning at the start of the server). Then the player's ID could be in a separate 3D array, and only 4 bytes per block, this wouldn't be an impossible increase in memory.
If you want a full history of all the edits done to a block, then it would be 4D. (A very jagged array though.) But then, old edits would probably not be need very often, so you could store histories in external files...but that's really complicated now.