Exultant/PrisonPearl — pull request #15 by bodhidharma420 (2013-02-11 16:51:54+00:00)
Title: Prisonpearl cost initial pull

Includes ppfeed command (working), as well as ppfeed called automatically in onEnable (executes at startup).

I'm not sure why (excuse me, I'm new at github), but the "files changed" dialog shows a lot of stuff being added that, to my knowledge, was already there. If this is disruptive and can't be dealt with on your end, I can try to do a fresh fork and insert our bits of code again.

Also included are is as-yet-unfinished pprestore functionalities, which will eventually allow rollback of ppfeed actions. Currently, the ppfeed method creates a string that logs players freed and pearls fed, including location information about the chest in which the action occurs.

The rollback itself would involve repearling pearled players, and placing coal in chests from which it was taken. Possible edge cases are when a chest doesn't have space to store a restored pearl or coal, or when the chest itself is no longer present at that location. In all of these edge cases, I recommend a "tough shit" policy. It's a lot easier to communicate to players "You must have a chest in the same location, with empty space, in order to get your pearls/coal back" than try and code decisions about inventing chests, managing inventory to make space, etc.

What's left to code is a way of storing this string in a textfile, a manager which is able to retrieve the most recent log textfile, and an interpreter which can read the file and perform the rollback.