Item Stacker Configuration & Enhancements#1
Open
AIPTU wants to merge 2 commits into
Open
Conversation
Updates the EventListener to enhance efficiency by: - Using a calculated AxisAlignedBoundingBox for faster entity lookups. - Cloning the item before mutation to adhere to better state management.
…roved logic
- Add config.yml support with stacking_radius, max_global_stack_size, tag_format, and display_single_stack_tag options
- Implement strict config validation with fallback defaults and warning logs
- Replace hardcoded 5-block radius with configurable stackRadius
- Add max_global_stack_size to enforce stack limits beyond vanilla max stack
- Support custom name tag formatting with {COUNT} and {ITEM_NAME} placeholders
- Add display_single_stack_tag option to show/hide tags for single items
- Implement proper stack overflow handling with remainder item spawning
- Fix entity stacking logic to respect max stack sizes and prevent item loss
- Add AxisAlignedBB for precise radius-based entity detection
- Improve name tag display logic with conditional visibility
- Reset despawn delay on stacked items to prevent premature despawning
- Add proper item cloning to prevent reference issues
- Implement getter methods for config access in Loader class
BREAKING CHANGE: Stacking behavior now configurable via config.yml, hardcoded values removed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR adds configuration support and improves the item stacking logic with better validation and overflow handling.
Changes
config.ymlsupport with configurable options:stacking_radius- customizable detection radius (default: 5.0)max_global_stack_size- enforce stack limits (default: 1024)tag_format- custom name tag formattingdisplay_single_stack_tag- show/hide tags for single itemsBreaking Changes
config.yml. Server owners need to configure the plugin on first run.Testing