added a config-entry to selectively ignore causes of the back-in-listener #6373
+53
−1
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.
Information
This PR aims to add a simple and very much non-invasive feature to Essentials. I didn't create an issue beforehand, seeing how it would be much easier to explain my requirements with a concrete implementation - one that only took a few minutes anyway.
Details
The existing config-entry
register-back-in-listenerallows to update the last-location of a player by not just internal features, but also by teleportation caused by external plugins. The issue I ran into was that this becomes either an "all" or "nothing" option, as the user cannot selectively exclude plugins. Teleporting players is such a ubiquitous action that it is virtually impossible to make all of these plugins talk to the Essentials API and provide an option for whether to affect the last-location themselves. It is much more reasonable to enable the user to selectively block plugins from indirectly modifying this state.I've added descriptive comments to the newly introduced config-entry and hope that they properly explain the syntax. If they lack in clarity, I am always willing to improve them, given some feedback.
Last but not least, I wasn't quite able to follow on how Essentials migrates new keys into the existing config on the user's machine, so any hints would be much appreciated! The current setup of it simply being absent and requiring manual adding is not ideal.
Environments tested:
OS: Fedora Linux 42 (Workstation Edition)
Java version: 21.0.9
Demonstration:
There's not much to demonstrate here, other than the observation that if I add an entry of
'craftbook,elevator'to the ignore-list, players on our server will never/backto the location of a lift, which has been a real nuisance since we've tried to enable/backfor other plugins, like shop-search, etc.