TVPT / VoxelGunsmith

Equipping VoxelSniper. The API for the popular Long Range Terraforming plugin VoxelSniper.
MIT License
20 stars 3 forks source link

Player History Buffer #3

Closed Deamon5550 closed 9 years ago

Deamon5550 commented 9 years ago

A 'history buffer' is needed for all players. This history buffer will be a Stack of Change-queues. These Change-queues will be the Inverse Change-queues to the Change-queues flushed to the world by the player. All Change-queues within the history buffer beyond a configured size will be discarded upon the addition of a new Change-queue.

CommonPlayer.undoHistory(int n) should flush the most recent n Change-queues from the history buffer to the world they are from. This will have the effect of reversing previous changes performed by the player.

An implementation is needed for ChangeQueue.invert() for all currently implemented Change-queues.