Prisonpearl cost initial pull #15
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.