Multiple Improvement #22
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.
This pull request introduces a new set of commands to reset shop limits (for all, player, and server scopes), improves the handling of item selling limits in the shop, and enhances the messaging and API to support these features. The most important changes are grouped below:
New limit reset command suite:
Added a new
CommandShopResetLimitcommand with subcommands for resetting all limits, player limits, and server limits, including support for resetting by item or for all items. This includes the new filesCommandShopResetLimit.java,CommandShopResetLimitAll.java,CommandShopResetLimitPlayer.java, andCommandShopResetLimitServer.java, and registers the new command inCommandShop. [1] [2] [3] [4] [5]Extended the
LimiterManagerAPI to allow querying limits byLimitTypeand implemented this inZLimitManager. [1] [2]Shop selling logic and limit enforcement improvements:
Enhanced the logic for selling items in bulk (
sellAllContent) to correctly enforce player and server sell limits, only allow selling up to the allowed limit, and update item amounts and prices accordingly. This includes tracking the total amount sold per action and updating how inventory is modified and results are reported. [1] [2] [3] [4] [5] [6] [7]Updated the
ShopActionclass to track the total amount sold and provide methods for adjusting this value, supporting the new enforcement logic. [1] [2]User-facing messages and descriptions:
Messageenum for the new reset limit commands and their outcomes, improving user feedback.Code quality and minor improvements:
ZLimitManagerand made minor improvements to method signatures and null checks. [1] [2] [3]