fix: click limiter + parsing #219
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 per-inventory setting to enable or disable the click limiter, allowing more granular control over click rate limiting in inventories. It also improves YAML parsing robustness and updates the click limiter logic to only apply when enabled at both the global and inventory level. Several interfaces and classes have been updated to support these changes.
Click Limiter Enhancements:
isClickLimiterEnabledandsetClickLimiterEnabledmethods to theInventoryandBaseInventoryinterfaces, and implemented them inZInventoryandVInventoryto allow enabling/disabling the click limiter per inventory. [1] [2] [3] [4] [5] [6]InventoryLoaderto read theclick-limiter-enabledsetting from configuration files, defaulting totrueif not specified.InventoryDefaultto propagate the click limiter setting from the loaded inventory.PacketEventClickLimiterListenerso that click limiting is only applied if both the global config and the specific inventory have the limiter enabled. [1] [2] [3]config.ymlto indicate the limiter only applies to zMenu inventories.YAML Parsing Improvements:
YamlParserto handle integer, double, float, long, and boolean values correctly, and added a utility to convert map keys to strings, improving compatibility with YAML files that use non-string keys. [1] [2] [3]Other Minor Improvements:
instanceofinComponentMeta.InventoryLoader.