Skip to content

Item Stacker Configuration & Enhancements#1

Open
AIPTU wants to merge 2 commits into
Terpz710:masterfrom
AIPTU:master
Open

Item Stacker Configuration & Enhancements#1
AIPTU wants to merge 2 commits into
Terpz710:masterfrom
AIPTU:master

Conversation

@AIPTU
Copy link
Copy Markdown

@AIPTU AIPTU commented Oct 26, 2025

Description

This PR adds configuration support and improves the item stacking logic with better validation and overflow handling.

Changes

  • ✨ Added config.yml support 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 formatting
    • display_single_stack_tag - show/hide tags for single items
  • ✅ Implemented strict config validation with fallback defaults
  • 🔧 Fixed stack overflow handling - excess items now spawn as new drops
  • 🏷️ Improved name tag display with conditional visibility
  • ⏱️ Reset despawn delay on stacked items to prevent premature despawning
  • 🎯 Replaced hardcoded values with configurable parameters

Breaking Changes

⚠️ Stacking behavior is now controlled via config.yml. Server owners need to configure the plugin on first run.

Testing

  • Config validation works with invalid values
  • Stack overflow creates new item entities correctly
  • Name tags display according to configuration
  • Max stack size is properly enforced

AIPTU added 2 commits October 26, 2025 19:36
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant