Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce calls to Bukkit.isPrimaryThread(). Provide optimized methods.
Where it's known that it's the primary thread, that test should be omitted. A remaining problem is the Check class, where the convenience methods all will lead to testing for Bukkit.isPrimaryThread(). This needs to be done differently. It'll be hard/impossible to work around, if we have to check permissions and meta data. For permissions we could do some kind of bulk/context dependent caching and updating policy and check via PlayerData, but meta data needs the Bukkit API to state thread safety. Future design could also do without knowledge of the thread, if permissions are cached and exemption by meta data is turned off (or also cached, but this only works if other plugins don't use it for temporary exemption), a lazy approach could pass on an AlmostBoolean isPrimaryThread. For now, at least some of the frequently run moving checks use the optimized approach.
- Loading branch information
Showing
6 changed files
with
61 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters